How to obtain General Solution of Homogenous ODE; (D^2) - (A^2) = 0 in terms of sin & cos
1 回表示 (過去 30 日間)
古いコメントを表示
clc;
clear all;
close all;
syms y(x)
O1 = diff(y,x,2) + 600*x == 0;
dsolve(O1)
I'm trying this approach but I need output in sin & cos function. Like, as per the equation of motion solution for the same equation, it gives solution as: C1.cos(A.x) + C2.sin(A.x)
2 件のコメント
Walter Roberson
2024 年 2 月 26 日
syms C1 C2 A x
eqn = C1*cos(A*x) + C2*sin(A*x)
O1 = diff(eqn, x, 2) + 600 * x
solve(O1 == 0, x)
There is no way that eqn is a solution to that differential equation -- not unless A is 0 or C1 and C2 are 0 (and x is 0)
Torsten
2024 年 2 月 26 日
Maybe you mean
syms y(x)
O1 = diff(y,x,2) + 600*y == 0;
dsolve(O1)
?
回答 (1 件)
Saurav
2024 年 3 月 7 日
Hello Parvesh,
I understand that you would like the outcome to be expressed in terms of ‘Sine’ and ‘Cos’ after solving a system of differential equation.
I assume that the differential equation you want to solve resembles the standard differential equation of motion given as:-
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1637041/image.png)
Instead of reading "
" the code needs to be changed to read "
" where
. This should solve the equation using the “dsolve” function and provide the output in terms of 'sine' and 'cos'.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1637046/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1637051/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1637056/image.png)
This is a workaround that can be used:
clc;
clear all;
close all;
syms y(x) x
O1 = diff(y,x,2) + 600*y == 0;
dsolve(O1)
I hope this helps!
0 件のコメント
参考
カテゴリ
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!