Effacer les filtres
Effacer les filtres

Solving and plotting solution of 3rd order ODE using ODE45

1 vue (au cours des 30 derniers jours)
Ryan Rhoades
Ryan Rhoades le 5 Déc 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!!

Réponses (1)

Star Strider
Star Strider le 5 Déc 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.
.

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by