Graphing

Graphing - insert plot- 2D versus insert x-y plot - Messages

#1 Posted: 4/1/2017 11:45:15 PM
Joe

Joe

0 likes in 14 posts.

Group: User

Page3.png

I am not sure why SMath does not like insert - plot - 2D for f(u)

Thanks
Joe
#2 Posted: 4/2/2017 3:51:35 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello Joe,

That is because you have to put "x" as a formal argument in the insert 2D plot (it is always "x" to f(x)). For insert 2D plot it does not matter if "x" is previously defined or not. XY plot works differently. It needs an undefined argument (f(x) and f(u) are the same as long as both "x" and "u" are undefined).

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Posted: 4/2/2017 8:32:18 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

I am not sure why SMath does not like insert - plot - 2D for f(u)



For the "QuickPlot" the plotting canvas argument is 'x' only 'x'.
You will have lot of pleasure plotting stuff in Smath.

Jean

Forum Plot Fun.sm (6 KiB) downloaded 45 time(s).
#4 Posted: 4/2/2017 1:32:37 PM
Joe

Joe

0 likes in 14 posts.

Group: User

Radovan / Jean:
I understand now.

Another question - I am reading through all the handbooks and as I read I keep adding the examples into a SMath page so as a result I will define and redefine variables ('x') and functions ( f(x) ) many times as I work through the example problems. I have run into a issue where it appears SMath gets confused if I redefine 'x' or f(x) too many times. I get error messages but if I copy and paste the particular section onto a new page by itself everything works. Again is there something I am doing wrong?
Thanks
JoeSMath Solving Equations.sm (226 KiB) downloaded 38 time(s).
#5 Posted: 4/2/2017 2:39:54 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello Joe,

In your example roots(f(x),x)= will not work because you have x defined previously. Function roots() needs undefined variables. There is no consensus here about undefined variables in the cases similar like this one. You might use some variables that have low chances to be defined in your worksheet (something like roots(f(#x),#x)= or roots(f(_x),_x)= etc.)

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#6 Posted: 4/2/2017 10:05:12 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Another question



Several answers:

1. some notes [red] in your work sheet.
2. the quick cubic solver is "polyroots".
The Cardan cubic does not supports complex roots.
There is a special cubic solver from Maple [attached].
3. the classical solve [x,y,z ...] works simply.
It may fail if the system is not true, for instance if
the matrix is not from true numbers. Observe carefully
the example so much from so little.

Jean

Cubic solver.sm (48 KiB) downloaded 39 time(s).

Solve [x,y,z] Compactum.sm (92 KiB) downloaded 38 time(s).

SMath Solving Equations.sm (226 KiB) downloaded 48 time(s).


#7 Posted: 4/2/2017 11:06:18 PM
Joe

Joe

0 likes in 14 posts.

Group: User

Thank you both
Joe
#8 Posted: 4/3/2017 6:42:53 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Hello Joe,

This Smath document is interesting. At the end of page 2, the graph is in two segments.
The blue segment is the plot of the explicit subsonic Mach, the red segment is the
plot of the supersonic Mach.
The supersonic is the implicit 'solve' roots(3). As 'x' runs on the canvas, "roots"
solves for each encountered canvas pixel, thus the very fine trace ... much finer than
Mathcad 11 and earlier versions that did plot on ½ pica.

The other CAS that plots fine trace is "OriginLab". It does not plot function f(x),
it plots from data vector but it splines "Bézier" between canvas points. Thus provides
as fine trace as Smath.

Cheers, Jean

Inst_Mach Number Pitot.sm (191 KiB) downloaded 47 time(s).
#9 Posted: 4/3/2017 12:22:45 PM
Joe

Joe

0 likes in 14 posts.

Group: User

Thank you Jean -I will look it over. I am still working on the cubic solver file you posted.
Joe
#10 Posted: 4/5/2017 1:24:58 PM
Joe

Joe

0 likes in 14 posts.

Group: User

Wrote

Hello Joe,

In your example roots(f(x),x)= will not work because you have x defined previously. Function roots() needs undefined variables. There is no consensus here about undefined variables in the cases similar like this one. You might use some variables that have low chances to be defined in your worksheet (something like roots(f(#x),#x)= or roots(f(_x),_x)= etc.)

Regards,
Radovan



Radovan:
Lo and behold after spending a lot of time trying to work the issue and then posting the question on this forum, on the next page of the primer was exactly what you said............
Joe
  • New Posts New Posts
  • No New Posts No New Posts