From b2969f21cf31900a4a4544c113f4a7d5a08823ed Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 4 Jan 2024 20:33:01 +0000 Subject: pst-ode (4jan24) git-svn-id: svn://tug.org/texlive/trunk@69296 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/pst-ode/ChangeLog | 4 +++ .../doc/generic/pst-ode/examples/ode.tex | 2 +- .../texmf-dist/doc/generic/pst-ode/pst-ode-doc.pdf | Bin 132361 -> 132595 bytes Master/texmf-dist/dvips/pst-ode/pst-ode.pro | 6 ++-- Master/texmf-dist/tex/generic/pst-ode/pst-ode.tex | 37 +++++++++++++-------- 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/Master/texmf-dist/doc/generic/pst-ode/ChangeLog b/Master/texmf-dist/doc/generic/pst-ode/ChangeLog index abd4c1bb1a1..f01e22a6c62 100644 --- a/Master/texmf-dist/doc/generic/pst-ode/ChangeLog +++ b/Master/texmf-dist/doc/generic/pst-ode/ChangeLog @@ -1,3 +1,7 @@ +2024-01-04 + * version 0.19 + * fix: PS dict issue + 2022-11-24 * version 0.18 * new: option `rk4' added, classical RK4 method (no adaptive stepsize) diff --git a/Master/texmf-dist/doc/generic/pst-ode/examples/ode.tex b/Master/texmf-dist/doc/generic/pst-ode/examples/ode.tex index 2d2f52aa278..fdf6b670e07 100644 --- a/Master/texmf-dist/doc/generic/pst-ode/examples/ode.tex +++ b/Master/texmf-dist/doc/generic/pst-ode/examples/ode.tex @@ -10,7 +10,7 @@ \psset{xAxisLabel=$t$,xAxisLabelPos={c,-6ex},yAxisLabelPos={-3ex,c}} \begin{psgraph}[axesstyle=frame,Ox=-1,](0,0)(0,0)(4,1){10cm}{2.5cm} \rput(1,0){\psplot[algebraic]{-1}{3}{Euler^(-x^2)}} - \pstODEsolve[rk4,algebraicIC,algebraic]{TY}{(t) 0}{-1}{3}{7}{1/Euler}{-2*t*y[0]} + \pstODEsolve[algebraicIC,algebraic]{TY}{(t) 0}{-1}{3}{5}{1/Euler}{-2*t*y[0]} \rput(1,0){\listplot[plotstyle=dots,dotsize=0.05,linecolor=red]{TY}} \end{psgraph} \end{pspicture} diff --git a/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.pdf b/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.pdf index 9aaadf8ae1e..383709d4938 100644 Binary files a/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.pdf and b/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.pdf differ diff --git a/Master/texmf-dist/dvips/pst-ode/pst-ode.pro b/Master/texmf-dist/dvips/pst-ode/pst-ode.pro index 38cf998e9ed..f9d8fdcf50b 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.18, 2022/11/24 +% Version 0.19, 2024/01/04 % % Alexander Grahn (C) 2012--today % @@ -66,7 +66,7 @@ end %[state vector x(t)] RKF45 => [x(t)] [x(t+ddt) by RKF4] errmax /RKF45 { dup - ode@dict tcur end /t exch def + /t ode@dict tcur end def ODESET ode@dict ddt mulvect /k1 exch def @@ -174,7 +174,7 @@ end %failed step -> reduce step size ode@dict exch pop pshrink exp 0.1 max sfty mul ddt mul /ddt exch def - ode@dict tcur ddt add tcur end eq { + tcur ddt add tcur eq { % error: step size underflow in ODEINT (! t=) odeprint tcur odeprint % print & remove previous state vector 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 3ab38399c38..498ea7b923c 100644 --- a/Master/texmf-dist/tex/generic/pst-ode/pst-ode.tex +++ b/Master/texmf-dist/tex/generic/pst-ode/pst-ode.tex @@ -12,8 +12,8 @@ %% ODEs using the Runge-Kutta-Fehlberg (RKF45) method with automatic %% step size adjustment %% -\def\fileversion{0.18} -\def\filedate{2022/11/24} +\def\fileversion{0.19} +\def\filedate{2024/01/04} \csname PSTODELoaded\endcsname \let\PSTODELoaded\endinput @@ -137,7 +137,7 @@ 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 + AlgParser cvx exec end ode@dict /tEnd exch def end \else 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 @@ -164,23 +164,34 @@ 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 - ode@dict /x exch def /y x def end tx@Dict begin ode@dict ode@rpn end end ode@dict xlength end array astore - } bind def + /ODESET [% system of ODEs + 10 array aload pop + (\expandafter\ode@zapspace\ode@arg\@nil) AlgParser aload pop + 7 array aload pop + ] + dup 0 {tx@Dict begin 2 begin /x exch def /y x def} putinterval + % ensure local scope of user defined variables in #7, from BlueBook, p. 133 + dup 2 1 dict put + dup dup length 7 sub {end end ode@dict xlength end array astore} putinterval + cvx bind def \else /ODESET { aload pop tx@Dict begin 4 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 \fi \ifPstODE@algebraicOutputFormat - /ode@fmtrpn tx@Dict begin (\expandafter\ode@zapspace\ode@fmt\@nil) AlgParser end cvx bind def - /formatoutput {% - ode@dict ode@laststate /x exch def /y x def /t tcur def end - tx@Dict begin ode@dict ode@fmtrpn end end - } bind def + /formatoutput [ + 13 array aload pop + (\expandafter\ode@zapspace\ode@fmt\@nil) AlgParser aload pop + /end cvx + ] + dup 0 { + /x ode@laststate def /y x def + /t ode@dict tcur end def + tx@Dict begin + } putinterval + cvx bind def \else /formatoutput {[#2] assembleresult} def \fi %perform ode integration rk4 { -- cgit v1.2.3