diff options
author | Karl Berry <karl@freefriends.org> | 2017-06-16 22:08:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-06-16 22:08:52 +0000 |
commit | 69064adb2c2586ea61da9dc8d907081f7a084651 (patch) | |
tree | 3cc310ad05ef74212e17ff8ed949e09de175db63 /Master/texmf-dist/dvips/pst-ode/pst-ode.pro | |
parent | d76ab792119d600283d06a1b9e6a2b39b9e24928 (diff) |
pst-ode (16jun17)
git-svn-id: svn://tug.org/texlive/trunk@44618 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips/pst-ode/pst-ode.pro')
-rw-r--r-- | Master/texmf-dist/dvips/pst-ode/pst-ode.pro | 27 |
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 { |