Question: Please use MATLAB to solve this problem. Case 3 Limit to rabbit population due to limited food supply in region. Effect is felt through rabbit



Please use MATLAB to solve this problem.
Case 3 Limit to rabbit population due to limited food supply in region. Effect is felt through rabbit growth rate dependent on r(t) and rMax. Governing Equations dr/dt = grr*r -(EFR*f)*r df/dt = GRF*f+(ERF*r)*f where grr = GRR*(1-r/rMax) . O . O O O O Inputs parameters= (GRR,EFR, GRF,EFR,rMax] GRR, growth rate of rabbits EFR, effect of foxes on rabbit increase O GRF, growth rate of foxes ERF, effect of rabbits on fox increase rMax, regional carrying capacity for rabbits initconds= [rinit, finit] rinit, initial rabbit population finit, initial fox population timedata= [tinit,tfinal,delt] tinit, time at the start of the model run tfinal, time at the end of the model run delt, the size of the time step in Euler's method O O . O O O Outputs rvec, rabbit history fvec, fox history . O Function Setup function (rvec,fvec]= [rvec,fvec]= PredatorPrey_3_fcn(parameters, initconds,timedata) % Your code here end Test Case 3 O solutions submitted (max: 4) Enter your function from Test Case 3 into the space below. Click the run button to test your code output using the provided script Click the submit button to have your work assessed. You have a 4 submission limit. Function C Reset MATLAB Documentation 1 function [rvec, fvec]=PredatorPrey_3_fcn (parameters, initconds, timedata) 2 % Copy and paste your code here 3 4 end Code to call your function C Reset 1 % Below is a script that will execute and plot your function for some given sample parameters. 2% Try adjusting the parameters to see if the model behaves as you would predict 3 rMax= 100; 4 GRR= 0.4; 5 EFR= 0.032; 6 GRF= -1.0; 7 ERF= 0.02; 8 tinit= 0.; 9 tfinal= 60.; 10 delt= 0.05; 11 12 rinit3= 30; 13 finit3= 20; 14 15 parameters3= [GRR, EFR, GRF, ERF, rMax]; 16 timedata3= [tinit, tfinal, delt]; 17 initconds 3= [rinit3, finit3]; 18 [rvec, fvec]= Predator Prey_3_fcn(parameters, initconds3, timedata3); 19 20 hold on 21 plot(rvec) 22 plot(fvec,'r') 23 xlabel('step #') 24 ylabel('population') 25 legend('rvec', 'fvec') 26 hold off
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
