Borrar filtros
Borrar filtros

Solving and plotting solution of 3rd order ODE using ODE45

3 visualizaciones (últimos 30 días)
Ryan Rhoades
Ryan Rhoades el 5 de Dic. de 2021
Respondida: Star Strider el 5 de Dic. de 2021
I am trying to plot y as a function of x where xspan is [0 1] for the equation below. I prefer using ode45 but cannot get a plot to look as it should.
(eps*y''') - (2*y') = 4 w/ initial conditions y(0) = 0, y'(0) = 0, and y(1) = 4
Please help write code to set up and run ode45 to get a solution y(x) from x=0 to x=1.
Thanks!!

Respuestas (1)

Star Strider
Star Strider el 5 de Dic. de 2021
If the Symbollic Math Toolbox is available, use the odeToVectorField function to create the appropriate array, then use matlabFunction to transform it into an anonymous function that ode45 and the rest can use.
It may take a bit of experimenting to get it to work correctly (hint: the Vars argument is quite helpful here) however it should be straightforward.
.

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by