this is my Matlab code for lemur and plant population simulation. But i didn't get the...

70.2K

Verified Solution

Question

Advance Math

this is my Matlab code for lemur and plant populationsimulation. But i didn't get the right graph.

R(1,1)=35; % Initial pop of males
R(2,1)=35; % Initial pop of females
P(3,1)=200000; % Iniitial pop of plants
r(1)=1.01; % Growth rate of male pop
r(2)=1.01; % Growth rate of female pop
r(3)=1.10; % Growth rate of plants
K(1)=800; % Carrying capacity for male pop
K(2)=600; % carrying capacity for female pop
K(3)=7500000; % carrying capacity for plants
  
E=65; % Plants per animal
A=150000; % Animal 'Plant needs'
NW=200; % Weeks for simulation
  
for m=2:NW
  
P(3,m)=(r(3)*P(3,m-1)*((K(3)-P(3,m-1))/K(3))) -(E*R(m));

R(m-1)=R(1,m-1)+ R(2,m-1);
  
R(1,m)=(r(1)*R(1,m-1)*(K(1)-R(1,m-1))*P(3,m-1))/(K(1)*A);
R(2,m)=(r(2)*R(2,m-1)*(K(2)-R(2,m-1))*P(3,m-1))/(K(2)*A);

end
  
subplot(1,2,1)
plot(1:NW,R(1,1:NW),1:NW,R(2,1:NW))
xlabel('Month')
ylabel('population')
legend('male','female')
  
subplot(1,2,2)
plot(1:NW,P(3,1:NW))
xlabel('Month')
ylabel('Plant population')
  
  

Answer & Explanation Solved by verified expert
4.1 Ratings (538 Votes)
i guessed there are two problems with this code i There is direct assignment to the third row of P matrix The first two rows of P matrix are zeros So there is no need of the first two rows Instead of P3m you can use    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students