フィルターのクリア

How can I solve this matrix for y?

1 回表示 (過去 30 日間)
Keith Grey
Keith Grey 2020 年 6 月 15 日
編集済み: Keith Grey 2020 年 6 月 15 日
M = [1 0 0 0; 0 1 0 0; 0 0 20 0; 0 0 0 10]; % Mass matrix
y = [x1; x2; v1; v2]; % Displacement & Velocity Matrix
B = [0 0 -1 0; 0 0 0 -1; -2 2 -2 2; 1 -1 1 -1]; % Spring Matrix
C = [0; 0; 0; -1]; % Force Matrix
I'm following an example:
At the bottom of the page, Frequency vs Amplitude is achieved. That's what I'm trying to do.

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 6 月 15 日
See ode45()
tspan = [0; 10];
IC = [1 1 0 0]; % initial condition
[t, Y] = ode45(@odeFun, tspan, IC);
plot(t, Y);
legend({'x_1', 'x_2', 'v_1', 'v_2'});
function dYdt = odeFun(t, Y)
M = [1 0 0 0; 0 1 0 0; 0 0 20 0; 0 0 0 10]; % Mass matrix
B = [0 0 -1 0; 0 0 0 -1; -2 2 -2 2; 1 -1 1 -1]; % Spring Matrix
C = [0; 0; 0; -1]; % Force Matrix
dYdt = M\(C - B*Y);
end
  1 件のコメント
Keith Grey
Keith Grey 2020 年 6 月 15 日
I'm following an example:
At the bottom of the page, Frquency vs Amplitude is achieved. That's what I'm trying to do.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by