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!




