Plot 3rd differential equation

조회 수: 3 (최근 30일)
RazvanA
RazvanA 2022년 1월 16일
댓글: Star Strider 2022년 1월 16일
Hello everyone, I could use a little help with plotting a 3rd differential equation usind "eqn" and "dsolve" syntax.
Here is my equation:
y''' - 3y' + 2y = x^2*e^x

답변 (2개)

Star Strider
Star Strider 2022년 1월 16일
The documentation section on dsolve and Solve Differential Equation describes it better than I can!
(It will be necessary to determine if the left-hand-side are in terms of or .)
  댓글 수: 2
RazvanA
RazvanA 2022년 1월 16일
Sorry, forgot to mention it is y(t).
Star Strider
Star Strider 2022년 1월 16일
Thank you. That’s what I thought, since the Newton ‘prime’ notation implies derivatives of time.
It would also be nice to know if ‘x’ is a function of time (or anything else) or is simply a value. If it is a funciton of time, integrating the differential equation symbolically may not be possible (at least in a closed form, since the RHS would have to be integrated separately, then substituted back into the integrated LHS). That would slightly complicate things.
With what I currently know about this, it can just be plugged into the demonstration code I cited to in my original Answer to produce —
syms x y(t) t y0 D1y0 D2y0
sympref('AbbreviateOutput',false);
D1y = diff(y);
D2y = diff(D1y);
D3y = diff(D2y);
Eqn = D3y - 3*D1y + 2*y == x^2*exp(x)
ics = [y(0) == y0, D1y(0) == D1y0, D2y(0) == D2y0]; % Initial Conditions
Sy = dsolve(Eqn, ics);
Sy = simplify(Sy, 500)
Use the fplot function to do the actual plotting.
I leave the rest to you.
.

댓글을 달려면 로그인하십시오.


Friedel Hartmann
Friedel Hartmann 2022년 1월 16일
syms x y(x)
D1y = diff(y,1)
D3y = diff(y,3)
dsolve(D3y - 3*D1y + 2*y == x^2 * exp(x),x)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by