solve the mass spring system where the mass matrix depends explicitly on time

5 ビュー (過去 30 日間)
nado
nado 2023 年 4 月 12 日
コメント済み: nado 2023 年 4 月 28 日
Hello everyone,
I was wondering how to solve a system of two ODEs where the mass matrix is time dependent. The system of differential equation is in the following form:
[M]*X_double_dot +K*X=0;
where K=[2 1;5 8] and [M]=[t 0; 0 t], t is the time.
My question is : is it possible to solve this kind of ODEs with ode functions (ode45, ode15s,...) or one should evaluate the mass matrix at each time step ?
Best Regards,
Nado
  1 件のコメント
Sam Chak
Sam Chak 2023 年 4 月 12 日
Yes, possible. The total rocket mass also decreases as the acceleration of the rocket increases due to fuel mass burns away.

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

採用された回答

Torsten
Torsten 2023 年 4 月 12 日
Setting y1' = y3 and y2' = y4, you arrive at the following code:
M = @(t) [t 0; 0 t];
K = [2 1;5 8];
MM = @(t)[eye(2),zeros(2);zeros(2),M(t)];
KK = [zeros(2),-eye(2);K,zeros(2)];
fun = @(t,y) -KK*y;
options = odeset('Mass',MM,'MStateDependence','none');
y0 = [0 0 1 1];
[T,Y] = ode45(fun,[0 1],y0);
plot(T,Y)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by