Multi-mass, damper, spring system in matlab

2 ビュー (過去 30 日間)
Kay
Kay 2017 年 4 月 13 日
回答済み: Sam McDonald 2017 年 4 月 19 日
I am looking to solve a multi-mass, damper, and spring system in matlab.
Eq1 = mx1'' + 2cx1' + -cx2' + 3kx1 - kx2 = 0 Eq2 = mx2'' - cx1' + 3x2' - kx1 + 2kx2 = 0
x1(0)=0; x2(0)=0.3; x1'(0)=-0.1,x2'(0)=0
How do I solve for the equations of motion (x1 and x2) in matlab? I believe I should be using ode45, but am not sure how.

回答 (1 件)

Sam McDonald
Sam McDonald 2017 年 4 月 19 日
A solver like "ode45" would be the correct choice for a problem like this. It takes a function handle as its first argument of the form y' = f(t,y). You will need to convert your equations to this form, where x1 and x2 are two of the four states in y. Your function will return y', which are the derivatives of the states, expressed in terms of the other states.
Looking at the ode45 examples is a good place to start:

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by