Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Prime 10. I want to make an xy plot of a function. The function evaluates correctly. But when I plot, it says the units are not compatible. I assigned units to the axes
Solved! Go to Solution.
@akelly wrote:
As I understand, without units, Mathcad would assume temp is a continuous variable that is "defined" within the plot. You could change the extents of temp by modifying the x-axis limits.
But with units, that's not possible.
Seems odd.
Correct, but I won't call it odd.
The feature is called "Quickplots". Normally when plotting a function like f(x) you have to define a range for the function argument to be used at the abscissa. As a special service you may 'forget' to define this range and if you do and use an undefined variable at the abscissa Mathcad automatically uses a range which by default runs from -10 to +10 (you can change the limits at the abscissa to increase or decrease this range).
Its a range using unit-less values from -10 to 10. And this also happens with you usage of the undefined variable "temp".
And the error message stems from the fact that your function alpha.4340 throws an error as of incompatible units if you provide a dimensionless function argument:
Of course the QuickPlot feature could have been implemented in a way that the unit you type in in the unit placeholder for the abscissa is automatically used, but thats not the way PTC has implemented this feature. A QuickPlot always is using dimensionless values.
So you have two options:
1) provide a temperature range for the abscissa/function argument as suggested by Luc (the preferred and recommended option)
2) or redefine your function so that it accepts dimensionless arguments
As already explained you get a range from -10 to +10 at the abscissa and you can change the first an last value at the abscissa in a second step:
Your variable temp is undefined.
See what happens if you define it, e.g.
above the plot.
Success!
Luc
As I understand, without units, Mathcad would assume temp is a continuous variable that is "defined" within the plot. You could change the extents of temp by modifying the x-axis limits.
But with units, that's not possible.
Seems odd.
@akelly wrote:
As I understand, without units, Mathcad would assume temp is a continuous variable that is "defined" within the plot. You could change the extents of temp by modifying the x-axis limits.
But with units, that's not possible.
Seems odd.
Correct, but I won't call it odd.
The feature is called "Quickplots". Normally when plotting a function like f(x) you have to define a range for the function argument to be used at the abscissa. As a special service you may 'forget' to define this range and if you do and use an undefined variable at the abscissa Mathcad automatically uses a range which by default runs from -10 to +10 (you can change the limits at the abscissa to increase or decrease this range).
Its a range using unit-less values from -10 to 10. And this also happens with you usage of the undefined variable "temp".
And the error message stems from the fact that your function alpha.4340 throws an error as of incompatible units if you provide a dimensionless function argument:
Of course the QuickPlot feature could have been implemented in a way that the unit you type in in the unit placeholder for the abscissa is automatically used, but thats not the way PTC has implemented this feature. A QuickPlot always is using dimensionless values.
So you have two options:
1) provide a temperature range for the abscissa/function argument as suggested by Luc (the preferred and recommended option)
2) or redefine your function so that it accepts dimensionless arguments
As already explained you get a range from -10 to +10 at the abscissa and you can change the first an last value at the abscissa in a second step:
Hello @akelly,
It looks like you have some responses from our community champions. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution.
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.
Thanks,
Vivek N.
Community Moderation Team.