Start a topic
With the exception of Windchill, The PTC Community is on read-only status until April 6 in preparation for moving our community to a new platform. Learn more here
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The PTC Community is on temporary read only status in preparation for moving our community to a new platform. Learn more here

Translate the entire conversation x

3D plot managing by advanced input Slider feature in Prime 10.0.0

Ivan_Pat
13-Aquamarine

3D plot managing by advanced input Slider feature in Prime 10.0.0

Hi there!

I 'm trying to master the slider advanced control option to see how my goal function will be changed. On the PTC  support page, I have found only the 2-axis plot sample:

https://support.ptc.com/help/mathcad/r10.0/en/index.html#page/PTC_Mathcad_Help/example_slider.html#wwID0EIKIPB 

 

It looks like the upgraded version of Prime 10.0.0 probably has some bugs, or it is impossible to obtain such an option.

I've attached the function sample  (Prime 10.0.0), which I'd like to observe using the advanced control button (slider).

Any advice or assistance will be appreciated.

 

ACCEPTED SOLUTION

Accepted Solutions

@terryhendicott Thanks a lot.

The reason the visual changes haven't been seen is the sensitivity of the function alteration made by the slider.

Since the sensitivity was significantly changed, the changes became visible to the naked eye.

View solution in original post

51 REPLIES 51

The 3D graph is changing with the slider.

Check the small alteration I have made to the formula so the surface changes curvature more.

@terryhendicott Thanks a lot.

The reason the visual changes haven't been seen is the sensitivity of the function alteration made by the slider.

Since the sensitivity was significantly changed, the changes became visible to the naked eye.

It does change, you just have some settings on your plot that make it very hard to notice.

 

If you, say, make the slider not go from 1 to 10 but from 1 to 10000 you'll very quickly notice that the axes are changing values even if the shape isn't.

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.
Ivan_Pat
13-Aquamarine
(To:DJNewman)

@DJNewmanThank you. Yeap, I had to pay attention to this point; it wasn't seen at first glance.

Ivan_Pat
13-Aquamarine
(To:Ivan_Pat)

@DJNewman @terryhendicott 

Now I have a practice issue to research - how the k1 value depends on the d1 and d2 independent values.

I obtained the flat surface only using the slider ( for a particular value of d1 and d2, respectively). I understand that Prime did this calculus for only one pair of d1 and d1 values. Instead, it is useful to research the whole range of default independent values (d1 and, in my particular case), as they are easily obtained for the sample function (Slider usage sample file).

At this moment, two questions  are up in my mind:

1) Why can I not see the trend through the range of these variables ( i.e., d1 and d2  changes from 1 to 100 cm) and the k1 value, too? (see Thermal performance calculation ... file).

2) Why can I not deliberately set the start of the axes for d1 and d2 values from zero point ( as it is possible to do with the X-Y plot type)? (as is possible for the X-Y plot, see the slider usage sample file.)

 

I want to use Prime's powerful engine possibilities, but they do not seem very suitable for my particular purpose (perhaps).

 

Any advice would be appeciated.

 

Hi,

The sliders are working.  The 3D plots are from 0;0;0 .  A flat plane results from the constant function k1 where d1, d2 do not form part of the function.

Have set a kJ unit so get answer in units required and this makes z axis easier to read.

Capture.JPG

 

I have taken some time to change the hidden calculations so the value of k1 and f are functions of d1 and d2.

The sliders still change the value of f and k1 when the sliders change.

However the changes to the hidden functions now allow a proper 3D plot so you can see what is happening.

The maximum value can be determined.  It is not on a slider step of second slider.

Capture2.JPG

Capture3.JPG

Cheers

Terry

Hi,

And for a final touch changed the 3D plot to green.

Have put a red dot where the position of sliders calculate.

Capture.JPG

Mathcad Prime is a very handy and powerful tool.

Cheers

@terryhendicott

Thank you very much for such a clear explanation!

I'd like to clarify what index 10117 stands for at the moment)),

Suppose I'll crack it out!

From the first glance, the surface looks as if it is wrapping material.

Thanks a lot for your desire to help!

 

I'd like to clarify what index 10117 stands for at the moment))?

 

To make the 3D plot a matrix of three columns is made at many points. 

The three columns of matrix represents x, y, and k1(x,y),

 

for x from 0 to 100 and y from 0 to 500 every 5 makes a very large matrix.

 

I have hidden the creation of this matrix in a collapsed area so you can see the sliders and the 3D plot in one go.

 

Index 10117 represents the row of this large matrix with the highest k1(x,y).

 

Cheers

Terry

@terryhendicott

Thank you, Terry, for your passion for helping with a particular issue.

Yes, I have got that the number reflects the point (element) of the k1 (x,y) matrix.

The only point I haven't caught is how Prime understood that in the FOR loop, he has to assign to each d1 value a particular x and d2 - a particular y value, respectively.

 

And in the magnified coefficient for y ( 5 times x), you have tried to figure out more clearly where the extremum point on the surface will be, haven't you?

 

Sorry for the endless questions list... ))

Hi Ivan,

The only point I haven't caught is how Prime understood that in the FOR loop, he has to assign to each d1 value a particular x and d2 - a particular y value, respectively.

The maximum value in the large matrix is determined in the coding following the graph not the FOR loop before the graph.

 

And in the magnified coefficient for y ( 5 times x), you have tried to figure out more clearly where the extremum point on the surface will be, haven't you?

the values of the sliders are multiplied by 0.01m. 

the first slider goes from d1 = 0 mm to d1 = 100 mm hence the variation of x from 0 to 100 giving 101 points.

the second slider goes d2 = 0 mm to d2 = 500 mm hence the variation of y from 0 to 500 stepping every 5 mm for 101 points.

101 points is entirely arbitrary you could use 0.5 mm steps for x making 201 steps or 1 mm steps for y making 501 steps.

 

Here is the plot with x defined by 21 points:

Capture.JPG

Cheers

Terry

@terryhendicott I appreciate your goodwill in explaining,

I have tried several combinations with the correlation of d1, d2  and multiplier coefficient in the FOR loop...

To tell the truth, I'm not very good at coding. That's probably why I haven't mastered the trick you used to create the plot you picked. Could you please explain it, how you define number of points to represent the plot?

when I tried to decrease xi 

Ivan_Pat_0-1736845607499.png

My plot wasn't as your's one

Ivan_Pat_1-1736845653296.png

 

I also tried to convert your code to a single-layer d1-k1 correlation, but I still have no idea why it isn't working as it should...

Ivan_Pat_2-1736845933172.png

 

I also tried to convert your code to a single-layer d1-k1 correlation, but I still have no idea why it isn't working as it should...

Capture.JPG

Single layer maximum on slider is 50 multiplied by 0.01m is 500 mm

This means X on the 2D plot needs to go from 0 to 500.

Y on the plot needs to be k1(x)

If interval for xi is chosen as 0 to 100 index to match x of 0 to 500 mm need to multiply xi by 5 for each x.

Capture2.JPG

Will answer the 3D plot questions in separate post.

Capture.JPG

plaster has maximum of 10 on the slider by 0.01 m is 100 mm.  Plaster goes from 0 to 100 mm

hempcrete has maximum of 50 on slider by 0.01 m is 500 mm.  Hempcrete goes from 0 to 500 mm

 

plotting plaster with 0 to 20 points as index need 100/20 = 5 factor from index to d1 distance in mm

plotting hempcrete with 0 to 20 points as index need 500/20 = 25 factor from index to d2 distance in mm.

Note the stepping index of M i snow x *21 +y

Capture2.JPG

Capture3.JPG

 

@terryhendicott 

Super thanks, Terry!!! You probably have some teaching experience background!!🤗

Hi Ivan 

was a sailplane instructor

gave computer lessons in a community center as a volunteer.

Cheers

Terry.

Hi Terry!

I hope my email finds you well.

I understand that a 3D plot isn't as interpretable as a 2D plot (it's my "genius discovery").

From our thread, I determined that a 2D plot could be modified to analyse changes in the material's width for d2 and d1, respectively, to identify the relationship between them.

I'll explain what I mean. Suppose we have a multilayered wall of n layers. (n>1). I can fix (predefine at some level) the thicknesses of two of the three materials and vary the thickness of the third using a slider (the layer thickness in mm, x-axis) to see how changes in that thickness affect the plots of internal area heat capacity k1 and decrement factor f.

It means that only one layer varies with the slider at a time, but the actual positions of the sliders (the thickness of the first two layers, which is predefined by the sliders) also will affect k1 and f.

After this step, I'll adjust the thicknesses of the other two or three materials to see how the "k1-di" and "f-di" curves affect the extrema points (i.e., how they behave).

To sum up, I'd like to analyse a 2D plot by varying multiple variables to see how k1 and f change. Thus, my plot will accept multiple values (namely, layer thicknesses di).

The picture could add to the verbal explanation (here is given for k1 as a function of k1=f(d1, d2, ..., dn). The same idea for the decrement factor f.

Ivan_Pat_0-1771426681659.png

 

I tried playing with your file (250112-Thermal performance calculation ISO13786_ sample_2Dplot v4.mcdx) a bit, but I noticed that in that case, the k1 and f values aren't correct (checked in an Excel spreadsheet).

Could you please advise on what was wrong with my sample?

 

 

I'd appreciate any assistance and useful tips from you and from the Community.

 

PS

Prime 11.0.0.0 files attached.

 

 

Hi Ivan,

Can you please supply the Excel spreadsheet for k1 and f so I can correct the Mathcad to match it?

Cheers

Terry

Hi Terry! For sure, I can.

You'll find it easy to change the materials (combo box) and thicknesses (straight in the cell).

Hi Ivan,

Here is corrected file that gets the right answers for f and k1.

 

Capture.JPG

Capture2.JPG

The problem was functions with the same name but different parameters were defined twice so Prime was getting confused.

Eliminate the double up and file works OK.

Thank you for the clarity on my issues, Terry!

I'll try to outline my question one's more.

In my analysis, I'd like to research how k1 and f are affected by a fixed value of  d1 (and a changeable value of d2 through the x-axis of plots, e.g. from r1= 0 to r1=max at slider No.2 (d2 thickness)), and vice-versa (fixed value of d2 (and a changeable value of d2 through the x-axis of plots (e.g. from r=0 to r=max at slider No.1 ( predefined d1 thickness).

The same is valid for f value.

Example:

d1= 0.02 m (fixed value)

d2= changeable value, for instance, from 0 to 0.3 m. Thus, at d2=0, we do see in the plot k1=0, but if the Excel Solver is used,  we'll get

Internal areal heat capacity, kJ/(m²K)
Внутрішня площинна теплоємність,кДж/(м²K)
Decrement factor f
Коеф. затухання f
9.6370.997

which is correct in Prime calculation. But when we take a look at the k1 plot, we can observe that k1 starts from zero, and if I tune the tracers for a thickness of 20 mm ( d =0.02, d1=0), we'll see that k1 approximately equals 25.748 kJ/m-2K-1 ( as it is in your plot). It is incorrect. If we use Excel Solver, it gives us the thicknesses of d1 and d2 layers as follows

Structural layer of the wall
Конструктивний  шар стіни

Specific heat capacity of layer material сі, J/kgK
Питома теплоємність матеріалу шара сі, Дж/кгК

Layer thickness  δі, m
Товщина  шару δі, м
Штукатурка глиняна / clay plaster880.000.0267093
Hempcrete / Костробетон1200.000.0098812

So, in the plot, we should expect d2 to change at a fixed value of d1 = 0.02 m, and so on.

The same for the expected f value.

To sum up, the 2D plot I'd like to obtain should reflect the variation in k1 and f values as the factual slider's position changes.

In the program, we plot k1 = f(d1, d2) by incrementing both thicknesses, d1 and d2, simultaneously from 0 to i, as far as I understand it. It slightly differs from what I'd like to analyse.

Anyway, I really appreciate your desire to help.

Thank you for your support and time, Terry.

 
 
 

 

 

 

 

Hi Ivan,

 

The problem was the two sliders at the top were not working.

Have replaced them and on my machine they now work.

 

Make sure you select yes for using scriptable components when opening file

 

Cheers

Terry

Hi Terry, 

Yes, I already figured out this issue.

Please review my edited ‎reply from Feb 22, 2026, 01:15 AM.

Hi Ivan,

As I understand it you want one value d1 = 20 mm kept constant and vary the other d2 from 0 to 300 mm

You want the graph updated when you move the slider.

 

This is my solution to that.  The dots reflect the result of second value of d2 in slider.

Cheers

Terry

Thank you very much, Terry!

Now it looks smarter and better suited to my issues.

As far as I see, I can extrapolate the idea of multiple layers being added, can I?

As an additional update, which I found useful for the optimisation routine, the tracers of the desired f range (for instance f=[0.04;0.08].

I find'em numerically (sorry, but I cannot succeded to upload the printscreen here, so see attached picture)

The question that arose is:

Can I have the vertical tracers for upper thickness (f_004) and lower thickness (f_008) in both plots (k1 and f) auto-fitted to the changeable d1 and d2 values, which I handle manually?

See the attached Prime 11.0.0.0 file with yellow highlighting, where the changes have been made, and the question has been formulated. 

Hi

Can I have the vertical tracers for upper thickness (f_004) and lower thickness (f_008) in both plots (k1 and f) auto-fitted to the changeable d1 and d2 values, which I handle manually?

AFAIK the markers can be dimensionless variables but display the value not which variable?  The markers adjust if you change the variable.

 

As far as I see, I can extrapolate the idea of multiple layers being added, can I?

For neatness it is better to input the variables for the layers in a matrix like in excel.  The problem can then self adjust for different number of layers.  You only need to create a new Minp matrix not the formulas as you add or subtract layers.

 

The formulas to do this are on the right hand of the page in the draft area. I have done three layers. The matrix method also works for two and single layers.

 

Checked the results against the spreadsheet and OK.

 

Cheers

Terry

Thank you very much, Terry!

I've played around with the plots and settings, and it's performed pretty nicely.


@terryhendicott wrote:

Hi

Can I have the vertical tracers for upper thickness (f_004) and lower thickness (f_008) in both plots (k1 and f) auto-fitted to the changeable d1 and d2 values, which I handle manually?

AFAIK the markers can be dimensionless variables but display the value not which variable?  The markers adjust if you change the variable.

As far as I see, I can extrapolate the idea of multiple layers being added, can I?

For neatness it is better to input the variables for the layers in a matrix like in excel.  The problem can then self adjust for different number of layers.  You only need to create a new Minp matrix not the formulas as you add or subtract layers.


I've already got the idea of putting the markers in auto-fitted. Now it is as I want to be. The idea of a matrix form of input also occurred to me, but, to be frank, I wanted to create the working sample and update it in subsequent turns.

Now I can analyse how any layer behaves in terms of k1 and f when one (two, n) layer is fixed at its thickness.

I really appreciate your guidance and patience, Terry!

 

Hi Terry! 

I figured out in the calculation (namely, when I tried to make your v7 2Dplot file more compact in the document) that if I want to present the input data in compact matrix (table) form, the output of my particular parameter isn't aligned with the hand-checked calculation. How can it cause?

I'm shocked by how MathCAD, or my shallow knowledge of it 😔, can drastically reshape the output result of a simple dependency.

Prime file 11. 0.0.0 is attached.

ttokoro
21-Topaz I
(To:Ivan_Pat)

image.png Need vectorization operator.

Announcements


Top Tags