Multi-mass, damper, spring system in matlab
2 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
回答 (1 件)
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:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Numerical Integration and Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!