3

I want to use the example in the example of an­i­mate package. But I cannot run it successfully. I found no pst-ode package in the package manager. But I installed it.

\documentclass{article}
\usepackage{multido}
\usepackage{pst-3dplot}
\usepackage{pst-ode}
\usepackage{animate}
\begin{document}
%Lorenz’ set of differential equations
\def\lorenz{%
10*(x[1]-x[0]) | %dx/dt
x[0]*(28-x[2]) - x[1] | %dy/dt
x[0]*x[1] - 8/3*x[2] %dz/dt
}%
%
%write timeline file
\newwrite\OutFile%
\immediate\openout\OutFile=lorenz.tln%
\multido{\iLorenz=0+1}{101}{%
\immediate\write\OutFile{::\iLorenz x0}%
}%
\immediate\write\OutFile{::c,101}%
\multido{\iLorenz=102+1}{89}{%
\immediate\write\OutFile{::\iLorenz}%
}%
\immediate\closeout\OutFile%
%
\psset{unit=0.155,linewidth=0.5pt}%
\begin{animateinline}[
timeline=lorenz.tln,
controls,poster=last,
begin={\begin{pspicture}(-39,-13)(39,60)},
end={\end{pspicture}}
]{10}
%coordinate axes
\psset{Alpha=120,Beta=20}%
\pstThreeDCoor[xMax=33,yMax=33,zMax=55,linecolor=black]%
\newframe
\pstODEsetOrRestoreState{10 10 30} %initial condition
\multiframe{100}{i=0+1,rtZero=0+0.25,rtOne=0.25+0.25}{%
\pstODEsaveState{savedState}%
%compute attractor segments, stored in ‘lorenzXYZseg’
\pstODEsolve[algebraic]{lorenzXYZseg}{0 1 2}{\rtZero}{\rtOne}{26}{savedState}%
{\lorenz}%
%compute the whole attractor, stored in ‘lorenzXYZall’, with the same stepping
\ifnum\i=0\relax%
\pstODEsolve[algebraic]{lorenzXYZall}{0 1 2}{\rtZero}{\rtOne}{26}{savedState}%
{\lorenz}%
\else%
\pstODEsolve[algebraic,append]{lorenzXYZall}{0 1 2}{\rtZero}{\rtOne}{26}%
{savedState}{\lorenz}%
\fi%
\listplotThreeD[plotstyle=line]{lorenzXYZseg}%
}%
\newframe% required between two \multiframe
\multiframe{90}{rAlpha=116+-4}{% fly-around
\psset{Alpha=\rAlpha,Beta=20}%
\pstThreeDCoor[xMax=33,yMax=33,zMax=55,linecolor=black]%
\listplotThreeD[plotstyle=line]{lorenzXYZall}%
}%
\end{animateinline}
\end{document}

The code is also attached in the animate package.pdf,the figure looks like lorenz
(source: texwelt.de)

If you are skillful with this package, please give me some help!Thanks a lot!!!

2

I suppose you are using a Debisan distribution which is often out-of-date. Download http://www.ctan.org/pkg/pst-ode

unpack and save the files in ~/texmf/tex/generic/pst-ode/, then run texhash (not needed for TEXMFHOME but doesn't hurt) and the file should be found by

kpsewhich pst-ode.tex
  • Thank you for your answer. The pst-ode.sty can be found now. But the code stunk at \newframe. Can you run this code in your Tex and generate the PDF? – yajun Nov 16 '14 at 18:26
  • Also, 'undefined control sequence' shows. – yajun Nov 16 '14 at 18:27
  • I have no problem with latex->dvips->ps2pdf and then viewing it with acroread – user2478 Nov 16 '14 at 20:09
  • Still can't run it out. Now the problem is TEX capacity exceeded. Main memory size=3000000 – yajun Nov 16 '14 at 22:17
  • So sorry, but now comes with couldn't find header file: pst-ode.pro. I have run texhash before. – yajun Nov 16 '14 at 23:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.