       Re: ORDINARY DIFFERENTIAL EQUATION

• To: mathgroup at smc.vnet.net
• Subject: [mg32174] Re: [mg32170] ORDINARY DIFFERENTIAL EQUATION
• From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
• Date: Fri, 4 Jan 2002 05:03:48 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```You should specify the region over which you wish to plot the flow
lines, which means both the "starting points" and the duration of flows.
Since you do not I shall choose it myself.

In:=
g[a_, b_] := Module[{x, y, t},
{x, y} /. Flatten[NDSolve[{Derivative[x][t] == (1 - x[t] -
0.5*y[t])*x[t],
Derivative[y][t] == (1 - y[t] - 0.8*x[t])*y[t], x == a,
y == b}, {x, y},
{t, 0, 10}]]]

In:=
pl[x_, y_] := ParametricPlot[Evaluate[Through[g[x, y][t]]], {t, 0, 10},
DisplayFunction -> Identity]

In:=
flowLines = Table[pl[x, y], {x, 0, 1, 0.1}, {y, 0, 1, 0.1}];

In:=
Show[flowLines, DisplayFunction -> \$DisplayFunction];

You might also wish to see some arrows to make the directions of the
flows more clear. Too many arrows tend to make a picture messy (unless
one takes a lot of care to get their proportions right, for which I do
not have time), so here are just a few:

In:=
<< "Graphics`Arrow`"

In:=
vectors[x_, y_] := Graphics[Table[Arrow[Through[g[x, y][t]],
Through[g[x, y][t]] +
(D[Through[g[x, y][s]], s] /. s -> t)/3], {t, 0, 10}]]

In:=
vectorField = Table[vectors[x, y], {x, 0, 1, 0.2}, {y, 0, 1, 0.2}];

In:=
Show[vectorField, DisplayFunction -> \$DisplayFunction];

Andrzej Kozlowski
Toyama International University
JAPAN
http://platon.c.u-tokyo.ac.jp/andrzej/

On Wednesday, January 2, 2002, at 05:28  PM, Khaled Saad wrote:

> Dear mathgroup
> I am trayin to plot the directin of vector field of system of ordinary
> differential equation but i could not
>
> the system is
> x'[t]=(1-x[t]-0.5 y[t])x[t]
> y'[t]=(1-y[t]-0.8 x[t])y[t]
>
> With best regards
> Khaled
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
>
>

```

• Prev by Date: Re: Solutions that are not solutions
• Next by Date: Re: ORDINARY DIFFERENTIAL EQUATION
• Previous by thread: Re: ORDINARY DIFFERENTIAL EQUATION
• Next by thread: Re: ORDINARY DIFFERENTIAL EQUATION