cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

How to display a point on 3D Plot in Mathcad Prime?

Cornel
18-Opal

How to display a point on 3D Plot in Mathcad Prime?

Hello,

For 2D Plot:

CornelBejan_2-1683902249057.png
CornelBejan_3-1683902255953.png

CornelBejan_1-1683902232250.png

 

CornelBejan_4-1683902277125.png

 

 

 

For 3D Plot:

CornelBejan_0-1683901318592.png

CornelBejan_4-1683901641239.png

CornelBejan_3-1683901482875.png

 

I want to plot the point f1(2,1)=2, so the point where x=2 and y=1 on the 3D plot, and to display the point as it is showed in 2D Plot.
Is it possible to do this?

Mathcad Prime 8 file attached.
Thank you.

 

1 ACCEPTED SOLUTION

Accepted Solutions
JeffH1
14-Alexandrite
(To:Cornel)

Points can be plotted as a 3-column [ x, y, z ] matrix.  However, there have to be at least two rows in the matrix.  So, for your case, just repeat the same point twice as shown below.  Then change the Plot parameters for the Matrix to be points, no lines, a contrasting color, and increased line thickness.  Like this:

JeffH1_0-1683909601852.png

 

View solution in original post

6 REPLIES 6
JeffH1
14-Alexandrite
(To:Cornel)

Points can be plotted as a 3-column [ x, y, z ] matrix.  However, there have to be at least two rows in the matrix.  So, for your case, just repeat the same point twice as shown below.  Then change the Plot parameters for the Matrix to be points, no lines, a contrasting color, and increased line thickness.  Like this:

JeffH1_0-1683909601852.png

 

Werner_E
24-Ruby V
(To:Cornel)

The easiest way was already shown by Jeff.

A bit more elaborate is to create a constant vector function and use it for plotting 😉

Werner_E_0-1683926183013.png

You may also use "CreateSpace" to create a structure similar to what Jeff had created "by hand". Its a nested vector, though.

Werner_E_1-1683926286467.png

A nested vector like this was the only way you could plot a polygon in MC15, but that version would allow for a single point as well.
It may be see as a bug that Prime needs to double that single point. On the other hand its nice that we can use a simple matrix in Prime and don't necessarily need that nested structure.

 

EDIT:

Of course you don't need to double the point coordinates if you plot more than one point in one go

Werner_E_0-1683930105153.png

Es you can see the new symbolic in Prime is not able to deliver all zeros asked for, so I had to create the matrix which "solve" should have returned manually.

Here is what it looks like  in Mathcad

Werner_E_1-1683930193125.png

 

 

Cornel_0-1684054693879.png

 

I do not understand this M of how we create all the values "manually".
What exactly does this M program do? 

let's take two examples: 

Cornel_1-1684055546659.png

Cornel_3-1684055691007.png

 

 

Cornel_15-1684058010430.png

Cornel_17-1684058031130.png

Cornel_18-1684058041821.png

 

 

Cornel_19-1684058049945.png

Cornel_20-1684058056198.png

Cornel_21-1684058063458.png

 


And the second example:

Cornel_22-1684058181272.png

Cornel_24-1684058232495.png

 

Cornel_25-1684058239728.png

And the third example:

M7(x,y) := 2*y+(2-2*x) , -2*π<=x<=2*π, -π<=y<=π 

How this program of M will look like?

Werner_E
24-Ruby V
(To:Cornel)


@Cornel wrote:

Cornel_0-1684054693879.png

 

I do not understand this M of how we create all the values "manually".
What exactly does this M program do? 

No magic, just simple math.

You don't need a CAS to see that the partial derivate after x vanishes for all x=pi/4+k*pi/2  (k being an integer) and the partial derivative after y vanishes if y is a multiple of pi. The program simply creates a matrix with all combinations needed for plotting.

So M contains the very same values (in a different order, though) as the matrix M created automatically by real Mathcad.

BTW, the last value in the loop for x has a typo - it should be 2*pi/4 rather than 3*pi/3.

If you need help with the derivates and zeros, then even the symbolic in Prime can do it for you 🙂

Werner_E_0-1684063066738.png

Prime can even give you the concrete values you need

Werner_E_1-1684063929347.png
Werner_E_2-1684063942331.png

 

So all you have to do is creating a matrix with all 12 combinations of values out of these two vectors, as Prime is not able to do so in contrary to old Mathcad,

ttokoro
20-Turquoise
(To:Cornel)

image.pngimage.png

Top Tags