Issue plotting function with units

Issue plotting function with units - Сообщения

#1 Опубликовано: 08.09.2023 13:29:14
tedd

tedd

0 сообщений из 9 понравились пользователям.

Группа: 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 Опубликовано: 08.09.2023 14:06:57
overlord

overlord

549 сообщений из 1332 понравились пользователям.

Группа: Moderator

When you are plotting, eliminate units.

Regards

2023-09-08_20-06.png
#3 Опубликовано: 08.09.2023 14:22:03
Oscar Campo

Oscar Campo

124 сообщений из 298 понравились пользователям.

Группа: Moderator

Another option is define the units for x:

Plot_and_units1.png

Regards,

Oscar
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений