In: Advanced Math
Differential Equations with Matlab 3rd Edition Matlab Problem Set F Number 8:
Consider the predator-prey model dx/dt = x(4-3y) dy/dt = y(x-2) in which x >= 0 represents the population of the prey and y >= 0 represents the population of the predators.
a) Find all critical points of the system. At each critical point, calculate the corresponding linear system and find the eigenvalues of the coefficient matrix; then identify the type and stability of the critical point.
b) Plot the vector field on a region small enough to distinguish the critical points but large enough to judge the possible solution behaviors away from the critical points.
c) Use several initial data points (x0, y0) in the first quadrant to draw a phase portrait for the system. Identify the direction of increasing t on the trajectories you obtain. Use the information from parts (a) and (b) to choose a representative sample of initial conditions. Then combine the vector field and phase portrait on a single graph.
d) Explain from your phase portrait how the populations vary over time for initial data close to the unique critical point inside the first quadrant. What happens for initial data far from this critical point?
e) Suppose the initial state of the population is given by x(0) = 1, y(0) = 1 Find the state of the population at t = 1, 2, 3, 4, 5. f) Estimate to two decimal places the period of the solution curve that starts at (1, 1)
Given model is
Now for critical Points, we have to solve
That is, we need to solve
Thus critical points are
Now the Jacobian Matrix is
At point A(0,0) the Linearlized System Matrix is
Clearly the eigen values of A are 4 and -2. Two eigen values are real with opposite sign. So (0,0) is an saddle point and the system is unstable.
Now at point the Linearlized System Matrix is
Clearly the eigen values of B are . Two eigen values are complex with real part is zero. So the point (2,4/3) is center and the system is stable.
For the remainig part of the answer follow the below matlab code.
% set up the function
f = @( t , x ) [ 4∗ x ( 1 ) − 3∗x ( 1 ) .∗ x ( 2 ) ;−2∗x ( 2 )+x ( 1 ) .∗ x ( 2 ) ] ;
% Set final time
T = 1.5 ;
% stepsize
h =.1;
% Pick x0
x0 = [ 0.2 ; 8 ] ;
% Setup the number of steps
N = ceil (T/h ) ;
% Find RK4 approximate of the solution
[ ht , r k ] = FixedRK ( f , 0 , x0 , h , 4 ,N) ;
% set up X and Y
X = rk ( 1 , : ) ;
Y = rk ( 2 , : ) ;
% get x1 and x2 from our bounding box argumen t
% using min and max o f X
x1 = min (X)
x2 = max (X) ;
% get y1 and y2 f rom our bounding box argumen t
% using min and max o f Y
y1 = min (Y);
y2 = max (Y) ;
% plot x1
plot( [ x1 x1 ] , [ y1 y2 ] , ’ −b ’ ) ;
% plot x2
plot ( [ x2 x2 ] , [ y1 y2 ] , ’ −g ’ ) ;
% plot y1
plot ( [ x1 x2 ] , [ y1 y1 ] , ’ − r ’ ) ;
%plot y2
plot ( [ x1 x2 ] , [ y2 y2 ] , ’ −m’ ) ;
% plot Y vs X
plot (X , Y, ’−k ’ ) ;
% set legend
legend ( ’ x1 ’ , ’ x2 ’ , ’ y1 ’ , ’ y2 ’ , ’ y v s x ’ , ’ L o c a t i o n ’ , ’ Best ’ ) ;
hold off;