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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Need help on ploting a 3-D graph

ptc-5065337
1-Newbie

Need help on ploting a 3-D graph

Hello

I am new to PTC community and MathCAD, really need some help from expert. I am trying to plot a 3D graph with derived formulae in MathCAD, and then

compare this graph with the graph I generated with Excel. But I am having troubles in getting it work..... A number of errors or warnings appeared in my

programme. Whoever will help me, please also point out where I did wrong so I know what to do next time.

Thanks in advance!

6 REPLIES 6

Hello & welcome to the forum.

First problem is the usual confusion between the text subscript "." which just gives a readable name and the array/vector/matrix subscript operator "[" which allows you to reference elements within the matrix.

so when you type F[a Mathcad expects that a will have an integer value to specify the a'th element of the vector F

Attached I have modified the first few equations to show.

The next problems are that you are using the variable d in your equations but it has not been assigned a value

and the equation for σ.h has an empty place holder ( the equation is incomplete).

Both of these mean that Mathcad will highlight the items to show the error as best it can.

Once you correct these , σ.h, H, & rb should calculate & the next problem area will appear as Mathcad continues through the worksheet.

Hope this helps

Regards

Andy

Hello Andy

Thanks for your warm welcome. I follow your instruction and luckily get a answer for stress utilisation, Su. But, there are still some issues:

1. I was able to plot a surface graph with defined variables, please look into the programme and offer me some advice.

2. My ultimate aim is to produce a surface plot with x,y,z axis varying within a certain range, how exactly can I achieve this?

Thanks

Lee

Hello Lee,

Now that the basic equations are working, the next step is to change them to functions of T and d since these are your variable inputs.

This does mean that you can no longer evaluate the equations directly but must calculate a specific case - for this work sheet T1 & d1 are the defined case.

Always useful to check that no errors creep in.

Then you need to define the ranges over which you want to calculate / plot.

Range variables as you had are possible but do cause problems in understanding.

d is easy as in the attachment

Capture.PNG

This creates a vector d

Capture.PNG

T is more difficult as it appears to be dependant on the value d, so this has been created as a 2 dimensional matrix - hopefully this is correct.

Capture.PNG

As the test case (above)shows, d[35 & T[15,35 are the same condition as you had originally & give the same value for S.u.

Regards

Andy

Hello Andy,

Thanks for the helps!

I have compared this surface plot with the Excel graph, and they are perfectly matching each other. It seems like I need to create 2D matrix rather than tables I used in Excel, I am able to follow your steps with instructions.

I also notice you introduce new equations to convert x and y coordiantes to water depth,d and tension force,T respectively, however, for the x,y coordinates, is there a way that I can change the current values on x and y axes to the ranges of 520 to 2500m (d) and 1.01 to 1.90 without affecting the original equations.

For the second graph, I was trying to insert a "if function" to limit the value of Su to less than 1.0 (<1.0), means only Su less than 1.0 will appear on the graph, i.e. if(Su>=1,0,Su). Do I write it as Sux,y=if(Su>=1,0,Su) and plot another graph accordingly.

Thanks

Lee

Hello Lee,

Attached are a couple of ideas.

min(1,x) will put an upper bound on the S.u value.

CreateMesh will produce plot-able data but it cannot manage units - so I have created the new definition for S.u2.

It will plot a function but it looks different to the original.

Main problem is that the original definition of T was dependant on d -- that link is now broken & the plot is Su against d & T directly.

Before I think that the plot was Su against d & T/d

I would be interested to know if the result is correct or not

Regards

Andy

Hello Andy

Your previous plot was correct, the plot with Su against d & T/d, and I managed to get the second plot with Su<1.

Please see the attachment and the plot on the left.

I really appreciate your help on generating this model, and I will spend some time going through it myself.

Thanks a lot!

Lee


Top Tags