Solving and plotting solution of 3rd order ODE using ODE45
3 views (last 30 days)
Show older comments
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!!
0 Comments
Answers (1)
Star Strider
on 5 Dec 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.
.
0 Comments
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!