summaryrefslogtreecommitdiff
path: root/graphics/pstricks/contrib/pst-ode/pst-ode.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pstricks/contrib/pst-ode/pst-ode.tex')
-rw-r--r--graphics/pstricks/contrib/pst-ode/pst-ode.tex21
1 files changed, 16 insertions, 5 deletions
diff --git a/graphics/pstricks/contrib/pst-ode/pst-ode.tex b/graphics/pstricks/contrib/pst-ode/pst-ode.tex
index fd6d895328..d57ff94273 100644
--- a/graphics/pstricks/contrib/pst-ode/pst-ode.tex
+++ b/graphics/pstricks/contrib/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.14}
-\def\filedate{2019/03/25}
+\def\fileversion{0.15}
+\def\filedate{2021/03/12}
\csname PSTODELoaded\endcsname
\let\PSTODELoaded\endinput
@@ -55,6 +55,7 @@
% * 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
+% * algebraicN accepting infix expression for number of output points
% * algebraicOutputFormat output vector format given in infix notation
% * algebraicAll output vector format, ta, tb, initial cond., function given
% in infix notation
@@ -86,6 +87,7 @@
\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@]{algebraicN}[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]{}%
@@ -101,11 +103,13 @@
\ifPstODE@append\def\filemode{a}\fi%
\edef\ode@ta{#3{}}%
\edef\ode@tb{#4{}}%
+ \edef\ode@N{#5{}}%
\edef\ode@init{#6{}}%
\edef\ode@init{\expandafter\ode@zapspace\ode@init\@nil}%
\edef\ode@arg{#7{}}%
\ifPstODE@algebraicAll%
\PstODE@algebraicTtrue%
+ \PstODE@algebraicNtrue%
\PstODE@algebraicICtrue%
\PstODE@algebraicOutputFormattrue%
\Pst@algebraictrue%
@@ -130,8 +134,14 @@
\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
+ \fi%
+ \ifPstODE@algebraicN
+ tx@Dict begin (\expandafter\ode@zapspace\ode@N\@nil)
+ AlgParser cvx exec cvi end ode@dict /N exch def end
+ \else
+ tx@Dict begin 1 dict begin #5 cvi end end ode@dict /N exch def end
\fi
- ode@dict /dt tEnd tStart sub #5\space 1 sub div def end % output step size
+ ode@dict /dt tEnd tStart sub N 1 sub div def end % output step size
\ifx\@empty\ode@init\@empty\else
\ifPstODE@algebraicIC
true setglobal globaldict /ode@laststate [
@@ -194,7 +204,7 @@
false setglobal
(o) odeprint
\fi
- #5\space 1 sub {
+ ode@dict N end 1 sub {
ode@laststate ODEINT [ exch aload pop true setglobal ]
globaldict exch /ode@laststate exch put false setglobal
[
@@ -249,7 +259,8 @@
}
\psset[pst-ode]{append=false,saveData=false,algebraicIC=false,algebraicT=false,
- silent=false,varsteptol=1e-6,algebraicOutputFormat=false,algebraicAll=false,dt0=0
+ algebraicN=false,silent=false,varsteptol=1e-6,algebraicOutputFormat=false,
+ algebraicAll=false,dt0=0
}
\psset{algebraic=false}
\catcode`\@=\PstAtCode\relax