how to solve a 4 DOF problem with data input force
Show older comments
hy everyone,
I have troubles with a 4 DOF problem. In the specific, I have a 4 mass-spring problem with a damper and a force applied on the first mass, which values are available from an Excel sheet. I have to solve the differential equation for that system, but I don't know how to because the specific function of the input force is not defined and is a vector too. Could you help me? Also, I would like to know if it is possible to implement that problem in Simulink in order to check that the results are correct.
Best regards.
close all;clear all;clc
%DATA PROBLEM
A = xlsread('Database El Centro 1940_Primi 6 sec.xlsx');
time = A(:,2); %[s]
force = A(:,2); %[m/s^2]
E = 3*10^10; %[Pa]
I = (3.1)*10^(-3); %[m^4]
L = 3; %[m]
m = (8.04)*10^3; %[kg]
k = 48*E*I/(L^3); %[N/m]
csi = 0.2;
c = 2*csi*sqrt(m*k); %[Ns/m]
%MASS & STIFFNESS MATRICES
M = [m 0 0 0;0 m 0 0;0 0 m 0;0 0 0 m];
C = [c 0 0 0;0 0 0 0;0 0 0 0;0 0 0 0];
K = [2*k -k 0 0;-k 2*k -k 0;0 -k 2*k -k;0 0 -k k];
f = zeros(length(M),length(time));
f(1) = force';
dx2_dt2 = @(t,x)[[x(5),x(6),x(7),x(8)]'; -C*[x(5),x(6),x(7),x(8)]' ...
- K*[x(1),x(2),x(3),x(4)]' + f];
odeopt = odeset('RelTol',0.001,'AbsTol',0.001,'InitialStep',0.02,...
'MaxStep',0.02);
x_0 = zeros(1,length(M));
x_0_dot = zeros(1,length(M));
[time,x] = ode45(dx2_dt2,[0 6],[x_0 x_0_dot],odeopt);
Accepted Answer
More Answers (0)
Categories
Find more on General Applications 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!