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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Graph_Plot_Error

MSRAZA
10-Marble

Graph_Plot_Error

I hope everyone is doing well.

 

While plotting a graph, I receive an error.

Please assist me in fixing the issue.

Please find the attached document below.

 

Thanks and regards.

MSRAZA.

plot_error.png

 

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:MSRAZA)

Variable xx is undefined.

Primes quickplot feature can't be used with units.

 

xx must be defined as a range with units:

Werner_E_0-1732715425102.png

 

View solution in original post

5 REPLIES 5
Werner_E
25-Diamond I
(To:MSRAZA)

Variable xx is undefined.

Primes quickplot feature can't be used with units.

 

xx must be defined as a range with units:

Werner_E_0-1732715425102.png

 

By plotting your stress-strain curves, I could see that they closely followed an exponential type, so I roughly fitted them (by eye).  

You only need to define your "f" functions once - see attached.

StressStrain.png

Alan

MSRAZA
10-Marble
(To:Werner_E)

Hi  Werner_E!

Thanks for your support.

 

1) In our earlier discussions, if you remember, this graph was polted by you for without unit for the block_solve. Why function ordinate is defined with double "xx" as f(xx) and abscissa with double "xx".

and when a function is defined for a root, it has a single x as f(x).

 

2) Why is unit defined as (m2.MPa) for plot f(xx)?

 

Please refer to the attached image.

 

Thanks and regards

MSRAZAPlot_Fun..png

 

 

ttokoro
20-Turquoise
(To:MSRAZA)

image.png

Unit can change to N.

image.png

Werner_E
25-Diamond I
(To:MSRAZA)


@MSRAZA wrote:

Hi  Werner_E!

Thanks for your support.

 

1) In our earlier discussions, if you remember, this graph was polted by you for without unit for the block_solve. Why function ordinate is defined with double "xx" as f(xx) and abscissa with double "xx".

and when a function is defined for a root, it has a single x as f(x).

 


You don't have to use xx as name for the variable - you also can use x or anything else. I just often try to use a different name for the variable used for plotting to let x still be undefined.

Furthermore the name of the formal function argument you use when you define a function is arbitrary and can be anything and it has nothing to do with the variable name you later use when you call the function or use it for plotting.

But of course you can use x throughout if you feel more comfortable with.

BTW, you may have noticed that Alan had shown a way to use Primes quickplot feature (using a variable at the abscissa which is not defined) even when units are in play.  He used a unit-less variable xx (can also be named x) at the abscissa, which is NOT defined as a range or anything else and used xx*mm when the function f is called.

You may have to change the axis limits at the ordinate axis to get a meaningful plot when you still use m^2*MPa as ordinate unit

Werner_E_1-1732750704587.png

Clearing variable x was necessary because you had assigned x:=10 mm somewhere above to be used as a guess value for the root function.

 


@MSRAZA wrote:

2) Why is unit defined as (m2.MPa) for plot f(xx)?

 


Because your function f returns force values.

Werner_E_2-1732750849562.png

A more natural unit would have been kN (as seen in Alans file and screenshot), but you already had put "MPa" in the unit placeholder and Prime adds m^2 so that we again get a correct force unit.

 

The result of a function is either determined by an explicit return statement or by the last expression of the program. In your case thats the last  line of the program. Here you are multiplying pressure values (f.ck, f.st) by areas (b*x, A.sc, A.st) an so you get a force which can be given in Newton but also could be written by m^2*MPa. If you demand MPa, Prime would add the default area unit which is m^2.

Did you expect a different unit here? If you expected a pressure value here then you would have to correct the expression in function f.

If you expected kN then you simply have to write kN in the unit placeholder of the ordinate axis as seen in the plot above and also in Alans response..

Announcements

Top Tags