Graphics, Figures & TablesPlotting a trajectory of a 2d model

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
pallav
Posts: 170
Joined: Wed Nov 12, 2008 5:53 pm

Plotting a trajectory of a 2d model

Post by pallav »

I want to get the trajectory curve of the system:

Code: Select all

$dx/dt = x(1-x-\alpha_{12}*y)$ and
$dy/dt = \rho*y*(1-y-\alpha_{21}*x)$
for some initial (x(0), y(0))=(0.1, 0.1)

Code: Select all

\documentclass[border=10pt]{standalone}
\usepackage{pst-plot,pst-ode}
\begin{document}

\psset{unit=3}
\begin{pspicture}(-0.2,-0.2)(2.1,2.1)
    \psaxes[ticksize=0 4pt,axesstyle=frame,tickstyle=inner,subticks=20,
    Ox=0,Oy=0](0,0)(2,2)
\psset{arrows=->,algebraic}
\pstVerb{
    /alpha12 0.75 def
    /alpha21 0.75 def
    /rho 2 def
}
\pstODEsolve[varsteptol=1e-5,saveData]%
  {y0a}%
  {0 1}%
  {0}{40}{1000}%
  {0.1 0.1}%
  {x[0]*(1-x[0]-alpha12*x[1]) | rho*x[2]*(1-x[1]-alpha21*x[0])}
\psset{arrows=-,linewidth=1pt}%
\listplot[linecolor=red]{y0a}
\end{pspicture}
\end{document}
Please help to get the figure.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Post Reply