Drawing an ellipsoid to visualize a tensor

Thank you a lot, Chris!
Your solution with Makie fully covers my original question.

My answer to your questions/suggestions is threefold:

  1. You are totally right - this tensor is non-symmetrical. I explain it a bit later on, while describing my applications below. Originally i was using S and V, and i do not remember exactly why U was not considered. I understand it in the following way - we have eigenvalues of the tensor which point along some “major” direction. Now we plot the “rotation” of this vector using our original coordinate system.
    May be it will get more clear from the application…
  2. My original application is to visualize tensorial physical properties of different materials. My first application (here is the proof of the first publication on the topic currently in press: https://drive.google.com/open?id=1_fCv_4DxmkHElNVxTUuAdV-v1d674r7S) is to visualize fluid permeability tensors. It is important to visually observe the difference in orientation and magnitude of different tensors, but simply looking at 3x3 matrix it is really hard to compare them or obtain some general idea of its properties.
    Permeability tensors are theoretically symmetrical. But in practice due to inaccuracies of numerical methods and some problems with boundary conditions resulting tensors are not symmetrical. I think we can fix that in future, current common solution is to average off-diagonal terms, e.g., xy and yx = (xy+yx)/2.
    I think there are plenty of physical properties for which tensors can be non-symmetrical… But we still want to visualize them of course.
    Hope this clarifies the aims, if not, please, let me know and i shall expand.
  3. Makie seems to be very able workframe. Now i am wondering if it is able to produce visualizations of numerous tensor ellipsoids like the one you produced here, e.g., something like was shown here: Array of boxes using Makie and volume - #2 by lazarusA
    Each subcube of a domain, say 10x10x10 subcubes, contains its own tensor visualization.
    I guess it can be solved by looping through 3d array of tensors and plotting ellipsoids at different locations corresponding to each position within 3d array. The trick would be to scale the size of ellipsoids to the largest one to prevent any overlaps…

Many thanks for your help again! I shall definitely use your solution in my research!

1 Like