フィルターのクリア

How to print the solution of ODE solved by using dsolve along with a plot.

3 ビュー (過去 30 日間)
Madhav
Madhav 2022 年 9 月 8 日
編集済み: Torsten 2022 年 9 月 8 日
Use "subs" to substitute values for c,m,k,x0 and v0. Then you will be able to plot.
If you have problems, consult the dsolve documentation.
syms x(t) c m k x0 v0
Dx = diff(x);
ode = diff(x,t,2) == (-c/m)*diff(x,t)+(-k/m)*x;
initialcond1 = x(0) == x0;
initialcond2 = Dx(0) == v0;
conditions = [initialcond1 initialcond2];
xSol(t) = dsolve(ode,conditions);
xSol = simplify(xSol)
xSol(t) = 

回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by