Skip to main content
14-Alexandrite
April 14, 2024
Solved

Mathcad 15 3D graph surface contour challenge

  • April 14, 2024
  • 1 reply
  • 7602 views

I wish to map calculation results in a 2D matrix onto the surface of a hemisphere to produce a "heart map" showing the magnitide (colour) and orientation of the maxima and minima in the dataset. The matrix data are the result of calculation of stresses on a plane for a grid that has been incremented by 15 degrees in the polar and azimuthal directions. I can generate a hemisphere with the appropriate 15 degree grid but do not know how to map my data to this grid. Can it be done? Any assistance would be appreciated.

Cheers

Ross

 

Best answer by Werner_E

Your question reminded me of an old thread in which a user was also interested in a special coloring of a 3D plot of a helix using a given function. Back then, I 'solved' it in such a way that I realized the coloring by plotting many individual points in the desired colors. A separate plot would have to be set up and formatted for all points of the same color. Quite laborious, which is why I limited myself to just 16 colors. The thread and the files created back then are still available here, if you are interested:

Re: Solid Helix with Surface Color defined by Inde... - PTC Community

Werner_E_0-1713093709514.gifWerner_E_1-1713093961793.gif

 

 

I guess using this method could also help creating the 3D sphere you are looking for but it may be quite some work to do.

1 reply

25-Diamond I
April 14, 2024

I can't think of an easy way to color the sphere according to a stress function.

 

Her some general thoughts:

 

Your plots of the stresses (plots of X, Y and Z) lack of correct axis labels. These labels simply are the indices of the matrix and not the azimut and polar angle values.

Here is a way to create these plots with correct axis labels. I also use a functional approach:

Werner_E_0-1713090331844.png

In case you'd rather would like to see the axis scaled in degree, you could do it that way:

Werner_E_1-1713090389163.png

 

I now mapped the the angle values to their appropriate xy-values. What you get is not the 3D plot you were asking for but at least its normal projection to the xy-plane.

Mathcads 3D plots (on contrary to its 2D plots) does not accept/ignore Nan's or imaginary values but rather refuses to plot . So I had to replace the values for these points (points outside of the circle) by a number and I had chosen -10 as this seems to be lower than all regular stresses calculated. The value should not be set too low as its considered by the color map of the contour plot and you get less colors for the area inside the circle. You also may play around with the number of contour line (tab "Special" in the 3-D Plot Format menu)

Werner_E_0-1713114263759.png

 

Because min and max stress values differ in the three plots, same color does not mean same stress.

We may add a legend for each plot for a visualization which color corresponds to which stress amount. Its a simple contour plot itself which can be formatted to your needs:

Werner_E_2-1713115267504.png

 

 

 

Werner_E25-Diamond IAnswer
25-Diamond I
April 14, 2024

Your question reminded me of an old thread in which a user was also interested in a special coloring of a 3D plot of a helix using a given function. Back then, I 'solved' it in such a way that I realized the coloring by plotting many individual points in the desired colors. A separate plot would have to be set up and formatted for all points of the same color. Quite laborious, which is why I limited myself to just 16 colors. The thread and the files created back then are still available here, if you are interested:

Re: Solid Helix with Surface Color defined by Inde... - PTC Community

Werner_E_0-1713093709514.gifWerner_E_1-1713093961793.gif

 

 

I guess using this method could also help creating the 3D sphere you are looking for but it may be quite some work to do.

25-Diamond I
April 14, 2024

OK, I couldn't resist and adapted the method from the old worksheet to the new task. Since the plot region with the 18 individual plots could be taken over from there (including the colors used there), the work was limited to the "makePoints" function, which calculates a series of points on the sphere with their stress values and then sorts the points into one of 16 matrices depending on the stress value.

So here are your spheres ...

Werner_E_0-1713122163812.png

Remark: I notice that the colors are modified (fades/pale, to the worse) when I insert a picture here in the forum. Not sure why. had not noticed that in former times ...

Mathcad 15 worksheet attached