Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MEEN 221 Numerical Methods 1. A well-known coupled set of dimensionless differen

ID: 2073710 • Letter: M

Question

MEEN 221 Numerical Methods 1. A well-known coupled set of dimensionless differential equations (Lotka-Volterra equations) can be used to predict the population of predators and preys in a jungle These equations are given below: where x and y are the number of predators and preys respectively; and p, q, r and s are constants whose values can be taken as: p-1 ; q r $ 0.1 Use Euler forward method to solve the pair of ordinary differential equations (equations 1 and 2) for x and y from t-0 to t = 10. Use a step size of1-001 . Solve by MATLAB or EXCEL. Deliverables: 1. Method. Derive the discretized equations for equations 1 and 2 using Euler forward 2. Compute the solution for the first 20 time indices and complete the table below Index for time, i 0 20 3. Determine the solution for the time range t-0 to t-10 (time indices 0 to 100). Considering this time range:(i Plot both x and y versus time on the same plot, and on a second plot (ii) Plot y versus x. 4. From your plot in 3(i), at what time does the number of preys become the same as the number of predators? Note: If you solve by MATLAB, you must include your MATLAB script to the deliverables.

Explanation / Answer

mu = [300 200]'
eta = [400 100]'
signs = [1 -1]'
pred_prey_ode = @(t,y) signs.*(1-flipud(y./mu)).*y
period = 6.5357
ode45(pred_prey_ode,[0 3*period],eta)

%% Exponential and Logistic Growth.
close all
figure
k = 1
eta = 1
mu = 20
t = 0:1/32:8;
y = mu*eta*exp(k*t)./(eta*exp(k*t) + mu - eta);
plot(t,[y; exp(t)])
axis([0 8 0 22])
title('Exponential and logistic growth')
xlabel('t')
ylabel('y')
%% ODE45 for the Logistic Model.

eta = 1
mu = 20
ydot = @(t,y) k*(1-y/mu)*y
ode45(ydot,[0 8],eta)
%% ODE45 for the Predator-Prey Model.
figure
mu = [300 200]'
eta = [400 100]'
signs = [1 -1]'
pred_prey_ode = @(t,y) signs.*(1-flipud(y./mu)).*y
period = 6.5357
ode45(pred_prey_ode,[0 3*period],eta)
%% Our predprey gui.