필터 지우기
필터 지우기

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 CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by