diff options
author | Karl Berry <karl@freefriends.org> | 2014-03-27 23:31:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-03-27 23:31:15 +0000 |
commit | 3093f16e0df2be6afb94ab96f0bb6a0361c1be18 (patch) | |
tree | 517af5572c029555c72e4823ca8f5c477ff2c589 /Master/texmf-dist/tex/generic | |
parent | 2847413647e75ffcfeb5dfd46bcefc0a930bd634 (diff) |
pst-ode (27mar14)
git-svn-id: svn://tug.org/texlive/trunk@33301 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-ode/pst-ode.tex | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-ode/pst-ode.tex b/Master/texmf-dist/tex/generic/pst-ode/pst-ode.tex index 29b43916228..ffcb24358f0 100644 --- a/Master/texmf-dist/tex/generic/pst-ode/pst-ode.tex +++ b/Master/texmf-dist/tex/generic/pst-ode/pst-ode.tex @@ -11,8 +11,8 @@ %% ODEs using the Runge-Kutta-Fehlberg (RKF45) method with automatic %% step size adjustment %% -\def\fileversion{0.6} -\def\filedate{2013/11/26} +\def\fileversion{0.7} +\def\filedate{2014/03/27} \csname PSTODELoaded\endcsname \let\PSTODELoaded\endinput @@ -119,13 +119,15 @@ %process arguments \ifPstODE@saveData /statefile (#1.dat) (\filemode) file def \fi \ifPstODE@algebraicT - /tStart tx@Dict begin (\expandafter\ode@zapspace\ode@ta\@nil) AlgParser cvx exec end def - /tEnd tx@Dict begin (\expandafter\ode@zapspace\ode@tb\@nil) AlgParser cvx exec end def + tx@Dict begin (\expandafter\ode@zapspace\ode@ta\@nil) + AlgParser cvx exec end ode@dict /tStart exch def end + tx@Dict begin (\expandafter\ode@zapspace\ode@tb\@nil) + AlgParser cvx exec end ode@dict /tEnd exch def end \else - /tStart tx@Dict begin 1 dict begin #3 end end def - /tEnd tx@Dict begin 1 dict begin #4 end end def + tx@Dict begin 1 dict begin #3 end end ode@dict /tStart exch def end + tx@Dict begin 1 dict begin #4 end end ode@dict /tEnd exch def end \fi - /dt tEnd tStart sub #5\space 1 sub div def % output step size + ode@dict /dt tEnd tStart sub #5\space 1 sub div def end % output step size \ifx\@empty#6\@empty\else \ifPstODE@algebraicIC true setglobal globaldict /ode@laststate [ @@ -138,16 +140,16 @@ false setglobal \fi \fi% - /xlength ode@laststate length def % number of equations - /xlength1 xlength 1 add def % number of equations plus 1 + ode@dict /xlength ode@laststate length def end % number of equations + ode@dict /xlength1 xlength 1 add def end % number of equations plus 1 \ifPst@algebraic /ode@rpn tx@Dict begin (\expandafter\ode@zapspace\ode@arg\@nil) AlgParser end cvx bind def /ODESET {%system of ODEs - /x exch def /y x def tx@Dict begin ode@rpn end xlength array astore + /x exch def /y x def tx@Dict begin ode@rpn end ode@dict xlength end array astore } bind def \else /ODESET { - aload pop tx@Dict begin ode@foo begin #7 end end xlength array astore + aload pop tx@Dict begin ode@foo begin #7 end end ode@dict xlength end array astore } bind def %ensure local scope of user defined variables in #7, from BlueBook, p. 133 /ODESET load 4 1 dict put @@ -155,16 +157,18 @@ \ifPstODE@algebraicOutputFormat /ode@fmtrpn tx@Dict begin (\expandafter\ode@zapspace\ode@fmt\@nil) AlgParser end cvx bind def /formatoutput {% - ode@laststate /x exch def /y x def /t tcur def + ode@laststate /x exch def /y x def /t ode@dict tcur end def tx@Dict begin ode@fmtrpn end } bind def \else /formatoutput {[#2] assembleresult} def \fi% %perform ode integration (\string\n pstODEsolve RKF45 method; '-' failed step, '+' successful step, % 'o' output step : \string\n) odeprint - /tcur tStart def % current parameter t value - /tout tStart dt add def % next output t - /ddt dt def % initial integration step size + ode@dict + /tcur tStart def % current parameter t value + /tout tStart dt add def % next output t + /ddt dt def % initial integration step size + end \ifPstODE@append\else [ [formatoutput] |