How do i solve differential equation 2nd oder simbolically and numerically?
5 次查看(过去 30 天)
显示 更早的评论
Hello everyone i am completly new to Matlab and I have a problem with an exercise in my practice book. I have this differential equation:

y(0) = 1
and i want to solve it simbolically and numerically in matlab.
so first i have to change it in first order differential equation:
But how do i continue? I´m trying for hours at this point😅
0 个评论
采纳的回答
Torsten
2023-1-4
编辑:Torsten
2023-1-4
syms t y(t) sigma(t)
eqn_diff = diff(y,t,2)+3*diff(y,t)+y(t)-2*sigma(t)==0;
ysol(t) = dsolve(eqn_diff);
var = symvar(ysol)
eqn_alg = subs(ysol,var(1),0)-1==0
C1 = solve(eqn_alg,var(2));
ysol = subs(ysol,var(2),C1)
3 个评论
Torsten
2023-1-4
编辑:Torsten
2023-1-4
You specified one initial condition for a second-order ODE (y(0)=1). So one free parameter (in this case C1) can be eliminated from the two degrees of freedom (C1 and C2) for y. If you impose a second condition on y, you can get a unique solution (means: you can also eliminate C2).
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


