Plotting with 2D plot

Plotting with 2D plot - 2D Plot region not working? - Сообщения

#1 Опубликовано: 14.01.2021 10:36:02
Tommy Svartvatn

Tommy Svartvatn

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

Группа: User

Sample_1.PNGI can't get this to work properly. I have tested with just a simple function using x as variable, and it works. This will not!
#2 Опубликовано: 14.01.2021 12:12:16
overlord

overlord

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

Группа: Moderator

Wrote

I can't get this to work properly. I have tested with just a simple function using x as variable, and it works. This will not!


You are trying to plot with units.
I don't think it is possible or maybe I am wrong.
I could plot without units by the way.

Regards

2Dplot.png
#3 Опубликовано: 14.01.2021 13:59:03
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

I can't get this to work properly. I have tested with just a simple function using x as variable, and it works. This will not!


From the function you are trying to evaluate wrt scalar 'x',
give yourself two values of 'x', and their corresponding 'y' values
Then f(x):=linterp(X.Y,x) and plot f(x). linterp(,,,) ignores units
thus you have a clean plot free of units gyzmas.
Cheers ... Jean
#4 Опубликовано: 15.01.2021 07:45:28
Tommy Svartvatn

Tommy Svartvatn

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

Группа: User

Wrote

Wrote

I can't get this to work properly. I have tested with just a simple function using x as variable, and it works. This will not!


From the function you are trying to evaluate wrt scalar 'x',
give yourself two values of 'x', and their corresponding 'y' values
Then f(x):=linterp(X.Y,x) and plot f(x). linterp(,,,) ignores units
thus you have a clean plot free of units gyzmas.
Cheers ... Jean



Thanks, Jean.

Can you show me an example?

Best Regards, Tommy
#5 Опубликовано: 15.01.2021 10:48:47
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Can you show me an example?


... like this done 4 days ago.
In this one linterp(,,,) was just enough.
Eventually, you may have to collect more points for cinterp(,,,)
But check if cinterp(,,,) sterilizes units like linterp(,,,) ???
With cinterp(,,,) the "freak" factor may be more savant !
Does it work for your project ?
Cheers ... Jean

Integral (1) DoctoredRed (1).sm (37 КиБ) скачан 80 раз(а).

#6 Опубликовано: 20.01.2021 10:50:50
Tommy Svartvatn

Tommy Svartvatn

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

Группа: User

It seems Smath can do plotting with units, just not my function from above. However, I am missing functionality on the 2D plot settings, adjusting the x-axis, y-axis etc.

Sample_2.PNG
#7 Опубликовано: 20.01.2021 11:46:59
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

It seems Smath can do plotting with units, just not my function from above


zoulou & Maya are pure decoration. Your unit system is not.

zoulou.PNG
#8 Опубликовано: 22.01.2021 08:31:25
Tommy Svartvatn

Tommy Svartvatn

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

Группа: User

Wrote


zoulou & Maya are pure decoration. Your unit system is not.

zoulou.PNG


I'm not quite sure I get that...
#9 Опубликовано: 22.01.2021 10:47:07
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

It seems Smath can do plotting with units, just not my function from above. However, I am missing functionality on the 2D plot settings, adjusting the x-axis, y-axis etc.


For the QuickPlot @ X, Y are adjusted by mouse wheel.
Shift+mouse wheel => X
Cntrl+mouse wheel => Y
#10 Опубликовано: 25.01.2021 09:23:26
Tommy Svartvatn

Tommy Svartvatn

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

Группа: User

Wrote


zoulou & Maya are pure decoration. Your unit system is not.

zoulou.PNG



Can you tell me exactly what you mean by this? I have tried plotting with m (meters) inside the function, but in my original function, it is not possible to plot with units...

Regards
Tommy
#11 Опубликовано: 25.01.2021 10:12:34
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

I have tried plotting with m (meters) inside the function, but in my original function, it is not possible to plot with units...


Is that what you mean: plot with units labels ?

PlotLabels.PNG

#12 Опубликовано: 25.01.2021 10:47:32
Tommy Svartvatn

Tommy Svartvatn

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

Группа: User

Wrote


Is that what you mean: plot with units labels ?

PlotLabels.PNG



I am simply trying to plot the function with N/m as unit, since I was able to plot with m as unit, I don't understand what the issue is.

Nice formatting by the way...
#13 Опубликовано: 25.01.2021 11:30:46
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

I am simply trying to plot the function with N/m as unit, since I was able to plot with m as unit, I don't understand what the issue is.


Curiosity or bug ... Units adepts, can you doctor that one ?
#14 Опубликовано: 25.01.2021 21:22:15
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote

Wrote

I am simply trying to plot the function with N/m as unit, since I was able to plot with m as unit, I don't understand what the issue is.


Curiosity or bug ... Units adepts, can you doctor that one ?



Overlord has already published the correct answer about how to proceed to graph with units, but unfortunately I think that the user did not notice and was distracted by the other posts about ... I don't know about what they are.

Best regards.
Alvaro.
#15 Опубликовано: 26.01.2021 04:17:15
fedeghi

fedeghi

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

Группа: User

Wrote



Overlord has already published the correct answer about how to proceed to graph with units, but unfortunately I think that the user did not notice and was distracted by the other posts about ... I don't know about what they are.



Yes, first reply by Overlord has the answer

From a general point of view, you can plot functions with units:
  • by restoring "x" units in the input of the graph, since X-Y plot is going to place unitless scalars where "x" is.
    If your function expected an input with units, and since X-Y plot will feed that input without units, that's why you need to multiply "x" with that proper unit.
  • by dividing the complete function with the expected output unit of measure, since X-Y plot will only accept values without units on y-axis, while the original function to be plotted is going to generate results with units.

At least, that's how I depicted it in my mind to remember what to do.

Consistent units with different magnitude will consistently scale your "x" and "y" axis.
#16 Опубликовано: 26.01.2021 16:17:27
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Consistent units with different magnitude will consistently scale your "x" and "y" axis


... while observing the SI conversion kJ/mol =>J/mol.
Adapt the remaining of the project to suit: tabulate/plot.

Integral 0000000 Transit-Units.sm (22 КиБ) скачан 63 раз(а).


#17 Опубликовано: 27.01.2021 11:52:07
hanskl

hanskl

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

Группа: User

Sorry for necromancing an old resolved post.

SMath is often able to plot with units, but you have to tell SMath the unit you are plotting along the x-axis (mm vs. cm vs. m), and you have to understand SMath plots the values along the y-axis in the SI units (that's the only way it knows how to).

In your case, you have to zoom far out on the y-axis to see the results.

What I usually do is what overlord did, dividing the function (within 2D plot) by the desired unit to force the results I want.

Best regards,


2D plot with units.sm (7 КиБ) скачан 75 раз(а).

2D plot with units.PNG
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений