How can I solve for coupled differential equations?

How can I solve for the 's in the system of differential equations?
I have:
m1 = 12; m2 = 24; K1 = 6000; K2 = 3450; B1 = 40; B2 = 28; F = 5;
My equations are:

回答 (2 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019 年 5 月 31 日
編集済み: Sulaymon Eshkabilov 2019 年 5 月 31 日

1 投票

if FREQ = 0 ... 1000 Hz. Then you will have 1001 solutions with a freq step of 1 Hz.
e.g.
f = 0:1000;
F = 5* 5 * (1i * 2 * pi * f);
for ii =1:numel(F)
ICs = [0; 0; 0; 0]; % Initial Conditions
ODE=@(t,x)([x(2); (1/m1)*(F(ii)-B1*x(2)+B1*x(4)+K1*x(3)); x(4);...
(1/m2)*(-(B1+B2)*x(4)+B1*x(2)-(K1+K2)*x(3)+K1*x(1))]);
[t, x]=ode45(ODE, ts, ICs, []);
plot(t, x(:,1), 'b', t, x(:,2), 'r', t, x(:,3), 'g', t, x(:,4), 'k'), hold on
end
Good luck
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019 年 5 月 16 日

0 投票

Hi Brandon,
An easy and fast way of solving this coupled system is to use ODEx (ode23, ode45, ode113, etc) solvers. Here is one of the quick solution scripts:
m1 = 12; m2 = 24; K1 = 6000; K2 = 3450; B1 = 40; B2 = 28; F = 5;
ODE=@(t,x)([x(2); (1/m1)*(F-B1*x(2)+B1*x(4)+K1*x(3)); x(4);...
(1/m2)*(-(B1+B2)*x(4)+B1*x(2)-(K1+K2)*x(3)+K1*x(1))]);
ts = [0, 1]; % Time space
ICs = [0; 0; 0; 0]; % Initial Conditions
[t, x]=ode45(ODE, ts, ICs, []);
plot(t, x(:,1), 'b', t, x(:,2), 'r', t, x(:,3), 'g', t, x(:,4), 'k')

5 件のコメント

onamaewa
onamaewa 2019 年 5 月 31 日
I see this uses time as initial conditions. Is there a way to use frequency as initial conditions?
I.E. From 0 Hz to 1000 Hz?
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019 年 5 月 31 日
Can you be a little bit more explicit on your question?
onamaewa
onamaewa 2019 年 5 月 31 日
How so? What information are you missing?
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019 年 5 月 31 日
You said frequency 0 .. 1000 Hz that is for your external excitation force F? Let's say F = 10sin(f*t), where f is your frequency. Is that what you mean or what? ... Math is needed.
onamaewa
onamaewa 2019 年 5 月 31 日
編集済み: onamaewa 2019 年 5 月 31 日
Sorry, I forgot to add that: F = 5 * (1i * 2 * pi * FREQ)

この質問は閉じられています。

質問済み:

2019 年 5 月 16 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by