summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-03-13 03:01:14 +0000
committerNorbert Preining <norbert@preining.info>2021-03-13 03:01:14 +0000
commit2a899339df4bb55e3aa0d5b7a4975b1743341e17 (patch)
tree4d26b328e10b82678abc4bd31726e8b2548eed42 /graphics
parentcf09e33d4f54e872c7090def0ad41b06fb559cdb (diff)
CTAN sync 202103130301
Diffstat (limited to 'graphics')
-rw-r--r--graphics/pstricks/contrib/pst-ode/ChangeLog5
-rw-r--r--graphics/pstricks/contrib/pst-ode/pst-ode-doc.pdfbin130910 -> 131897 bytes
-rw-r--r--graphics/pstricks/contrib/pst-ode/pst-ode-doc.tex7
-rw-r--r--graphics/pstricks/contrib/pst-ode/pst-ode.pro2
-rw-r--r--graphics/pstricks/contrib/pst-ode/pst-ode.tex21
5 files changed, 27 insertions, 8 deletions
diff --git a/graphics/pstricks/contrib/pst-ode/ChangeLog b/graphics/pstricks/contrib/pst-ode/ChangeLog
index 47e1502063..4a98bce72f 100644
--- a/graphics/pstricks/contrib/pst-ode/ChangeLog
+++ b/graphics/pstricks/contrib/pst-ode/ChangeLog
@@ -1,3 +1,8 @@
+2021-03-12
+ * version 0.15
+ * new: option `algebraicN` (infix notation for number of output points)
+ added; input for N silently converted to integer for robustness
+
2019-03-25
* version 0.14
* fix: wrong stepping when dt<0, introduced in v0.11
diff --git a/graphics/pstricks/contrib/pst-ode/pst-ode-doc.pdf b/graphics/pstricks/contrib/pst-ode/pst-ode-doc.pdf
index 391bd62520..3244717e84 100644
--- a/graphics/pstricks/contrib/pst-ode/pst-ode-doc.pdf
+++ b/graphics/pstricks/contrib/pst-ode/pst-ode-doc.pdf
Binary files differ
diff --git a/graphics/pstricks/contrib/pst-ode/pst-ode-doc.tex b/graphics/pstricks/contrib/pst-ode/pst-ode-doc.tex
index 33cb6433b4..6c67293611 100644
--- a/graphics/pstricks/contrib/pst-ode/pst-ode-doc.tex
+++ b/graphics/pstricks/contrib/pst-ode/pst-ode-doc.tex
@@ -133,14 +133,14 @@ If \Lkeyword{algebraicOutputFormat} is set, calculations can be made on the comp
Arguments $t_0$ and $t_\mathrm{e}$ define the interval of integration $I=[t_0, t_\mathrm{e}]$. Both arguments accept expressions in infix or \PS{} (postfix, reverse polish) notation. Infix notation requires option \Lkeyword{algebraicT}.
-$N$ is the number of \emph{equally} spaced output points, including $t_0$ and $t_\mathrm{e}$; it must be $\ge 2$. In order to divide the interval of integration into $K$ output steps, $N$ must be set to $K+1$. Note that the precision of the solution does \emph{not} depend on $N$; internal integration steps are automatically inserted and resized according to the changes in the solution.
+$N$ is the number of \emph{equally} spaced output points, including $t_0$ and $t_\mathrm{e}$; it must be $\ge 2$. In order to divide the interval of integration into $K$ output steps, $N$ must be set to $K+1$. Note that the precision of the solution does \emph{not} depend on $N$; internal integration steps are automatically inserted and resized according to the changes in the solution. This argument accepts an expression in postfix and, if \Lkeyword{algebraicN} is set, in infix notation.
$\mathbf{x}_0$ is a list of $n$ space separated initial values, one for each differential equation. Alternatively, $\mathbf{x}_0$ can be given as a \PS{} procedure pushing the initial values on the stack, or as an algebraic expression in infix notation where the elements are separated by `\Lkeyword{|}'. Infix notation requires option \Lkeyword{algebraicIC}. This argument can be left empty. In that case, the last computed state vector of a preceding \Lcs{pstODEsolve} call serves as initial condition. Of course, the number of equations $n$ must be the same as in the preceding calculation.
$\mathbf{f}(t,\mathbf{x})$ is the right-hand side of the differential equations. Equations can be entered in either infix or \PS{} (postfix, reverse polish) notation. Infix notation requires option \Lkeyword{algebraic}, and equations have to be separated by `\Lkeyword{|}'. The $n$ current state vector components can be referred to as \Lkeyword{x[0]}, \Lkeyword{x[1]}, \dots, \Lkeyword{x[}$n-1$\Lkeyword{]} or \Lkeyword{y[0]}, \Lkeyword{y[1]}, \dots, \Lkeyword{y[}$n-1$\Lkeyword{]}, and the current independent variable value as `\Lkeyword{t}'. If given in \PS{} notation, the provided procedure must first pop the current state vector components in reverse order(!) from the operand stack and then push the first derivatives in regular order back to it. Again, the independent variable value can be accessed using `\Lkeyword{t}'.%\\
\newpage
-\noindent\Lcs{pstODEsolve} accepts a few \OptArgs:\\% \Lkeyword{dt0}, \Lkeyword{append}, \Lkeyword{saveData}, \Lkeyword{algebraicOutputFormat}, \Lkeyword{algebraicT}, \Lkeyword{algebraicIC}, \Lkeyword{algebraic}, \Lkeyword{algebraicAll}, \Lkeyword{silent} and \Lkeyword{varsteptol}.\\
+\noindent\Lcs{pstODEsolve} accepts a few \OptArgs:\\% \Lkeyword{dt0}, \Lkeyword{append}, \Lkeyword{saveData}, \Lkeyword{algebraicOutputFormat}, \Lkeyword{algebraicT}, \Lkeyword{algebraicN}, \Lkeyword{algebraicIC}, \Lkeyword{algebraic}, \Lkeyword{algebraicAll}, \Lkeyword{silent} and \Lkeyword{varsteptol}.\\
\noindent\OptArg*{dt0=<number>}\\
\noindent By default, the output step $(t_\mathrm{e}-t_\mathrm{0})/(N-1)$ is used as the intitial, tentative integration step size. A large initial step may cause the integration to crash early by numerical overflow, in particular if the right-hand side evaluates to large values. With option \Lkeyword{dt0}, an arbitrary value of the initial step size can be specified.\\
@@ -157,6 +157,9 @@ With \Lkeyword{algebraicOutputFormat}, the command argument \Larg{output format}
\noindent\OptArg*{algebraicT}\\
With \Lkeyword{algebraicT}, the integration interval limits $t_0$ and $t_\mathrm{e}$ can be entered as algebraic expressions in infix notation, otherwise \PS{} (postfix, reverse polish) notation must be used. Of course, single rational numbers for $t_0$ and $t_\mathrm{e}$ always work.\\
+\noindent\OptArg*{algebraicN}\\
+In addition to a literal integer number or a \PS{} expression, option \Lkeyword{algebraicN} allows the number of output points $N$ to be provided as an infix expression.\\
+
\noindent\OptArg*{algebraicIC}\\
With \Lkeyword{algebraicIC}, the initial condition vector $\mathbf{x}_0$ can be given in algebraic infix notation. Vector components have to be separated by `\Lkeyword{|}'. Default is \PS{} notation, i.\,e. space separated postfix expressions or rational numbers.\\
diff --git a/graphics/pstricks/contrib/pst-ode/pst-ode.pro b/graphics/pstricks/contrib/pst-ode/pst-ode.pro
index 1b00acbd98..6967071032 100644
--- a/graphics/pstricks/contrib/pst-ode/pst-ode.pro
+++ b/graphics/pstricks/contrib/pst-ode/pst-ode.pro
@@ -1,7 +1,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% PostScript prologue for pst-ode.tex.
-% Version 0.14, 2019/03/25
+% Version 0.15, 2021/03/12
%
% Alexander Grahn (C) 2012--today
%
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