Objectives: Solve a system of ODEs using built-in Matlab functions like ode45(). You must be able to setup the inputs properly by hand or in Matlab. The Lotka-Volterra predator-prey model uses first-order differential equations to estimate the populations of two interacting species, p₁ and p2- dpi dt dp2 dt = a*pi-ß* P1 * P2 Script = 8 * P1 * P2-Y * P2 where a is the prey's growth rate, ß is the prey's death rate, & is the predator's growth rate and y is the predator's death rate. We want to model the population of snow hares (pi) and Canadian lynxes (p2). Assume: ▪ the population at t=0 is 100 hares and 5 lynxes ▪ all rates are constant ▪ no other factors influence population size Your final script should: 1. implement the predator-prey model with a = 0.48, ß= 0.025, y = 0.68 and 8 = 0.02. 2. solve the system of differential equations at all timepoints in tYears = 0:0.25:100 using ode45 and the initial populations provided in po 3. assign the resulting population estimates to a 2-column matrix named ppPop. Prey should be in the first column and predator in the second Make sure you supply a time vector instead of a time span to the solver ensures the solutions are evaluated at the same time points for the grader tool. 1 pe = [100 5]; % population of snow hares, lynxes at t=0 2 tYears = 0:0.25:100; % discrete time interval, in years 4% Add your code below 6 % Model parameters (can be moved to where needed in your script) 7 a = 0.48; % prey's growth rate 8 b = 0.025; % prey's death rate 9 c = 0.68; % predator's death rate 10 d = 0.02; % predator's growth rate 11

Elements Of Electromagnetics
7th Edition
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Sadiku, Matthew N. O.
ChapterMA: Math Assessment
Section: Chapter Questions
Problem 1.1MA
icon
Related questions
Question

6.1
Complete the code please.

Objectives: Solve a system of ODEs using built-in Matlab functions like ode45(). You must be able to setup the inputs properly by hand or in Matlab.
The Lotka-Volterra predator-prey model uses first-order differential equations to estimate the populations of two interacting species, p₁ and p2-
dpi
dt
dp2
dt
= a*pi-ß* P1 * P2
Script
= 8 * P1 * P2-Y * P2
where a is the prey's growth rate, ß is the prey's death rate, & is the predator's growth rate and y is the predator's death rate.
We want to model the population of snow hares (pi) and Canadian lynxes (p2).
Assume:
▪ the population at t=0 is 100 hares and 5 lynxes
▪ all rates are constant
▪ no other factors influence population size
Your final script should:
1. implement the predator-prey model with a = 0.48, ß= 0.025, y = 0.68 and 8 = 0.02.
2. solve the system of differential equations at all timepoints in tYears = 0:0.25:100 using ode45 and the initial populations provided in po
3. assign the resulting population estimates to a 2-column matrix named ppPop. Prey should be in the first column and predator in the second
Make sure you supply a time vector instead of a time span to the solver ensures the solutions are evaluated at the same time points for the grader tool.
1 pe = [100 5]; % population of snow hares, lynxes at t=0
2 tYears = 0:0.25:100; % discrete time interval, in years
4% Add your code below
6 % Model parameters (can be moved to where needed in your script)
7 a = 0.48; % prey's growth rate
8 b = 0.025; % prey's death rate
9 c = 0.68; % predator's death rate
10 d = 0.02; % predator's growth rate
11
Transcribed Image Text:Objectives: Solve a system of ODEs using built-in Matlab functions like ode45(). You must be able to setup the inputs properly by hand or in Matlab. The Lotka-Volterra predator-prey model uses first-order differential equations to estimate the populations of two interacting species, p₁ and p2- dpi dt dp2 dt = a*pi-ß* P1 * P2 Script = 8 * P1 * P2-Y * P2 where a is the prey's growth rate, ß is the prey's death rate, & is the predator's growth rate and y is the predator's death rate. We want to model the population of snow hares (pi) and Canadian lynxes (p2). Assume: ▪ the population at t=0 is 100 hares and 5 lynxes ▪ all rates are constant ▪ no other factors influence population size Your final script should: 1. implement the predator-prey model with a = 0.48, ß= 0.025, y = 0.68 and 8 = 0.02. 2. solve the system of differential equations at all timepoints in tYears = 0:0.25:100 using ode45 and the initial populations provided in po 3. assign the resulting population estimates to a 2-column matrix named ppPop. Prey should be in the first column and predator in the second Make sure you supply a time vector instead of a time span to the solver ensures the solutions are evaluated at the same time points for the grader tool. 1 pe = [100 5]; % population of snow hares, lynxes at t=0 2 tYears = 0:0.25:100; % discrete time interval, in years 4% Add your code below 6 % Model parameters (can be moved to where needed in your script) 7 a = 0.48; % prey's growth rate 8 b = 0.025; % prey's death rate 9 c = 0.68; % predator's death rate 10 d = 0.02; % predator's growth rate 11
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 1 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Elements Of Electromagnetics
Elements Of Electromagnetics
Mechanical Engineering
ISBN:
9780190698614
Author:
Sadiku, Matthew N. O.
Publisher:
Oxford University Press
Mechanics of Materials (10th Edition)
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:
9780134319650
Author:
Russell C. Hibbeler
Publisher:
PEARSON
Thermodynamics: An Engineering Approach
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:
9781259822674
Author:
Yunus A. Cengel Dr., Michael A. Boles
Publisher:
McGraw-Hill Education
Control Systems Engineering
Control Systems Engineering
Mechanical Engineering
ISBN:
9781118170519
Author:
Norman S. Nise
Publisher:
WILEY
Mechanics of Materials (MindTap Course List)
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:
9781337093347
Author:
Barry J. Goodno, James M. Gere
Publisher:
Cengage Learning
Engineering Mechanics: Statics
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:
9781118807330
Author:
James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:
WILEY