필터 지우기
필터 지우기

Solving and plotting solution of 3rd order ODE using ODE45

조회 수: 3 (최근 30일)
Ryan Rhoades
Ryan Rhoades 2021년 12월 5일
답변: Star Strider 2021년 12월 5일
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