Plotting system of differential equations

23 visualizaciones (últimos 30 días)
Sajith Dharmasena
Sajith Dharmasena el 24 de Mzo. de 2015
Comentada: Star Strider el 24 de Mzo. de 2015
Hi,
does anybody know the code to plot a system of differential equations? For example say,
x1(dot) = -x2 + (x1)^2 -(x1*x2)
x2(dot) = x1 + (x1*x2)
Thanks in advance! :)
Sajith.

Respuesta aceptada

Star Strider
Star Strider el 24 de Mzo. de 2015
Yes.
Use ode45 to integrate your equations, then plot the solution.
Give it a go. It should be very easy for you to cast your system of equations as an Anonymous Function. If you have problems with your code, we can help you get it running.
  5 comentarios
Sajith Dharmasena
Sajith Dharmasena el 24 de Mzo. de 2015
How do you plot x1 vs x2? (phase plane)
Star Strider
Star Strider el 24 de Mzo. de 2015
You plot just that:
plot(x(:,1), x(:,2))

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by