diff options
author | Karl Berry <karl@freefriends.org> | 2013-11-14 00:15:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-11-14 00:15:05 +0000 |
commit | 8a67560247f3bea5b3ab4c0abe7932f006da7aac (patch) | |
tree | 4ad51150a3397c8857acf601c0df321d2a741080 /Master/texmf-dist/tex/generic/pst-ode | |
parent | 1d498f9d3f847d88b97983f09b053e387f6fc86b (diff) |
pst-ode (13nov13)
git-svn-id: svn://tug.org/texlive/trunk@32140 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-ode')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-ode/pst-ode.tex | 63 |
1 files changed, 31 insertions, 32 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 1d10cb31c2b..baf184f2d29 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.4} -\def\filedate{2013/11/05} +\def\fileversion{0.5} +\def\filedate{2013/11/11} \csname PSTODELoaded\endcsname \let\PSTODELoaded\endinput @@ -74,21 +74,20 @@ % #5: number of output points, including ta and tb; must be >= 2 % #6: initial condition vector; if empty, continue integration from the last % state vector of the previous \pstODEsolve usage or from state vector set -% by \pstODEsetRestorestate macro +% by \pstODEsetOrRestoreState macro % #7: right hand side of ODE system; if given in Postscript notation (algebraic= % false), the function provided should pop (in reverse order!) the elements % of the current state vector from the operand stack and push the first % derivatives (right hand side of ODE system) back to it; inside the % function, the integration parameter can be accessed using `t' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\define@boolkey[psset]{pst-ode}[Pst@]{append}[true]{}% -\define@boolkey[psset]{pst-ode}[Pst@]{saveData}[true]{}% -\define@boolkey[psset]{pst-ode}[Pst@]{algebraicT}[true]{}% -\define@boolkey[psset]{pst-ode}[Pst@]{algebraicIC}[true]{}% -\define@boolkey[psset]{pst-ode}[Pst@]{algebraicOutputFormat}[true]{}% -\define@boolkey[psset]{pst-ode}[Pst@]{algebraicAll}[true]{}% -\define@boolkey[psset]{pst-ode}[Pst@]{algebraic}[true]{}% -\define@boolkey[psset]{pst-ode}[Pst@]{silent}[true]{}% +\define@boolkey[psset]{pst-ode}[PstODE@]{append}[true]{}% +\define@boolkey[psset]{pst-ode}[PstODE@]{saveData}[true]{}% +\define@boolkey[psset]{pst-ode}[PstODE@]{algebraicT}[true]{}% +\define@boolkey[psset]{pst-ode}[PstODE@]{algebraicIC}[true]{}% +\define@boolkey[psset]{pst-ode}[PstODE@]{algebraicOutputFormat}[true]{}% +\define@boolkey[psset]{pst-ode}[PstODE@]{algebraicAll}[true]{}% +\define@boolkey[psset]{pst-ode}[PstODE@]{silent}[true]{}% \define@key[psset]{pst-ode}{varsteptol}{\def\ode@varsteptol{#1}}% \def\pstODEsolve{\def\pst@par{}\pst@object{pstODEsolve}}% \def\pstODEsolve@i#1#2#3#4#5#6#7{% @@ -96,39 +95,39 @@ \begingroup% \use@par% \def\filemode{w}% - \ifPst@append\def\filemode{a}\fi% + \ifPstODE@append\def\filemode{a}\fi% \edef\ode@ta{#3{}}% \edef\ode@tb{#4{}}% \edef\ode@init{#6{}}% \edef\ode@init{\expandafter\ode@zapspace\ode@init\@nil}% \edef\ode@arg{#7{}}% - \ifPst@algebraicAll% - \Pst@algebraicTtrue% - \Pst@algebraicICtrue% - \Pst@algebraicOutputFormattrue% + \ifPstODE@algebraicAll% + \PstODE@algebraicTtrue% + \PstODE@algebraicICtrue% + \PstODE@algebraicOutputFormattrue% \Pst@algebraictrue% \fi% - \ifPst@algebraicOutputFormat\edef\ode@fmt{#2{}}\fi% + \ifPstODE@algebraicOutputFormat\edef\ode@fmt{#2{}}\fi% \pstVerb{ tx@odeDict begin - \ifPst@silent + \ifPstODE@silent userdict /odeprint systemdict /pop get put \else userdict /odeprint {print flush} put \fi /ode@tol \ode@varsteptol\space def % rel. tolerance for step size adjustment %process arguments - \ifPst@saveData /statefile (#1.dat) (\filemode) file def \fi - \ifPst@algebraicT + \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 \else - /tStart tx@Dict begin #3 end def - /tEnd tx@Dict begin #4 end def + /tStart tx@Dict begin 1 dict begin #3 end end def + /tEnd tx@Dict begin 1 dict begin #4 end end def \fi /dt tEnd tStart sub #5\space 1 sub div def % output step size \ifx\@empty#6\@empty\else - \ifPst@algebraicIC + \ifPstODE@algebraicIC true setglobal globaldict /ode@laststate [ tx@Dict begin (\ode@init) AlgParser cvx exec end @@ -148,12 +147,12 @@ } bind def \else /ODESET { - aload pop tx@Dict begin 0 begin #7 end end xlength array astore + aload pop tx@Dict begin ode@foo begin #7 end end xlength array astore } bind def - %ensure local scope of user defined variables in #7 + %ensure local scope of user defined variables in #7, from BlueBook, p. 133 /ODESET load 4 1 dict put \fi - \ifPst@algebraicOutputFormat + \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 @@ -166,10 +165,10 @@ /tcur tStart def % current parameter t value /tout tStart dt add def % next output t /ddt dt def % initial integration step size - \ifPst@append\else + \ifPstODE@append\else [ [formatoutput] - \ifPst@saveData dup writeresult \fi + \ifPstODE@saveData dup writeresult \fi aload pop true setglobal ] @@ -182,14 +181,14 @@ globaldict exch /ode@laststate exch put false setglobal [ #1 [formatoutput] - \ifPst@saveData dup writeresult \fi + \ifPstODE@saveData dup writeresult \fi aload pop true setglobal ] globaldict exch /#1 exch cvx put false setglobal } repeat - \ifPst@saveData statefile closefile \fi + \ifPstODE@saveData statefile closefile \fi end % tx@odeDict }% \endgroup% @@ -221,9 +220,9 @@ } \psset[pst-ode]{append=false,saveData=false,algebraicIC=false,algebraicT=false, - algebraic=false,silent=false,varsteptol=1e-6,algebraicOutputFormat=false, - algebraicAll=false + silent=false,varsteptol=1e-6,algebraicOutputFormat=false,algebraicAll=false } +\psset{algebraic=false} \catcode`\@=\PstAtCode\relax %% END: pst-ode.tex |