Second order homogeneous differential equation

20 ビュー (過去 30 日間)
Matthew Jenkins
Matthew Jenkins 2011 年 1 月 20 日
移動済み: John D'Errico 2024 年 10 月 2 日
I am trying to figure out how to use MATLAB to solve second order homogeneous differential equation.
A0d2y/dt2 + A1dy/dt + A2y = 0
Here are a couple examples of problems I want to learn how to do.
d2y/dt2 - dy/dt -6y = 0
r1 = 3
r2 = -2
y = C1e3t + C2e-2t (general solution)
d2y/dt2 - 4dy/dt -21y = 0
where:
dy/dt = 0
and
y = 2 when t = 0.
y = 0.6*e^7*t + 1.4*e^-3*t (particular solution)
  2 件のコメント
Elaina
Elaina 2024 年 10 月 2 日
移動済み: John D'Errico 2024 年 10 月 2 日
Apparently the ability to use 'Dy' in a string is being removed.... Does anyone know how to do it now?
Torsten
Torsten 2024 年 10 月 2 日
移動済み: John D'Errico 2024 年 10 月 2 日
Apparently the ability to use 'Dy' in a string is being removed...
No.
dsolve('D2y - Dy - 6*y = 0')
Warning: Support for character vector or string inputs will be removed in a future release. Instead, use syms to declare variables and replace inputs such as dsolve('Dy = -3*y') with syms y(t); dsolve(diff(y,t) == -3*y).
But you should use
syms t y(t)
ode = diff(y,t,2)-diff(y,t)-6*y==0;
dsolve(ode)

サインインしてコメントする。

回答 (3 件)

Anish
Anish 2011 年 1 月 20 日
You can use the DSOLVE command in the Symbolic Math Toolbox:
>> dsolve('D2y - Dy - 6*y = 0')
ans =
C4*exp(3*t) + C5/exp(2*t)
Alternately, you can use the MuPAD interface in MATLAB (by executing "mupad" at the MATLAB Command Line) and use the "ode::solve" function there.
Note that you would need a license to the Symbolic Math Toolbox to be able to use this functionality.
For more help see:
If you want to solve these ODE's numerically, you can use the ODE suite in MATLAB. For more help, see:

mariam eltohamy
mariam eltohamy 2018 年 12 月 7 日
use this code Untitled.png

mariam eltohamy
mariam eltohamy 2018 年 12 月 7 日
cont.
Untitled2.png

カテゴリ

Help Center および File ExchangeNumeric Solvers についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by