Solving and plotting solution of 3rd order ODE using ODE45

3 次查看(过去 30 天)
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!!

回答(1 个)

Star Strider
Star Strider 2021-12-5
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.
.

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by