solving Tuned Mass Damper using ODE45, need help putting in equation as parameter to solve
3 views (last 30 days)
Show older comments
For a tuned mass damper the equations are as follows:
In matrix form using the companion matrices and
=
*
+ F = 
initial condition given vector is

and the interval is

Given the values of the variables the Matrix becomes
=
*
+ 
I am told to make a matlab script to solve this numerically and so far i have:
m1 = 1;
m2 = 0.05;
k1 = 1;
k2 = 0;
b1 = 0.001;
b2 = 0;
om = 0.95;
%Numerically solve DE
x0 = [0;0;0;0];
tvec = linspace(0,7000,35000);
A = [ 0, 0, 1, 0;
0, 0, 0, 1;
-(k1+k2)/m1, k2/m1, -(b1+b2)/m1, b2/m1;
k2/m2,-k2/m2, b2/m2,-b2/m2;]
%Hint given to use to solve this:
[t,x] = ode45(@(t,x) ___ + [_;_;_;_],tvec,x0);
I see that in the hint an equation has to go in the red underline plus a column vector. I'm assuming that this column vector that goes affter the plus is
.
.After i put in the values of the variables in Matrix A and multiplied it by the column vector of [x1; x2; y1; y2;] i get:
and given the subsition i used of
0 Comments
Accepted Answer
Jan
on 5 Feb 2022
Edited: Jan
on 5 Feb 2022
As far as I can see, you have everything you need already.
[t,x] = ode45(@(t,x) A * x + [0; 0; sin(om*t); 0], tvec, x0);
If you write: "No matter what i try i either get an error that the arrays in the equation do not match", post your code an a copy of the error message. Then we can help you.
More Answers (0)
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!