Issue plotting function with units

Issue plotting function with units - Messages

#1 Posted: 9/8/2023 1:29:14 PM
tedd

tedd

0 likes in 9 posts.

Group: User

I'm trying to plot a function with units. The function is:

f(x)=k.2*x^2+k.4*x^4

And the units are:

k.2 in N/(m/s)^2
k.4 in N/(m/s)^4
x in m/s

So, the function evaluates to units of N.

I can plot each component of the function separately. I.e., I can plot k.2*x^2 or I can plot k.4*x^4. But, when I try to plot the entire function (k.2*x^2+k.4*x^4), no curve appears. How do I fix that?

(For anyone who's curious, this is a hypothetical drag curve for a full-displacement hull.)
#2 Posted: 9/8/2023 2:06:57 PM
overlord

overlord

552 likes in 1332 posts.

Group: Moderator

When you are plotting, eliminate units.

Regards

2023-09-08_20-06.png
#3 Posted: 9/8/2023 2:22:03 PM
Oscar Campo

Oscar Campo

124 likes in 298 posts.

Group: Moderator

Another option is define the units for x:

Plot_and_units1.png

Regards,

Oscar
  • New Posts New Posts
  • No New Posts No New Posts