Borrar filtros
Borrar filtros

Help me solve this second order ODE dx1=x1+2*x2 dx2=sat(x1)+x2

1 visualización (últimos 30 días)
manvi agarwal
manvi agarwal el 10 de Sept. de 2019
Comentada: manvi agarwal el 10 de Sept. de 2019
kindly attach the code
  2 comentarios
darova
darova el 10 de Sept. de 2019
Maybe you have some attempts? What did you try?
manvi agarwal
manvi agarwal el 10 de Sept. de 2019
function bc()
tspan=[0 10];
IC=[1 1];
[T,X] = ode45(@(t,x) eq1(t,x),tspan,IC);
plot(T,X(:,2))
hold
plot(T,X(:,1))
end
function dx=eq1(t,x)
dx=zeros(2,1);
k=x(2);
sat=@(k) min(max(k,-1),1)
x(2)=k;
dx(1)=x(1)-x(2)
dx(2)=-x(1)-2*x(2)+1
end

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Productos


Versión

R12.1

Community Treasure Hunt

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

Start Hunting!

Translated by