summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-ode
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-11-05 23:20:34 +0000
committerKarl Berry <karl@freefriends.org>2013-11-05 23:20:34 +0000
commitb5ba601a229f163d52b5f8b68a297e92e675b401 (patch)
tree60ecc9d0adc8e20495141cd3e3fa313779fe30a0 /Master/texmf-dist/tex/generic/pst-ode
parentbb1c53dfd5963b465b5a50b11aa9ba72589c4416 (diff)
pst-ode (5nov13)
git-svn-id: svn://tug.org/texlive/trunk@32082 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.tex36
1 files changed, 28 insertions, 8 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 b183a7742d7..1d10cb31c2b 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.3}
-\def\filedate{2013/10/28}
+\def\fileversion{0.4}
+\def\filedate{2013/11/05}
\csname PSTODELoaded\endcsname
\let\PSTODELoaded\endinput
@@ -54,6 +54,10 @@
% * saveData result is written to file <result>.dat
% * algebraic (system of) ODE given in infix notation
% * algebraicIC initial condition vector given in infix notation
+% * algebraicT integration interval limits ta, tb given in infix notation
+% * algebraicOutputFormat output vector format given in infix notation
+% * algebraicAll output vector format, ta, tb, initial cond., function given
+% in infix notation
% * silent suppress output of stepping information
% * varsteptol relative tolerance for step size adjustment
%
@@ -79,10 +83,12 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\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}[Pst@]{algebraicOutputFormat}[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{%
@@ -91,9 +97,17 @@
\use@par%
\def\filemode{w}%
\ifPst@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%
+ \Pst@algebraictrue%
+ \fi%
\ifPst@algebraicOutputFormat\edef\ode@fmt{#2{}}\fi%
\pstVerb{
tx@odeDict begin
@@ -105,8 +119,13 @@
/ode@tol \ode@varsteptol\space def % rel. tolerance for step size adjustment
%process arguments
\ifPst@saveData /statefile (#1.dat) (\filemode) file def \fi
- /tStart #3 def
- /tEnd #4 def
+ \ifPst@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
+ \fi
/dt tEnd tStart sub #5\space 1 sub div def % output step size
\ifx\@empty#6\@empty\else
\ifPst@algebraicIC
@@ -123,7 +142,7 @@
/xlength ode@laststate length def % number of equations
/xlength1 xlength 1 add def % number of equations plus 1
\ifPst@algebraic
- /ode@rpn (\expandafter\ode@zapspace\ode@arg\@nil) AlgParser cvx bind def
+ /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
} bind def
@@ -135,7 +154,7 @@
/ODESET load 4 1 dict put
\fi
\ifPst@algebraicOutputFormat
- /ode@fmtrpn (\expandafter\ode@zapspace\ode@fmt\@nil) AlgParser cvx bind def
+ /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
tx@Dict begin ode@fmtrpn end
@@ -201,8 +220,9 @@
}%
}
-\psset[pst-ode]{append=false,saveData=false,algebraicIC=false,
+\psset[pst-ode]{append=false,saveData=false,algebraicIC=false,algebraicT=false,
algebraic=false,silent=false,varsteptol=1e-6,algebraicOutputFormat=false,
+ algebraicAll=false
}
\catcode`\@=\PstAtCode\relax