Differential equations using ODE45
    12 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Star1202
 il 15 Ott 2020
  
    
    
    
    
    Commentato: Md Muzakkir Quamar
 il 15 Ott 2020
            please help me in solving this question..
Q. solve:
dy1/dt = y2 
dy2/dt = 1000*y2*(1-y1^2)-y1
given initial conditions : y1(0) = 0 and y2(0) = 1. 
0 Commenti
Risposta accettata
Più risposte (1)
  Md Muzakkir Quamar
 il 15 Ott 2020
        tspan = [0 20];
Y_int=[0 1];
[t,x] = ode45(@odefcn,tspan,Y_int,[],a, b, c, u);
figure(1)
plot(t,y(:,1),'r',t,y(:,2),'b')
function dydt = odefcn(t,y)
dydt = zeros(2,1);
dydt(1) = y(2);
dydt(2) = 1000*y(2)*(1-y(1)^2)-y(1);
end
2 Commenti
  Steven Lord
    
      
 il 15 Ott 2020
				Please don't post the full answers to questions that sound like homework assignments, particularly if the poster has not shown what they've tried first.
Vedere anche
Categorie
				Scopri di più su Ordinary Differential Equations in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!