summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/dvips/pst-ode
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/dvips/pst-ode')
-rw-r--r--Master/texmf-dist/dvips/pst-ode/pst-ode.pro25
1 files changed, 14 insertions, 11 deletions
diff --git a/Master/texmf-dist/dvips/pst-ode/pst-ode.pro b/Master/texmf-dist/dvips/pst-ode/pst-ode.pro
index 28d0550dda2..ffb4592057c 100644
--- a/Master/texmf-dist/dvips/pst-ode/pst-ode.pro
+++ b/Master/texmf-dist/dvips/pst-ode/pst-ode.pro
@@ -1,13 +1,13 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% PostScript prologue for pst-ode.tex.
-% Version 0.10, 2017/06/16
+% Version 0.11, 2017/08/15
%
% Alexander Grahn (C) 2012--today
%
% This program can be redistributed and/or modified under the terms
-% of the LaTeX Project Public License Distributed from CTAN archives
-% in directory macros/latex/base/lppl.txt.
+% of the LaTeX Project Public License Distributed from CTAN archives:
+% http://mirrors.ctan.org/tex-archive/macros/latex/base/lppl.txt
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/tx@odeDict 1 dict def
@@ -117,8 +117,7 @@ end
%scaling vector for step size adjustment (Numerical Recipies)
eabsvect k1 eabsvect addvect {1e-30 add} forall xlength array astore
% => [x(t)] [x(t+ddt) by RKF4] [err] [xscale]
- /errmax 1e-30 def %maximum rel. error
- edivvect {abs dup errmax gt {/errmax exch def}{pop} ifelse} forall errmax
+ edivvect eabsvect 1e-30 exch {max} forall %maximum rel. error
% => [x(t)] [x(t+ddt) by RKF4] errmax
end
} bind def
@@ -126,8 +125,7 @@ end
% [ state vector x(t) ] ODEINT => [ state vector x(t+dt) ]
%decrease overshooting step size
ode@dict
- tcur ddt add tout sub tcur ddt add tout sub dt add mul 0 gt
- {/ddt tout tcur sub def} if
+ tout tcur sub dup abs ddt abs lt {/ddt exch def}{pop} ifelse
end
RKF45
ode@tol div dup 1 gt {
@@ -138,7 +136,8 @@ end
% error: step size underflow in ODEINT
(! t=) odeprint tcur odeprint
% print & remove previous state vector
- (, x=[ ) odeprint {odeprint ( ) odeprint} forall (]) odeprint
+ (, x=[) odeprint /ode@spc () def
+ {ode@spc odeprint /ode@spc ( ) def odeprint} forall (]) odeprint
true
}{
(-) odeprint
@@ -154,11 +153,15 @@ end
ode@dict
/tcur tcur ddt add def
dup 0 ne {pgrow exp 5 min sfty mul ddt mul /ddt exch def}{pop} ifelse
- %output step completed?
- tcur tout sub dt mul
+ tcur tout sub %output step completed?
end
0 ge {
- (o) odeprint ode@dict /tcur tout def /tout tout dt add def end
+ (o) odeprint
+ ode@dict
+ /tcur tout def
+ /outStepCnt outStepCnt 1 add def
+ /tout tStart dt outStepCnt mul add def
+ end
}{
(+) odeprint ODEINT %continue integration
} ifelse