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

Translate the entire conversation x

Plotting a function having units - these units are not compatible

akelly
12-Amethyst

Plotting a function having units - these units are not compatible

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

akelly_0-1750264821672.png

ACCEPTED SOLUTION

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


@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:

Werner_E_0-1750285919356.png

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)

Werner_E_1-1750286311565.png

 

2) or redefine your function so that it accepts dimensionless arguments

Werner_E_2-1750286377470.png

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:

Werner_E_3-1750286682051.png

 

 

View solution in original post

4 REPLIES 4
LucMeekes
23-Emerald IV
(To:akelly)

Your variable temp is undefined.

See what happens if you define it, e.g.

LucMeekes_0-1750268202781.png

above the plot.

 

Success!
Luc

akelly
12-Amethyst
(To:LucMeekes)

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.

Werner_E
25-Diamond I
(To:akelly)


@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:

Werner_E_0-1750285919356.png

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)

Werner_E_1-1750286311565.png

 

2) or redefine your function so that it accepts dimensionless arguments

Werner_E_2-1750286377470.png

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:

Werner_E_3-1750286682051.png

 

 

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.

Announcements


Top Tags