System of differential equations

How can I solve the system: x1'(t)=x1-x1^3+x2, x1(0)=X1_0 x2'(t)=3*x1-x2 , x2(0)=x2_0 ?

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 21 de Mayo de 2013
Main program
y0=[0 1];
tspan=[0 10];
[t,y]=ode45(@myeq,tspan,y0)
save this function as myeq.m
function dx=myeq(t,x)
dx=zeros(2,1);
dx(1)=x(1)-x(1)^3+x(2);
dx(2)=3*x(1)-x(2) ;

Más respuestas (0)

Categorías

Más información sobre Numerical Integration and Differential Equations en Centro de ayuda y File Exchange.

Preguntada:

AAA
el 21 de Mayo de 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by