[pstricks] Re: problem with pstricks-add

Herbert Voss LaTeX at zedat.fu-berlin.de
Tue Sep 20 21:46:55 CEST 2005


Joaquin M. Gutierrez wrote:

>>Joaquin M. Gutierrez wrote:
>>
>>
>>>I would make a suggestion: it would be very interesting that the
>>>option ArrowInside be available for \psplotDiffEqn.
>>>This would allow drawing the phase portrait of a differential
>>>system. Now I have to draw the arrows by hand.

you can use the macro \psplotDiffEqn twice with the default
arrows=-> option, but with a different end value.

Herbert


\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{pstricks-add}
\pagestyle{empty}
\begin{document}

This is the phase portrait of the planar differential system
\[
\begin{cases}
   x^\prime = x(1-x-(5/2)y)\\
   y^\prime  = y(2-x-2y),
\end{cases}
\]
defined on the region $x\geq 0$, $y\geq 0$,
where the unknown are $x(t)$ and $y(t)$.
Only two arrows have been placed ``by hand'' on two orbits.
Each orbit should have one o more arrows, indicating the sense of the
increasing $t$'s.


\begin{center}
\psset{unit=25mm}
\begin{pspicture}(-.2,-.2)(2,2)
\psline[linewidth=2pt,ArrowInside=->](.1,0)(.9,0)
\psline[linewidth=2pt,ArrowInside=-<](1.1,0)(2,0)
\psline[linewidth=2pt,ArrowInside=->](0,.1)(0,.9)
\psline[linewidth=2pt,ArrowInside=-<](0,1.1)(0,2)
\newcommand{\FuncAlg}{y[0]*(1-y[0]-2.5*y[1]);y[1]*(2-y[0]-2*y[1])}
\psset{algebraic=true,method=rk4,whichabs=0,whichord=1,linewidth=2pt}
\psplotDiffEqn{0}{3.7}{.95 .09}{\FuncAlg}%
\psplotDiffEqn[arrows=->]{.5}{2.5}{.95 .09}{\FuncAlg}%
%
\psplotDiffEqn{0}{2.9}{2 .5}{\FuncAlg}%
\psplotDiffEqn[arrows=->]{1}{1.5}{2 .5}{\FuncAlg}%
%
\psplotDiffEqn{0}{2.5}{2 1}{\FuncAlg}%
\psplotDiffEqn[arrows=->]{1}{1.25}{2 1}{\FuncAlg}%
%
\psplotDiffEqn{0}{2.4}{2 1.5}{\FuncAlg}%
\psplotDiffEqn[arrows=->]{.85}{1.1}{2 1.5}{\FuncAlg}%
%
\psplotDiffEqn{0}{1.8}{2 2}{\FuncAlg}%
\psplotDiffEqn[arrows=->]{1}{1.2}{2 2}{\FuncAlg}%
%
\psplotDiffEqn{0}{1.4}{1 2}{\FuncAlg}%
\psplotDiffEqn[arrows=->]{.5}{.65}{1 2}{\FuncAlg}%
%
\psplotDiffEqn{0}{3.1}{.11 .04}{\FuncAlg}%
\psplotDiffEqn[arrows=->]{.5}{2}{.11 .04}{\FuncAlg}%
%
\uput[-90](2,0){$x$} \uput[180](0,2){$y$}%
\uput[-135](0,0){$0$}\uput[180](0,1){$1$}%
\uput[-90](1,0){$1$}%
\rput(0,0){$\bullet$}%
\rput(1,0){$\bullet$}%
\rput(0,1){$\bullet$}%
\end{pspicture}
\end{center}

\end{document}





More information about the PSTricks mailing list