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!




