Equations:
df/dt= 4f(t) – 3f(t)p(t)
dp/dt= -2p(t) + f(t)p(t)
Question: For the solution curve that starts at (1,1), how many units of time does it take before the curve returns to (1,1)? Try to get it within two decimal places. Repeat for the curve that starts at (0.5,0.5).
Here is the code that creates the solution curve:
gh = @(t,x) [4*x(1) - 3*x(1).*x(2); -2*x(2) + x(1).*x(2)];tspan = linspace(0, 5, 250);figure; hold onfor c = 0:0.1:5 [t,x] = ode45(gh, tspan, [c; c]); plot(x(:,1), x(:,2))endaxis tight
I was told there is a way to use ode45 to find how many units of time, but I am not sure how?
Best Answer