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.pro27
1 files changed, 13 insertions, 14 deletions
diff --git a/Master/texmf-dist/dvips/pst-ode/pst-ode.pro b/Master/texmf-dist/dvips/pst-ode/pst-ode.pro
index df404a2de86..28d0550dda2 100644
--- a/Master/texmf-dist/dvips/pst-ode/pst-ode.pro
+++ b/Master/texmf-dist/dvips/pst-ode/pst-ode.pro
@@ -1,7 +1,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% PostScript prologue for pst-ode.tex.
-% Version 0.9, 2017/06/14
+% Version 0.10, 2017/06/16
%
% Alexander Grahn (C) 2012--today
%
@@ -117,11 +117,9 @@ 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 0 def %maximum rel. error
+ /errmax 1e-30 def %maximum rel. error
edivvect {abs dup errmax gt {/errmax exch def}{pop} ifelse} forall errmax
% => [x(t)] [x(t+ddt) by RKF4] errmax
- %Sometimes, the rel. error is zero (Why is that???). So we add 1e-30
- 1e-30 add
end
} bind def
/ODEINT { % performs integration over output step [t,t+dt]
@@ -138,18 +136,17 @@ end
exch pop pshrink exp 0.1 max sfty mul ddt mul /ddt exch def
ode@dict tcur ddt add tcur end eq {
% error: step size underflow in ODEINT
- (! t=) odeprint tcur 256 string cvs odeprint
+ (! t=) odeprint tcur odeprint
+ % print & remove previous state vector
+ (, x=[ ) odeprint {odeprint ( ) odeprint} forall (]) odeprint
true
}{
(-) odeprint
false
} ifelse
end
- % on step size underflow ...
- {
- pop % remove previous state vector and
- exit % leave loop over output steps (pst-ode.tex)
- } if
+ % on step size underflow, leave loop over output steps (pst-ode.tex)
+ {exit} if
ODEINT %repeat step with new ddt
}{
%success
@@ -168,12 +165,14 @@ end
}ifelse
} bind def
/writeresult { %write output vector to file
- {
- 256 string cvs statefile exch writestring
- statefile ( ) writestring
- } forall
+ /loopproc load forall
statefile (\n) writestring
} bind def
+/loopproc {
+ 0 cvs statefile exch writestring
+ statefile ( ) writestring
+} bind def
+/loopproc load 0 256 string put
/assembleresult { %assembles state vector for building table of results
{
dup (t) eq {