Please help me solve this differential equation
古いコメントを表示
please i will like to solve this eqution for w=188 rad/s Please take a2=3 a3=2, b2=5 and b3=2
3 件のコメント
Solve for x_double_dot, then substitute x = y1, x_dot = y2 and write your equation as a system of two first-order differential equations:
y1' = y2
y2' = x_double_dot = ...
Finally, use ODE45 to solve.
John D'Errico
2022 年 7 月 18 日
You tell us what the value of w is, but not all of the other important parameters. They are just as important. Thus what are a2, a3, b2 b3? If you don't have them, then no numerical solution will be possible. My expectation is no analytical solution will exist in any case, so a numerical solution is your only option.
Armel Kapso
2022 年 7 月 19 日
採用された回答
その他の回答 (1 件)
opts = odeset('RelTol', 1e-2, 'AbsTol', 1e-4);
[t, x] = ode45(@diffeqn, [0 1], [0.1; .1], opts);
whos
plot(t, x(:,2))
function dxdt = diffeqn(t, x)
a2=3; a3=2; b2=5; b3=2; w=188;
% Check this out
dxdt(1, 1) = x(2);
dxdt(2, 1) = ( (2*a3*w^3*sin(x(2)-w*t))*x(1) + ...
(2*a3*w*sin(x(2)-w*t))*x(1).^3 + ...
(-b2*sin(w*t) - b3*sin(x(2))) ) ./ ...
( 2*a2 -2*a3*w*(2*x(1)+w)*cos(x(2)-w*t) );
end
6 件のコメント
Armel Kapso
2022 年 7 月 19 日
Armel Kapso
2022 年 7 月 19 日
Chunru
2022 年 7 月 19 日
Can you show what is the problem in 2018b, such as error message?
Chunru
2022 年 7 月 19 日
I did a correction in the code above.
Armel Kapso
2022 年 7 月 19 日
Chunru
2022 年 7 月 19 日
You need to save the code in a file, e.g., testdiff.m. Then run the program testdiff.m
カテゴリ
ヘルプ センター および File Exchange で Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




