Solve first ode using ode45
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello, my question is i have first ode dT/dt = -0.0004*[T(t) - 5], may i know how to use ode45 to solve t in the range T [8 88]? Can i know how about the script? Thank you for your help.
댓글 수: 0
답변 (2개)
Walter Roberson
2021년 6월 9일
format long g
syms T(t) T8
dTdt = diff(T(t),t)
eqn = dTdt == -0.0004*(T - 5)
init = T(8) == T8
sol = simplify(dsolve([eqn, init]))
Specific_T8 = 6
Tsol = subs(sol, T8, Specific_T8)
fplot(Tsol, [8 88])
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!