**Unformatted text preview:**

2R 1 2RF dR dt dF dt F 0 9 RF MATH 282 MATLAB Assignment 5 Vector Fields Once again consider the predator prey system If we let P t R t F t then the system can be written in the form 2 R 1 2 RF F 0 9 RF For each point R F in the RF plane we assign a vector whose components are given by 2 R 1 2 RF F 0 9 RF The assignment R F 2R 1 2RF F 0 9RF is an example of a vector field We visualize this vector field as a set of arrows based at points in the RF plane As an example let us draw some selected vectors dP dt The lengths of vectors are important however to avoid overlapping we often scale the vectors so they all have the same length the result is called a direction field The following few commands produce a vector field of the predator prey system We can get a better picture by selecting smaller vectors this can be done by scaling the vectors by a factor of 0 5 Now we plot the direction field together with the solution curve corresponding to the initial condition R 0 F 0 1 0 5 Exercise Convert the second order differential equation d2 x 3 x x3 0 into a first order system in terms of x and v where v dx dt a Find all equilibrium points b Use MATLAB to sketch the associated direction field Hint use meshgrid c The following script plots several solution curves over the interval 3 t 3 5 4 5 5 4 5 and axis tight d t 2 2 dx dt f t P P 2 3 P 1 P 1 3 2 P 2 a 2 0 2 2 b 2 0 2 2 for k 1 length a t Pap ode45 f 0 3 a k b k plot Pap 1 Pap 2 linewidth 2 hold on t Pap ode45 f 0 3 a k b k plot Pap 1 Pap 2 linewidth 2 end hold off axis 5 5 5 5 What are the initial conditions d Use the above script to plot a phase portrait together with the direction field of part c e Describe the behavior of the solutions

View Full Document