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๐Ÿ˜…

 ์ฑ„ํƒ๋œ ๋‹ต๋ณ€

Torsten
Torsten 2023๋…„ 1์›” 4์ผ
ํŽธ์ง‘: Torsten 2023๋…„ 1์›” 4์ผ

1 ๊ฐœ ์ถ”์ฒœ

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)
varย =ย 
eqn_alg = subs(ysol,var(1),0)-1==0
eqn_alg(t)ย =ย 
C1 = solve(eqn_alg,var(2));
ysol = subs(ysol,var(2),C1)
ysol(t)ย =ย 

๋Œ“๊ธ€ ์ˆ˜: 3

Karl-JR
Karl-JR 2023๋…„ 1์›” 4์ผ
first off thank you. just a small question. So if i solve it simbolically, the c in differential equation 2nd order has to be defined. Did i get that right?
Torsten
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).
Karl-JR
Karl-JR 2023๋…„ 1์›” 4์ผ
Thank you so much

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

์ถ”๊ฐ€ ๋‹ต๋ณ€ (0๊ฐœ)

์นดํ…Œ๊ณ ๋ฆฌ

๋„์›€๋ง ์„ผํ„ฐ ๋ฐ File Exchange์—์„œ Ordinary Differential Equations์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

์งˆ๋ฌธ:

2023๋…„ 1์›” 4์ผ

๋Œ“๊ธ€:

2023๋…„ 1์›” 4์ผ

Community Treasure Hunt

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

Start Hunting!

Translated by