Lotka-volterra with ode45
    3 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    Sam
 am 21 Dez. 2017
  
    
    
    
    
    Beantwortet: James Tursa
      
      
 am 21 Dez. 2017
            I have the following system of differential equations:
P' = P − 0.05PR
R' = −0.5R + 0.02PR
My function is the following one:
function xdot = Lotka(t,x)
xdot = [x(1) - 0.05*x(1)*x(2); -0.5*x(2)-0.02*x(1)*x(2)];
To find the solution i use ode45:
[t,x] = ode45(@Lotka, [0 20],[10 10]);
plot(t,x(:,1));
hold on
plot(t,x(:,2));
But Matlab is still running... No error is given... It just keeps running. What went wrong?
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

