summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-11-24 20:39:29 +0000
committerKarl Berry <karl@freefriends.org>2022-11-24 20:39:29 +0000
commit357637f662b6d1e080a92685dc01102ba935157b (patch)
tree435e643680ead9a251d342d34b30fc90f6d594c2 /Master
parentbee9ff1e4cba6801c731af8e5ce1d8c01db64e32 (diff)
pst-ode (24nov22)
git-svn-id: svn://tug.org/texlive/trunk@65096 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/generic/pst-ode/ChangeLog4
-rw-r--r--Master/texmf-dist/doc/generic/pst-ode/examples/ode.tex2
-rw-r--r--Master/texmf-dist/doc/generic/pst-ode/pst-doc-new.cls499
-rw-r--r--Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.pdfbin132631 -> 132361 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.tex16
-rw-r--r--Master/texmf-dist/dvips/pst-ode/pst-ode.pro164
-rw-r--r--Master/texmf-dist/tex/generic/pst-ode/pst-ode.tex24
7 files changed, 635 insertions, 74 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-ode/ChangeLog b/Master/texmf-dist/doc/generic/pst-ode/ChangeLog
index be28505bfd8..abd4c1bb1a1 100644
--- a/Master/texmf-dist/doc/generic/pst-ode/ChangeLog
+++ b/Master/texmf-dist/doc/generic/pst-ode/ChangeLog
@@ -1,3 +1,7 @@
+2022-11-24
+ * version 0.18
+ * new: option `rk4' added, classical RK4 method (no adaptive stepsize)
+
2022-05-14
* version 0.17
* fix: URL of lppl.txt in various files
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 fdf6b670e07..2d2f52aa278 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[algebraicIC,algebraic]{TY}{(t) 0}{-1}{3}{5}{1/Euler}{-2*t*y[0]}
+ \pstODEsolve[rk4,algebraicIC,algebraic]{TY}{(t) 0}{-1}{3}{7}{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-doc-new.cls b/Master/texmf-dist/doc/generic/pst-ode/pst-doc-new.cls
new file mode 100644
index 00000000000..bd34a462df5
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pst-ode/pst-doc-new.cls
@@ -0,0 +1,499 @@
+% $Id: pst-doc.cls 1044 2019-04-11 09:32:09Z herbert $
+%
+%%
+%% The PSTricks Project
+%%
+%% ``pst-doc'' class for use with the PSTricks documentation.
+%%
+%% Copyright (C) 2009-2017 Herbert Voss
+%%
+%% It may be distributed and/or modified under the conditions
+%% of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%%
+%% See http://www.latex-project.org/lppl.txt for details.
+%%
+%
+\listfiles
+\ProvidesClass{pst-doc-new}[2022/11/24 PSTricks documentation class (hv,ag)]
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
+\ProcessOptions\relax
+%
+\LoadClass{scrartcl}
+%
+\RequirePackage[dvipsnames,x11names,svgnames,table]{xcolor}
+\RequirePackage{iftex}
+\RequirePackage{everyshi}
+\RequirePackage{amsmath, amssymb}
+\iftutex
+ \usepackage{unicode-math}
+ \usepackage{libertinus-otf}
+ \setmonofont[Scale=MatchLowercase,FakeStretch=0.92]{DejaVu Sans Mono}
+% \setmathfont{XITS Math}
+\else
+ \RequirePackage[T1]{fontenc}
+ \RequirePackage{textcomp}
+ %\RequirePackage[euler-digits]{eulervm}
+ \RequirePackage{bera}
+ %\RequirePackage[scaled=0.85]{luximono}
+\fi
+\usepackage[includeheadfoot,lmargin=2cm,tmargin=1cm,bmargin=1.5cm,rmargin=1.5cm]{geometry}
+\RequirePackage{ifpdf}
+% Define commands that don't eat spaces.
+\RequirePackage{xspace}
+\makeatletter
+\providecommand{\IfPackageLoaded}[2]{\@ifpackageloaded{#1}{#2}{}}
+\providecommand{\IfPackageNotLoaded}[2]{\@ifpackageloaded{#1}{}{#2}}
+\providecommand{\IfElsePackageLoaded}[3]{\@ifpackageloaded{#1}{#2}{#3}}
+\providecommand{\IfChapterDefined}[1]{\ifthenelse{\boolean{chapteravailable}}{#1}{}}%
+\providecommand{\IfElseChapterDefined}[2]{\ifthenelse{\boolean{chapteravailable}}{#1}{#2}}%
+\providecommand{\IfDefined}[2]{\ifcsname #1\endcsname #2 \fi}
+\providecommand{\IfElseDefined}[3]{\ifcsname #1\endcsname #2 \else #3 \fi}
+\providecommand{\IfElseUnDefined}[3]{\ifcsname #1\endcsname #3 \else #2\fi}
+% Definde frontmatter, mainmatter and backmatter if not defined
+\@ifundefined{frontmatter}{%
+ \newcommand{\frontmatter}{%
+ %In Roemischen Buchstaben nummerieren (i, ii, iii)
+ \pagenumbering{roman}}
+}{}
+\@ifundefined{mainmatter}{%
+ % scrpage benoetigt den folgenden switch
+ % wenn \mainmatter definiert ist.
+ \newif\if@mainmatter\@mainmattertrue
+ \newcommand{\mainmatter}{%
+ % -- Seitennummerierung auf Arabische Zahlen zuruecksetzen (1,2,3)
+ \pagenumbering{arabic}%
+ \setcounter{page}{1}}
+}{}
+\@ifundefined{backmatter}{%
+ \newcommand{\backmatter}{
+ %In Roemischen Buchstaben nummerieren (i, ii, iii)
+ \pagenumbering{roman}}
+}{}
+
+% Pakete speichern die spaeter geladen werden sollen
+\newcommand{\LoadPackagesNow}{}
+\newcommand{\LoadPackageLater}[1]{%
+ \g@addto@macro{\LoadPackagesNow}{%
+ \RequirePackage{#1}%
+ }%
+}
+%
+\RequirePackage{makeidx}
+\makeindex
+\RequirePackage{calc}
+\RequirePackage{babel}
+\RequirePackage{xkeyval}
+\RequirePackage{pst-xkey}
+\RequirePackage{pstricks}
+\RequirePackage{xkvview}
+%\let\pstricksFV\fileversion
+%\let\pstricksFD\filedate
+\RequirePackage{multido}
+\RequirePackage{lscape}
+\RequirePackage{graphicx}
+\RequirePackage{eso-pic}
+\definecolor{DOrange}{rgb}{1,.4,.2}
+\RequirePackage{tabularx,ragged2e}
+\RequirePackage{booktabs}
+\RequirePackage[bottom,stable,ragged]{footmisc}
+%\RequirePackage{chngcntr}
+\RequirePackage{nameref}
+\RequirePackage{varioref}
+\RequirePackage{subfig}
+\RequirePackage{setspace}
+\RequirePackage{paralist}
+\RequirePackage{biblatex}
+%
+\RequirePackage{fancyvrb}
+\newenvironment{Xverbatim}[2][]%
+ {\VerbatimEnvironment
+\handle@index{#2}
+\begin{Verbatim}[#1]}
+{\end{Verbatim}}
+\newcommand\use@index@vals{\index@vals\global\let\index@vals\relax}
+\def\handle@index#1{%
+ \gdef\index@vals{#1}%
+ \def\FancyVerbFormatLine##1{\FV@ObeyTabs{##1}\use@index@vals}}
+
+%\singlespace
+\RequirePackage{showexpl}
+\renewcommand*\SX@Info{}%
+\definecolor{hellgelb}{rgb}{1,1,0.85}
+\definecolor{colKeys}{rgb}{0,0,1}
+\definecolor{colIdentifier}{rgb}{0,0,0}
+\definecolor{colComments}{rgb}{1,0,0}
+\definecolor{colString}{rgb}{0,0.5,0}
+\providecommand\ON{%
+ \gdef\lst@alloverstyle##1{%
+ \fboxrule=0pt
+ \fboxsep=0pt
+ \fcolorbox{Black!15}{Black!15}{\bfseries\strut##1}%
+}}
+\providecommand\OFF{\xdef\lst@alloverstyle##1{##1}}
+\lstset{%
+ language=PSTricks,%
+ float=hbp,%
+ basicstyle=\ttfamily\small, %
+ identifierstyle=\color{colIdentifier}, %
+ keywordstyle=\color{colKeys}, %
+ stringstyle=\color{colString}, %
+ commentstyle=\color{colComments}, %
+ columns=flexible, %
+ tabsize=4, %
+ frame=single, %
+ extendedchars=true, %
+ showspaces=false, %
+ showstringspaces=false, %
+% numbers=left,
+% numbersep=0.8em,
+% numberstyle=\tiny, %
+ breaklines=true, %
+ breakautoindent=true,
+ captionpos=b,
+ xleftmargin=1em
+}
+\lstset{explpreset={pos=t,wide=false,rframe={},preset=\centering}}
+\lstdefinestyle{syntax}{backgroundcolor=\color{blue!15},numbers=none,xleftmargin=0pt,xrightmargin=0pt,
+ frame=single}
+\lstdefinestyle{code}{backgroundcolor=\color{red!15},%numbers=left,
+xleftmargin=0pt,xrightmargin=0pt,
+ frame=single}
+%
+\usepackage{manfnt}
+\newcommand\XInfofont{\color{blue}\fontsize{8pt}{10pt}\normalfont\itshape}
+\newcommand\XInfo[2][1]{\marginpar
+ [\XInfocorr{#1}\raggedleft\XInfofont#2]%
+ {\XInfocorr{#1}\raggedright\XInfofont#2}}
+\newcommand\XInfocorr[1]{\mbox{}\par
+ \ifcase#1\relax
+ \vspace{-10pt}\or
+ \vspace{2pt}\or
+ \vspace{14pt}\else
+ \ifnum #1=-1 \vspace{-22pt}\else\ERROR\fi
+ \fi}
+\newcommand\XInfoDanger[2][1]{\marginpar
+ [\XInfocorr{#1}\raggedleft\XInfofont
+ \let\\\@normalcr
+ \hangafter-2\hangindent=-.9pc\parindent=-\@flushglue
+ \noindent\rlap{\makebox[\marginparwidth]{\hfill\lower1.2pt\hbox{\dbend}\hspace*{-8pt}}}\hfill#2]%
+ {\XInfocorr{#1}\raggedright\XInfofont
+ \let\\\@normalcr
+ \hangafter-2\hangindent=.9pc\noindent\llap{\lower1.2pt\hbox{\lhdbend}\,}#2}}
+%
+\RequirePackage{xkvview}
+\raggedbottom
+\definecolor{sectioncolor}{RGB}{0, 0, 255} % Schwarz
+\definecolor{textcolor}{RGB}{0, 0, 0} % Schwarz
+\definecolor{shadecolor}{gray}{0.90}
+\colorlet{pdflinkcolor}{DOrange}
+\colorlet{pdfurlcolor}{DOrange}
+\colorlet{pdffilecolor}{DOrange}
+\colorlet{stringcolor}{green!40!black!100}
+\colorlet{commencolor}{blue!0!black!100}
+\RequirePackage[automark]{scrlayer-scrpage}
+
+\pagestyle{scrheadings}
+\clearscrheadings
+\clearscrplain
+\ohead{\pagemark}
+\ihead{\headmark}
+\ofoot[\pagemark]{}
+\automark[subsection]{section}
+\setheadsepline{.4pt}[\color{DOrange}]
+\setheadwidth[0pt]{text}
+\setfootwidth[0pt]{text}
+%% Fussnoten =============================================================
+% Keine hochgestellten Ziffern in der Fussnote (KOMA-Script-spezifisch):
+\deffootnote{1.5em}{1em}{\makebox[1.5em][l]{\thefootnotemark}}
+\addtolength{\skip\footins}{\baselineskip} % Abstand Text <-> Fussnote
+%% Schriften (Sections )==================================================
+\newcommand\SectionFontStyle{\sffamily}
+\setkomafont{sectioning}{\bfseries\SectionFontStyle} % % Titelzeilen % \bfseries
+\setkomafont{pagenumber}{\bfseries\SectionFontStyle} % Seitenzahl
+\setkomafont{pagehead}{\small\sffamily} % Kopfzeile
+%\setkomafont{pagefoot}{\small\sffamily} % Kopfzeile
+\setkomafont{descriptionlabel}{\itshape} % Kopfzeile
+\addtokomafont{sectioning}{\color{sectioncolor}} % Farbe der Ueberschriften
+\renewcommand*{\raggedsection}{\raggedright} % Titelzeile linksbuendig, haengend
+\RequirePackage{caption}
+\captionsetup{
+ margin = 10pt,
+ font = {small,rm},
+ labelfont = {small,bf},
+ format = plain, % oder 'hang'
+ indention = 0em, % Einruecken der Beschriftung
+ labelsep = colon, %period, space, quad, newline
+ justification = RaggedRight, % justified, centering
+ singlelinecheck = true, % false (true=bei einer Zeile immer zentrieren)
+ position = bottom %top
+}
+%%% Bugfix Workaround
+\DeclareCaptionOption{parskip}[]{}
+\DeclareCaptionOption{parindent}[]{}
+
+% Aussehen der Captions fuer subfigures (subfig-Paket)
+\IfPackageLoaded{subfig}{
+ \captionsetup[subfloat]{%
+ margin = 10pt,
+ font = {small,rm},
+ labelfont = {small,bf},
+ format = plain, % oder 'hang'
+ indention = 0em, % Einruecken der Beschriftung
+ labelsep = space, %period, space, quad, newline
+ justification = RaggedRight, % justified, centering
+ singlelinecheck = true, % false (true=bei einer Zeile immer zentrieren)
+ position = bottom, %top
+ labelformat = parens % simple, empty % Wie die Bezeichnung gesetzt wird
+ }
+}
+\setcounter{secnumdepth}{2} % Abbildungsnummerierung mit groesserer Tiefe
+\setcounter{tocdepth}{2} % Inhaltsverzeichnis mit groesserer Tiefe
+%
+% Inhalte von List of Figures
+\IfPackageLoaded{subfig}{\setcounter{lofdepth}{1} %1 = nur figures, 2 = figures + subfigures
+}
+\RequirePackage{xurl}
+\RequirePackage[colorlinks,
+ urlcolor=pdfurlcolor,
+ filecolor=pdffilecolor,
+ linkcolor=pdflinkcolor,
+ breaklinks,
+ linktocpage=true]{hyperref}
+%\ifxetex
+%\else
+% \RequirePackage{breakurl}
+%\fi
+\newsavebox\TBox
+\newenvironment{Bsp}[1]{%
+ \par\bigskip%
+ \begin{lrbox}{\TBox}
+ \begin{minipage}{\linewidth-2\fboxrule}%
+ \setlength\fboxsep{1mm}%
+ \colorbox{DOrange}{\parbox{\linewidth-2\fboxsep}{%
+ \color{White}\sffamily#1}}\par
+ \fontsize{10}{12pt}\fontshape{it}\selectfont%
+ \begin{quote}
+}{%
+\par\bigskip\end{quote}\end{minipage}\end{lrbox}\fboxsep=0pt%
+ \fcolorbox{DOrange}{White}{\usebox\TBox}\par\bigskip}
+
+\newcommand{\RDO}{\color{DOrange!25}\rule[-1mm]{10mm}{5mm}}
+
+\DeclareRobustCommand\PST{\texttt{PSTricks\xspace}}
+\DeclareRobustCommand\PS{\texttt{PostScript\xspace}}
+\def\dt{\ensuremath{\,\mathrm{d}t}}
+\def\Index#1{\index{#1}#1}
+%
+\def\LPack#1{\texttt{#1}\index{#1@\texttt{#1}}\index{Package!#1@\texttt{#1}}}
+\def\nxLPack#1{\texttt{#1}}
+\def\Lprog#1{\texttt{#1}\index{#1@\texttt{#1}}\index{Program!#1@\texttt{#1}}}
+\let\nxLprog\nxLPack
+\def\LFile#1{\texttt{#1}\index{#1@\texttt{#1}}\index{File!#1@\texttt{#1}}}
+\def\nxLFile#1{\texttt{#1}}
+\def\Lext#1{\texttt{.#1}\index{#1@\texttt{.#1}}\index{Extension!#1@\texttt{.#1}}}
+\def\nxLext#1{\texttt{.#1}}
+\def\xLcs#1{\index{#1@\nxLcs{#1}}\index{Macro!#1@\nxLcs{#1}}}
+\def\Lcs#1{\nxLcs{#1}\xLcs{#1}}
+\def\LcsStar#1{\index{#1*@\nxLcs{#1*}}\index{Macro!#1@\nxLcs{#1*}}\nxLcs{#1}\OptArg*{*}}
+\def\nxLcs#1{\texttt{\textbackslash#1}}
+\def\xLenv#1{\index{#1@\texttt{#1}}\index{Environment!#1@\texttt{#1}}}
+\def\Lenv#1{\texttt{#1}\xLenv{#1}}
+\def\Ldim#1{\texttt{\textbackslash#1}\index{#1@\texttt{\textbackslash#1}}\index{Dimension!#1@\texttt{\textbackslash#1}}}
+\def\Lskip#1{\texttt{\textbackslash#1}\index{#1@\texttt{\textbackslash#1}}\index{Skip!#1@\texttt{\textbackslash#1}}}
+\def\Lkeyword#1{\texttt{#1}\xLkeyword{#1}}
+\def\xLkeyword#1{\index{#1@\texttt{#1}}\index{Keyword!#1@\texttt{#1}}}
+\def\nxLkeyword#1{\texttt{#1}}
+
+\def\LKeyword#1{\LKeyword@i#1!!}
+\def\LKeyword@i#1=#2!!{\Lkeyword{#1}\nxLkeyword{=#2}}
+\let\nxLKeyword\nxLenv % same formatting
+
+\let\nxLkeyval\nxLkeyword
+\let\nxLenv\nxLkeyword
+\let\nxLps\nxLkeyword
+\def\LColor#1{\texttt{#1}\xLColor{#1}}
+\def\xLColor#1{\index{#1@\texttt{#1}}\index{Color!#1@\texttt{#1}}}
+\def\Lkeyval#1{\texttt{#1}\xLkeyval{#1}}
+\def\xLkeyval#1{\index{#1@\texttt{#1}}\index{Keyvalue!#1@\texttt{#1}}}
+\def\xLoption#1{\index{#1@\texttt{#1}}\index{Package option!#1@\texttt{#1}}}
+\def\Loption#1{\texttt{#1}\xLoption{#1}}
+\def\LPS#1{\texttt{#1}\index{#1@\texttt{#1}}\index{PostScript!#1@\texttt{#1}}}
+\def\xLps#1{\index{#1@\texttt{#1}}\index{PostScript!#1@\texttt{#1}}}
+\def\nxLps#1{\texttt{#1}}
+\def\Lps#1{\nxLps{#1}\xLps{#1}}
+\def\LClass#1{\texttt{#1}\index{#1@\texttt{#1}}\index{Class!#1@\texttt{#1}}}
+\let\nxLClass\nxLPack
+\let\nxLdim\nxLcs
+\let\nxLskip\nxLcs
+\def\Lctr#1{\texttt{#1}\index{#1@\texttt{#1}}\index{Counter!#1@\texttt{#1}}}
+\def\LCtr#1{\texttt{#1}\index{#1@\texttt{#1}}\index{TeX Counter@\TeX\ Counter!#1@\texttt{#1}}}
+\def\nxLctr#1{\texttt{#1}}
+%
+\newcommand\Lnotation [1]{\nxLnotation{#1}\xLnotation{#1}}
+\newcommand\Lmnotation[1]{\nxLnotation{#1}\xLmnotation{#1}}
+\newcommand\xLnotation[1]{\index{Syntax!#1@\nxLnotation{#1}}\index{#1@\nxLnotation{#1}}}
+\def\nxLnotation#1{\texttt{#1}}
+\def\xLkeyset#1{\expandafter\xLkeyset@i#1\@nil}
+\def\xLkeyset@i#1=#2\@nil{\index{#1@\texttt{#1}}\index{Keyword!#1@\texttt{#1}}
+ \index{#2@\texttt{#2}}\index{Value!#2@\texttt{#2}}}
+\def\Lkeyset#1{\expandafter\Lkeyset@i#1\@nil}
+\def\Lkeyset@i#1=#2\@nil{\texttt{#1=#2}%
+ \index{#1@\texttt{#1}}\index{Keyword!#1@\texttt{#1}}
+ \index{#2@\texttt{#2}}\index{Value!#2@\texttt{#2}}}
+%
+\def\xLKeyset#1{\expandafter\xLKeyset@i#1\@nil}% without using the right value of =
+\def\xLKeyset@i#1=#2\@nil{\index{#1@\texttt{#1}}\index{Keyword!#1@\texttt{#1}}}
+\def\LKeyset#1{\expandafter\LKeyset@i#1\@nil}
+\def\LKeyset@i#1=#2\@nil{\texttt{#1=#2}%
+ \index{#1@\texttt{#1}}\index{Keyword!#1@\texttt{#1}}}
+\let\LKeyword\LKeyset
+%
+\newcommand\Larg [1]{{\normalfont\itshape#1\/}}
+\newcommand\Larga[1]{$\langle$\Larg{#1}$\rangle$}% angles
+\newcommand\Largb[1]{\lcb\Larg{#1}\rcb} % curly brace
+\newcommand\Largs[1]{\lsb\Larg{#1}\rsb} % square brackets
+\newcommand\Largr[1]{\lrb\Larg{#1}\rrb} % round brackets
+\newcommand\LBEG[1]{{\normalfont\ttfamily\bs{}begin\lcb#1\rcb}\xLenv{#1}}
+\newcommand\LmBEG[1]{{\normalfont\ttfamily\bs{}begin\lcb#1\rcb}\xLmenv{#1}}
+\newcommand\LEND[1]{{\normalfont\ttfamily\bs{}end\lcb#1\rcb}\xLenv{#1}}
+\newcommand\LmEND[1]{{\normalfont\ttfamily\bs{}end\lcb#1\rcb}\xLmenv{#1}}
+%
+\DeclareRobustCommand\bs{{\normalfont\ttfamily\textbackslash}} % \let\bslash=\bs
+\DeclareRobustCommand\lcb{{\normalfont\ttfamily\textbraceleft}}
+\DeclareRobustCommand\rcb{{\normalfont\ttfamily\textbraceright}}
+\DeclareRobustCommand\lsb{{\normalfont\ttfamily[}}
+\DeclareRobustCommand\rsb{{\normalfont\ttfamily]}}
+\DeclareRobustCommand\lrb{{\normalfont\ttfamily(}}
+\DeclareRobustCommand\rrb{{\normalfont\ttfamily)}}
+\DeclareRobustCommand\false{{\ttfamily false}}
+\DeclareRobustCommand\true{{\ttfamily true}}
+
+%
+% without brackets
+\def\Coordx#1{$x_{#1}$}
+\def\Coordy#1{$y_{#1}$}
+\def\Coordz#1{$z_{#1}$}
+\def\Coord#1{\Coordx{#1},\kern 1pt\Coordy{#1}}
+\def\Coordn{\Coordx{n},\kern 1pt\Coordy{n}}
+\def\CoordIII#1{\Coordx{#1},\kern 1pt\Coordy{#1},\kern 1pt\Coordz{#1}}% HjG
+\def\CAny{\Coordx{},\kern 1pt\Coordy{}}
+\def\CIIIAny{\Coordx{},\kern 1pt\Coordy{},\kern 1pt\Coordz{}}% hv
+% with brackets
+\def\coord#1{(\Coordx{#1},\kern 1pt\Coordy{#1})}
+\def\coordn{(\Coordx{n},\kern 1pt\Coordy{n})}
+\def\coordiii#1{(\Coordx{#1},\kern 1pt\Coordy{#1},\kern 1pt\Coordz{#1})}% hv
+\def\coordx#1{($x_{#1}$)}
+\def\coordy#1{($y_{#1}$)}
+\def\coordz#1{($z_{#1}$)}
+\def\cAny{(\Coordx{},\kern 1pt\Coordy{})}
+\def\ciiiAny{(\Coordx{},\kern 1pt\Coordy{},\kern 1pt\Coordz{})}% hv
+%
+\newskip\BDefaboveskip
+\newskip\BDefbelowskip
+\newskip\BDefinlineskip
+\setlength\BDefaboveskip{0pt plus 2pt}% first-level list topsep
+\setlength\BDefbelowskip{10pt}
+\setlength\BDefinlineskip{6pt}
+%
+\newsavebox\boxdef
+\newenvironment{BDef}
+ {\begin{lrbox}{\boxdef}
+ \def\arraystretch{1.0}
+ \begin{tabular}{@{}l@{}l@{}l@{}}}
+ {\end{tabular}\end{lrbox}
+%
+% braces around next block are needed to stop the list env checking for blank lines
+% and the \aftergroups then for making sure no indentation happens ... as i said
+% urg
+%
+ {\BCmd\fbox{\usebox\boxdef}\endBCmd}
+ \aftergroup\@afterindentfalse\aftergroup\@afterheading
+ }
+\newenvironment{BDef*}
+ {\begin{lrbox}\boxdef
+ \def\arraystretch{1.0}
+ \begin{tabular}{@{}l@{}l@{}l@{}}
+ }
+ {\end{tabular}\end{lrbox}
+ {\begin{BCmd*}\fbox{\usebox\boxdef}\end{BCmd*}}
+ \aftergroup\@afterindentfalse\aftergroup\@afterheading
+ }
+\newenvironment{BCmd}{
+ \@beginparpenalty-\@lowpenalty
+ \topsep\BDefaboveskip
+ \fboxsep3pt
+ \flushleft}
+ {\@endparpenalty\@M
+ \@topsepadd\BDefbelowskip
+ \endflushleft}
+
+\newenvironment{BCmd*}{
+ \@beginparpenalty\@M
+ \topsep\BDefinlineskip
+ \fboxsep3pt
+ \flushleft}
+ {\@endparpenalty5000
+ \endflushleft}
+
+
+\def\OptArgs{\colorbox{black!20}{\texttt{[Options]}}\kern1pt}
+
+\def\OptArg{\@ifnextchar*\OptArg@i{\OptArg@ii*}}% star version without braces
+\def\OptArg@i*#1{\colorbox{black!20}{\texttt{#1}}\kern1pt}
+\def\OptArg@ii*#1{\colorbox{black!20}{\texttt{[#1]}}\kern1pt}
+\def\DBS{{\ttfamily\textbackslash\textbackslash}}
+
+\def\docauthor#1{\gdef\@docauthor{#1}}
+\docauthor{}
+%\def\author#1{\gdef\@author{#1}\gdef\@docauthor{#1}}
+
+\providecommand\bgImage{}
+\providecommand\bgTitle{}
+\providecommand\LenToUnit[1]{#1\@gobble}
+
+\def\settitle{%
+ \thispagestyle{empty}%
+ \begin{titlepage}
+% \newgeometry{lmargin=1cm,rmargin=1cm,bmargin=1cm,includeheadfoot}%
+ \psset{unit=1cm}%
+ \begin{pspicture}(1.6in,0)(23cm,21.7cm)
+ \psframe[fillstyle=solid,linecolor=lightgray,fillcolor=lightgray,linestyle=solid](0,-5.75)(23,10)
+ \psframe[fillstyle=solid,linecolor=Orange!85!Red,fillcolor=Orange!85!Red,linestyle=solid](0,10)(23,10.5)
+ \psframe[fillstyle=solid,linecolor=Orange!85!Red,fillcolor=Orange!85!Red,linestyle=solid](0,21.1)(23,21.2)
+ \rput[lb](3,22){\Huge\sffamily\color{Orange!65!Red}\psscalebox{2}{\textbf{PSTricks}}}
+ \rput[lb](3,14.1){\parbox{17cm}{\sffamily\RaggedRight\bfseries\huge\@title}}
+ \rput[lb](3,12.6){\parbox{15cm}{\sffamily\Large\@subtitle}}
+ \rput[lb](3,7.6){\parbox{15cm}{\sffamily\@date}}
+ \rput[lb](3,-2.6){\parbox[b]{19cm}{\sffamily\RaggedRight
+ \ifx\@docauthor\empty~\else Documentation by\fi\hfill\makebox[7cm][l]{Package author(s):}\\
+ \ifx\@docauthor\empty~\else{\bfseries\tabular[t]{@{}l@{}}\@docauthor\endtabular}\fi\hfill\makebox[7cm][l]{%
+ \bfseries\shortstack[l]{\@author}
+ %\begin{tabular}[t]{@{}l@{}} \@author\end{tabular}%
+ }}}
+ \rput[C](11,4){\bgImage}%
+ \end{pspicture}%
+ \end{titlepage}
+ \setcounter{footnote}{0}%
+ \global\let\thanks\relax%
+ \global\let\maketitle\relax%
+ \global\let\@thanks\@empty%
+ \global\let\@author\@empty%
+ \global\let\@docauthor\@empty%
+ \global\let\@date\@empty%
+ \global\let\@title\@empty%
+ \global\let\@subtitle\@empty%
+ \global\let\title\relax%
+ \global\let\author\relax%
+ \global\let\date\relax%
+ \global\let\and\relax%
+% \restoregeometry%
+}
+
+\newdimen\fullWidth
+\fullWidth=\linewidth
+\advance\fullWidth by \marginparsep
+\advance\fullWidth by \marginparwidth
+\makeatother
+%%
+%% End of file `pst-doc.cls'.
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 85a26b7a3a4..9aaadf8ae1e 100644
--- a/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.pdf
+++ b/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.tex b/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.tex
index a5c57a07f45..b87607545a6 100644
--- a/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.tex
+++ b/Master/texmf-dist/doc/generic/pst-ode/pst-ode-doc.tex
@@ -10,7 +10,7 @@
twoside=false,
% dvips,
UKenglish
-]{pst-doc}
+]{pst-doc-new}
\usepackage[T1]{fontenc}
%\usepackage{lmodern}
\usepackage[tt=false]{libertine} %override beramono (doesn't look like tt font)
@@ -18,7 +18,7 @@
%\usepackage[scaled=0.83]{luximono} %override beramono (doesn't look like tt font)
\usepackage{attachfile2}
\attachfilesetup{date={},color=1 0 0}
-\usepackage[utf8]{inputenc}
+%\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{pst-3dplot}
\usepackage{pst-plot}
@@ -79,12 +79,13 @@
\def\day{#3}
}
-\begin{document}
\author{Alexander Grahn}
\expandafter\parsedate\filedate\relax %set current date to package date
\title{pst-ode\\[4ex]}
\subtitle{A PSTricks package for solving initial value problems for sets of Ordinary Differential Equations (ODE), v\pstFV\\[2ex]\url{https://gitlab.com/agrahn/pst-ode}}
-\maketitle
+
+\begin{document}
+\settitle
%\clearpage
\begin{abstract}
@@ -140,7 +141,7 @@ $\mathbf{x}_0$ is a list of $n$ space separated initial values, one for each dif
$\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{algebraicN}, \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}, \Lkeyword{varsteptol} and \Lkeyword{rk4}.\\
\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.\\
@@ -173,7 +174,10 @@ Option \Lkeyword{algebraicAll} is equivalent to setting all of \Lkeyword{algebra
Option \Lkeyword{silent} suppresses the terminal output of stepping information.\\
\noindent\OptArg*{varsteptol=<number>}\\
-The tolerance for automatic calculation of the integration step size can be set with \Lkeyword{varsteptol}. The default value is \Lkeyword{1e-6}. Sometimes, it may be helpful to relax this value in order to cope with situations where integration stops with step size underflow. The occurence of step size underflow is indicated by writing `\Lkeyword{!}' to the terminal and integration stops prematurely before reaching $t_\mathrm{e}$. The current value of $t$ and the current state vector $\mathbf{x}$ are written to the terminal. Step size underflow may happen for stiff ODEs at some point along the integration interval $[t_0, t_\mathrm{e}]$.\\[1ex]
+The tolerance for automatic calculation of the integration step size can be set with \Lkeyword{varsteptol}. The default value is \Lkeyword{1e-6}. Sometimes, it may be helpful to relax this value in order to cope with situations where integration stops with step size underflow. The occurence of step size underflow is indicated by writing `\Lkeyword{!}' to the terminal and integration stops prematurely before reaching $t_\mathrm{e}$. The current value of $t$ and the current state vector $\mathbf{x}$ are written to the terminal. Step size underflow may happen for stiff ODEs at some point along the integration interval $[t_0, t_\mathrm{e}]$.\\
+
+\noindent\OptArg*{rk4}\\
+With this option, the classical 4th-order Runge-Kutta method is used to integrate the ODE between output points. No automatic step size control is performed in this case. This option is provided mainly for comparison purposes.\\[1ex]
\begin{BDef}
\Lcs{pstODEsaveState}\Largb{state}
diff --git a/Master/texmf-dist/dvips/pst-ode/pst-ode.pro b/Master/texmf-dist/dvips/pst-ode/pst-ode.pro
index 7358e8cb4fb..38cf998e9ed 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.17, 2022/05/14
+% Version 0.18, 2022/11/24
%
% Alexander Grahn (C) 2012--today
%
@@ -49,16 +49,17 @@ ode@dict
/min { 2 copy gt { exch } if pop } bind def
/max { 2 copy lt { exch } if pop } bind def
%coefficient table (Butcher table) of RKF45
- /a41 25 216 div def /a43 1408 2565 div def
- /a44 2197 4104 div def /a45 1 5 div neg def
- /a51 16 135 div def /a53 6656 12825 div def
- /a54 28561 56430 div def /a55 9 50 div neg def
- /a56 2 55 div def
- /b21 1 4 div def /b31 3 32 div def /b32 9 32 div def
- /b41 1932 2197 div def /b42 7200 2197 div neg def /b43 7296 2197 div def
- /b51 439 216 div def /b52 8 neg def /b53 3680 513 div def
- /b54 845 4104 div neg def /b61 8 27 div neg def /b62 2 def
- /b63 3544 2565 div neg def /b64 1859 4104 div def /b65 11 40 div neg def
+ /c2 1 4 div def /c3 3 8 div def /c4 12 13 div def /c6 1 2 div def
+ /a21 1 4 div def /a31 3 32 div def /a32 9 32 div def
+ /a41 1932 2197 div def /a42 7200 2197 div neg def /a43 7296 2197 div def
+ /a51 439 216 div def /a52 8 neg def /a53 3680 513 div def
+ /a54 845 4104 div neg def /a61 8 27 div neg def /a62 2 def
+ /a63 3544 2565 div neg def /a64 1859 4104 div def /a65 11 40 div neg def
+ /b1 16 135 div def /b3 6656 12825 div def
+ /b4 28561 56430 div def /b5 9 50 div neg def
+ /b6 2 55 div def
+ /b1* 25 216 div def /b3* 1408 2565 div def
+ /b4* 2197 4104 div def /b5* 1 5 div neg def
end
%Runge-Kutta-Fehlberg (RKF45) method
%performs one integration step over tentative step size ddt
@@ -69,50 +70,50 @@ end
ODESET
ode@dict
ddt mulvect /k1 exch def
- dup k1 b21 mulvect addvect
- tcur ddt 4 div add
+ dup k1 a21 mulvect addvect
+ tcur ddt c2 mul add
end
/t exch def
ODESET
ode@dict
ddt mulvect /k2 exch def
- dup k1 b31 mulvect addvect k2 b32 mulvect addvect
- tcur ddt 3 mul 8 div add
+ dup k1 a31 mulvect addvect k2 a32 mulvect addvect
+ tcur ddt c3 mul add
end
/t exch def
ODESET
ode@dict
ddt mulvect /k3 exch def
- dup k1 b41 mulvect addvect k2 b42 mulvect addvect k3 b43 mulvect addvect
- tcur ddt 12 mul 13 div add
+ dup k1 a41 mulvect addvect k2 a42 mulvect addvect k3 a43 mulvect addvect
+ tcur ddt c4 mul add
end
/t exch def
ODESET
ode@dict
ddt mulvect /k4 exch def
- dup k1 b51 mulvect addvect k2 b52 mulvect addvect k3 b53 mulvect addvect
- k4 b54 mulvect addvect
+ dup k1 a51 mulvect addvect k2 a52 mulvect addvect k3 a53 mulvect addvect
+ k4 a54 mulvect addvect
tcur ddt add
end
/t exch def
ODESET
ode@dict
ddt mulvect /k5 exch def
- dup k1 b61 mulvect addvect k2 b62 mulvect addvect k3 b63 mulvect addvect
- k4 b64 mulvect addvect k5 b65 mulvect addvect
- tcur ddt 2 div add
+ dup k1 a61 mulvect addvect k2 a62 mulvect addvect k3 a63 mulvect addvect
+ k4 a64 mulvect addvect k5 a65 mulvect addvect
+ tcur ddt c6 mul add
end
/t exch def
ODESET
ode@dict
ddt mulvect /k6 exch def % => [x(t)]
%fourth order solution (increment dx)
- dup dup k1 a41 mulvect k3 a43 mulvect addvect k4 a44 mulvect addvect
- k5 a45 mulvect addvect dup
+ dup dup k1 b1* mulvect k3 b3* mulvect addvect k4 b4* mulvect addvect
+ k5 b5* mulvect addvect dup
% => [x(t)] [x(t)] [x(t)] [dx by RKF4] [dx by RKF4]
%fifth order solution (abs. error)
- k1 a51 mulvect k3 a53 mulvect addvect k4 a54 mulvect addvect
- k5 a55 mulvect addvect k6 a56 mulvect addvect subvect
+ k1 b1 mulvect k3 b3 mulvect addvect k4 b4 mulvect addvect
+ k5 b5 mulvect addvect k6 b6 mulvect addvect subvect
% => [x(t)] [x(t)] [x(t)] [dx by RKF4] [err]
5 1 roll addvect 4 -2 roll % => [x(t)] [x(t+ddt) by RKF4] [err] [x(t)]
%scaling vector for step size adjustment (Numerical Recipies)
@@ -122,52 +123,93 @@ end
% => [x(t)] [x(t+ddt) by RKF4] errmax
end
} bind def
-/ODEINT { % performs integration over output step [t,t+dt]
- % [ state vector x(t) ] ODEINT => [ state vector x(t+dt) ]
- %decrease overshooting step size
+%classical Runge-Kutta (RK4) method
+%one integration step over step size ddt; no error estimate
+%[state vector x(t)] RK4 => [x(t+ddt) by RK4]
+/RK4 {
+ dup
+ ode@dict tcur end /t exch def
+ ODESET
+ ode@dict
+ ddt mulvect /k1 exch def
+ dup k1 0.5 mulvect addvect
+ tcur ddt 2 div add
+ end
+ /t exch def
+ ODESET
ode@dict
- tout tcur sub dup abs ddt abs lt {/ddt exch def}{pop} ifelse
+ ddt mulvect /k2 exch def
+ dup k2 0.5 mulvect addvect
end
- RKF45
- ode@tol div dup 1 gt {
- %failed step -> reduce step size
+ ODESET
+ ode@dict
+ ddt mulvect /k3 exch def
+ dup k3 addvect
+ tcur ddt add
+ end
+ /t exch def
+ ODESET
+ ode@dict
+ ddt mulvect /k4 exch def % => [x(t)]
+ k1 k2 k3 addvect 2 mulvect addvect k4 addvect 1 6 div mulvect addvect
+ % => [x(t+ddt) by RK4]
+ end
+} bind def
+/ODEINT { % performs integration over output step [t,t+dt]
+ % [ state vector x(t) ] ODEINT => [ state vector x(t+dt) ]
+ rk4 {
+ RK4 (o) odeprint
ode@dict
- exch pop pshrink exp 0.1 max sfty mul ddt mul /ddt exch def
- ode@dict tcur ddt add tcur end eq {
- % error: step size underflow in ODEINT
- (! t=) odeprint tcur odeprint
- % print & remove previous state vector
- (, x=[) odeprint /ode@spc () def
- {ode@spc odeprint /ode@spc ( ) def odeprint} forall (]) odeprint
- true
- }{
- (-) odeprint
- false
- } ifelse
+ /tcur tout def
+ /outStepCnt outStepCnt 1 add def
+ /tout tStart dt outStepCnt mul add def
end
- % on step size underflow, leave loop over output steps (pst-ode.tex)
- {exit} if
- ODEINT %repeat step with new ddt
}{
- %success
- 3 -1 roll pop % remove previous state vector
+ %decrease overshooting step size
ode@dict
- /tcur tcur ddt add def
- dup 0 ne {pgrow exp 5 min sfty mul ddt mul /ddt exch def}{pop} ifelse
- %output step completed?
- tcur tout sub
+ tout tcur sub dup abs ddt abs lt {/ddt exch def}{pop} ifelse
end
- 0 eq {
- (o) odeprint
+ RKF45
+ ode@tol div dup 1 gt {
+ %failed step -> reduce step size
ode@dict
- /tcur tout def
- /outStepCnt outStepCnt 1 add def
- /tout tStart dt outStepCnt mul add def
+ exch pop pshrink exp 0.1 max sfty mul ddt mul /ddt exch def
+ ode@dict tcur ddt add tcur end eq {
+ % error: step size underflow in ODEINT
+ (! t=) odeprint tcur odeprint
+ % print & remove previous state vector
+ (, x=[) odeprint /ode@spc () def
+ {ode@spc odeprint /ode@spc ( ) def odeprint} forall (]) odeprint
+ true
+ }{
+ (-) odeprint
+ false
+ } ifelse
end
+ % on step size underflow, leave loop over output steps (pst-ode.tex)
+ {exit} if
+ ODEINT %repeat step with new ddt
}{
- (+) odeprint ODEINT %continue integration
+ %success
+ 3 -1 roll pop % remove previous state vector
+ ode@dict
+ /tcur tcur ddt add def
+ dup 0 ne {pgrow exp 5 min sfty mul ddt mul /ddt exch def}{pop} ifelse
+ %output step completed?
+ tcur tout sub
+ end
+ 0 eq {
+ (o) odeprint
+ ode@dict
+ /tcur tout def
+ /outStepCnt outStepCnt 1 add def
+ /tout tStart dt outStepCnt mul add def
+ end
+ }{
+ (+) odeprint ODEINT %continue integration
+ } ifelse
} ifelse
- }ifelse
+ } ifelse
} bind def
/writeresult { %write output vector to file
/loopproc load forall
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 7cb0e895733..3ab38399c38 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.17}
-\def\filedate{2022/05/14}
+\def\fileversion{0.18}
+\def\filedate{2022/11/24}
\csname PSTODELoaded\endcsname
\let\PSTODELoaded\endinput
@@ -64,6 +64,8 @@
% * varsteptol relative tolerance for step size adjustment
% * dt0 first tentative integration step size, overrides output step
% size (#4-#3)/(#5-1) used as default value
+% * rk4 instead of RKF45, use 4th-order classical Runge-Kutta between
+% output points (without adaptive step size)
%
% arguments:
%
@@ -87,6 +89,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\define@boolkey[psset]{pst-ode}[PstODE@]{append}[true]{}%
\define@boolkey[psset]{pst-ode}[PstODE@]{saveData}[true]{}%
+\define@boolkey[psset]{pst-ode}[PstODE@]{rk4}[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]{}%
@@ -126,6 +129,9 @@
\fi
/ode@tol \ode@varsteptol\space def % rel. tolerance for step size adjustment
%process arguments
+ /rk4
+ \expandafter\csname ifPstODE@rk4\endcsname true\else false\fi\space
+ def
\ifPstODE@saveData /statefile (#1.dat) (\filemode) file def \fi
\ifPstODE@algebraicT
tx@Dict begin (\expandafter\ode@zapspace\ode@ta\@nil)
@@ -175,10 +181,14 @@
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
- \else /formatoutput {[#2] assembleresult} def \fi%
+ \else /formatoutput {[#2] assembleresult} def \fi
%perform ode integration
- (\string\n pstODEsolve (RKF45),\string\n) odeprint
- (-/+ failed/successful step, "o" output step, "!" step size underflow (stop):\string\n) odeprint
+ rk4 {
+ (\string\n pstODEsolve (RK4),) odeprint ( "o" output step:\string\n) odeprint
+ }{
+ (\string\n pstODEsolve (RKF45),\string\n) odeprint
+ (-/+ failed/successful step, "o" output step, "!" step size underflow (stop):\string\n) odeprint
+ } ifelse
ode@dict
/tcur tStart def % current parameter t value
/outStepCnt 1 def % output step counter
@@ -193,6 +203,8 @@
\ode@dtInit\space 0 eq
{/ddt dt def}{/ddt \ode@dtInit\space def} ifelse
\fi
+ % for RK4, use output step size
+ rk4 {/ddt dt def} if
end
\ifPstODE@append\else
[
@@ -261,7 +273,7 @@
\psset[pst-ode]{append=false,saveData=false,algebraicIC=false,algebraicT=false,
algebraicN=false,silent=false,varsteptol=1e-6,algebraicOutputFormat=false,
- algebraicAll=false,dt0=0
+ algebraicAll=false,dt0=0,rk4=false
}
\psset{algebraic=false}
\catcode`\@=\PstAtCode\relax