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에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!