texlive[58308] branches/branch2020.0/Master/texmf-dist: pst-ode

commits+karl at tug.org commits+karl at tug.org
Sat Mar 13 00:04:16 CET 2021


Revision: 58308
          http://tug.org/svn/texlive?view=revision&revision=58308
Author:   karl
Date:     2021-03-13 00:04:16 +0100 (Sat, 13 Mar 2021)
Log Message:
-----------
pst-ode (12mar21) (branch)

Modified Paths:
--------------
    branches/branch2020.0/Master/texmf-dist/doc/generic/pst-ode/ChangeLog
    branches/branch2020.0/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.pdf
    branches/branch2020.0/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.tex
    branches/branch2020.0/Master/texmf-dist/dvips/pst-ode/pst-ode.pro
    branches/branch2020.0/Master/texmf-dist/tex/generic/pst-ode/pst-ode.tex

Modified: branches/branch2020.0/Master/texmf-dist/doc/generic/pst-ode/ChangeLog
===================================================================
--- branches/branch2020.0/Master/texmf-dist/doc/generic/pst-ode/ChangeLog	2021-03-12 23:04:02 UTC (rev 58307)
+++ branches/branch2020.0/Master/texmf-dist/doc/generic/pst-ode/ChangeLog	2021-03-12 23:04:16 UTC (rev 58308)
@@ -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

Modified: branches/branch2020.0/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.pdf
===================================================================
(Binary files differ)

Modified: branches/branch2020.0/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.tex
===================================================================
--- branches/branch2020.0/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.tex	2021-03-12 23:04:02 UTC (rev 58307)
+++ branches/branch2020.0/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.tex	2021-03-12 23:04:16 UTC (rev 58308)
@@ -133,7 +133,7 @@
 
 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.
 
@@ -140,7 +140,7 @@
 $\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 @@
 \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.\\
 

Modified: branches/branch2020.0/Master/texmf-dist/dvips/pst-ode/pst-ode.pro
===================================================================
--- branches/branch2020.0/Master/texmf-dist/dvips/pst-ode/pst-ode.pro	2021-03-12 23:04:02 UTC (rev 58307)
+++ branches/branch2020.0/Master/texmf-dist/dvips/pst-ode/pst-ode.pro	2021-03-12 23:04:16 UTC (rev 58308)
@@ -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
 %

Modified: branches/branch2020.0/Master/texmf-dist/tex/generic/pst-ode/pst-ode.tex
===================================================================
--- branches/branch2020.0/Master/texmf-dist/tex/generic/pst-ode/pst-ode.tex	2021-03-12 23:04:02 UTC (rev 58307)
+++ branches/branch2020.0/Master/texmf-dist/tex/generic/pst-ode/pst-ode.tex	2021-03-12 23:04:16 UTC (rev 58308)
@@ -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 at boolkey[psset]{pst-ode}[PstODE@]{append}[true]{}%
 \define at boolkey[psset]{pst-ode}[PstODE@]{saveData}[true]{}%
 \define at boolkey[psset]{pst-ode}[PstODE@]{algebraicT}[true]{}%
+\define at boolkey[psset]{pst-ode}[PstODE@]{algebraicN}[true]{}%
 \define at boolkey[psset]{pst-ode}[PstODE@]{algebraicIC}[true]{}%
 \define at boolkey[psset]{pst-ode}[PstODE@]{algebraicOutputFormat}[true]{}%
 \define at boolkey[psset]{pst-ode}[PstODE@]{algebraicAll}[true]{}%
@@ -101,11 +103,13 @@
   \ifPstODE at append\def\filemode{a}\fi%
   \edef\ode at ta{#3{}}%
   \edef\ode at tb{#4{}}%
+  \edef\ode at N{#5{}}%
   \edef\ode at init{#6{}}%
   \edef\ode at init{\expandafter\ode at zapspace\ode at init\@nil}%
   \edef\ode at arg{#7{}}%
   \ifPstODE at algebraicAll%
     \PstODE at algebraicTtrue%
+    \PstODE at algebraicNtrue%
     \PstODE at algebraicICtrue%
     \PstODE at algebraicOutputFormattrue%
     \Pst at algebraictrue%
@@ -130,8 +134,14 @@
     \else
       tx at Dict begin 1 dict begin #3 end end ode at dict /tStart exch def end
       tx at Dict begin 1 dict begin #4 end end ode at dict /tEnd   exch def end
+    \fi%
+    \ifPstODE at algebraicN
+      tx at Dict begin (\expandafter\ode at zapspace\ode at N\@nil)
+        AlgParser cvx exec cvi end ode at dict /N exch def end
+    \else
+      tx at Dict begin 1 dict begin #5 cvi end end ode at dict /N exch def end
     \fi
-    ode at dict /dt tEnd tStart sub #5\space 1 sub div def end % output step size
+    ode at dict /dt tEnd tStart sub N 1 sub div def end % output step size
     \ifx\@empty\ode at init\@empty\else
       \ifPstODE at algebraicIC
         true setglobal globaldict /ode at laststate [
@@ -194,7 +204,7 @@
       false setglobal
       (o) odeprint
     \fi
-    #5\space 1 sub {
+    ode at dict N end 1 sub {
       ode at laststate ODEINT [ exch aload pop true setglobal ]
       globaldict exch /ode at 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



More information about the tex-live-commits mailing list.