Please solve with MATLAB. Please wright code in a code-like format. Vibrations i
ID: 3797355 • Letter: P
Question
Please solve with MATLAB. Please wright code in a code-like format.
Vibrations in mechanical structures can be modeled using systems of springs and blocks. Consider the three mass system below. The length of each unstretched spring is L and the width of each block is W. The total length of the system is L_T which includes the stretched length of each spring, (i.e. The length of the first stretched spring is L + X_1 etc.) Determine the equilibrium position by solving the system of linear equations below for the x values. k_1 = 1 N/m, k_2 = 2 N/m, k_3 = 3 N/m, k_4 = 4 N/m, W = 0.1m, L = 0.5m, L_T = 4m x_1 + x_2 + x_3 + x_4 = L_T - 4L - 3W k_1x_1 = k_2x_2 k_2x_2 = k_3x_3 k_3x_3 = k_4x_4Explanation / Answer
Solution :
%% Vibration in Mechanical structures
clc;
close all;
clear all;
%% Program strats here
%% Constants
k1=1;
k2=2;
k3=3;
k4=4;
W=0.1;
L=0.5;
LT=4;
%% Frame the matrix with the coefficients
A=[ 1 1 1 1
k1 -k2 0 0
0 k2 -k3 0
0 0 k3 -k4];
%% constant matrix
B=[LT-4*L-3*W;0;0;0];
%% Calculate X
x=inv(A)*B;
%% display result
disp('The solution of x1 x2 x4 x4 is :')
disp(x)
OUTPUT:
The solution of x1 x2 x4 x4 is :
0.8160
0.4080
0.2720
0.2040