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.
Solved! Go to Solution.
Variable xx is undefined.
Primes quickplot feature can't be used with units.
xx must be defined as a range with units:
Variable xx is undefined.
Primes quickplot feature can't be used with units.
xx must be defined as a range with units:
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.
Alan
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
MSRAZA
Unit can change to N.
@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
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.
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..
I greatly appreciate the clarification and the explanation you provided.
Although I appreciate everyone who answers and provides a solution, I personally think your explanations are more thorough.
Thanks and regards.
MSRZAZ.