Hi all,
If you do this in a MOOSE 5.0 image + SciSmalltalk :
=============================================
| solver stepper system dt sigma r b state values diag|
sigma := 10.0.
r := 28.
b := 8.0/3.0.
dt := 0.01.
system := ExplicitSystem
block: [:x :t | | c |
c:= Array new: 3.
c at: 1 put: sigma * ((x at: 2) - (x at: 1)).
c at: 2 put: r * (x at: 1) - (x at: 2) - ((x at: 1) * (x at: 3)).
c at: 3 put: (b negated * (x at: 3) + ((x at: 1) * (x at: 2))).
c].
stepper := RungeKuttaStepper onSystem: system.
solver := (ExplicitSolver new) stepper: stepper; system: system; dt: dt.
state := #(10.0 10.0 10.0).
values := (0.0 to: 100.0 by: dt) collect:[:t |
state := stepper doStep: state time: t stepSize: dt].
values.
diag := GETDiagramBuilder new.
(diag scatterplot)
models: values;
x: [: v | [v at: 1] on: Exception do:[0.0]];
y: [: v | [v at: 2] on: Exception do: [0.0]];
regularAxis;
dotSize: 1.
diag open
=============================================
You will obtain the graph attached.
Regards,
--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/--
You received this message because you are subscribed to the Google Groups "SciSmalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[hidden email].
For more options, visit
https://groups.google.com/d/optout.