under is my worked to try use root syntax.
% Using the MATLAB function “roots” for find non-zero natural frequencies
% define symbolic variable w
syms w;
% Given parameters
m1 = 1.8; m2 = 6.3; m3 = 5.4; m4 = 22.5; m5 = 54;
c2 = 10; c3 = 0.5; c4 = 1.50; c5 = 1.1;
k2 = 100000; k3 = 50; k4 = 75; k5 = 10;
% Set up system matrices
% mass matrix
M = diag([m1, m2, m3, m4, m5]);
% damping matrix
C = [c2 -c2 0 0 0;
-c2 c2+c3 -c3 0 0;
0 -c3 c3+c4 -c4 0;
0 0 -c4 c4+c5 -c5;
0 0 0 -c5 c5];
% stiffness matrix
K = [k2 -k2 0 0 0;
-k2 k2+k3 -k3 0 0;
0 -k3 k3+k4 -k4 0;
0 0 -k4 k4+k5 -k5;
0 0 0 -k5 k5];
% Calculate frequency equation
Zw = w^2*M + 1i*w*C + K; % impedance matrix
freqEq = det(Zw); % take determinant to get frequency equation
pretty(simplify(freqEq)); % display simplified frequency equation
% Display the non-zero natural frequencies
disp(‘Non-zero natural frequencies (Hz):’);
disp(root(freqEq))% Using the MATLAB function “roots” for find non-zero natural frequencies
% define symbolic variable w
syms w;
% Given parameters
m1 = 1.8; m2 = 6.3; m3 = 5.4; m4 = 22.5; m5 = 54;
c2 = 10; c3 = 0.5; c4 = 1.50; c5 = 1.1;
k2 = 100000; k3 = 50; k4 = 75; k5 = 10;
% Set up system matrices
% mass matrix
M = diag([m1, m2, m3, m4, m5]);
% damping matrix
C = [c2 -c2 0 0 0;
-c2 c2+c3 -c3 0 0;
0 -c3 c3+c4 -c4 0;
0 0 -c4 c4+c5 -c5;
0 0 0 -c5 c5];
% stiffness matrix
K = [k2 -k2 0 0 0;
-k2 k2+k3 -k3 0 0;
0 -k3 k3+k4 -k4 0;
0 0 -k4 k4+k5 -k5;
0 0 0 -k5 k5];
% Calculate frequency equation
Zw = w^2*M + 1i*w*C + K; % impedance matrix
freqEq = det(Zw); % take determinant to get frequency equation
pretty(simplify(freqEq)); % display simplified frequency equation
% Display the non-zero natural frequencies
disp(‘Non-zero natural frequencies (Hz):’);
disp(root(freqEq)) % Using the MATLAB function “roots” for find non-zero natural frequencies
% define symbolic variable w
syms w;
% Given parameters
m1 = 1.8; m2 = 6.3; m3 = 5.4; m4 = 22.5; m5 = 54;
c2 = 10; c3 = 0.5; c4 = 1.50; c5 = 1.1;
k2 = 100000; k3 = 50; k4 = 75; k5 = 10;
% Set up system matrices
% mass matrix
M = diag([m1, m2, m3, m4, m5]);
% damping matrix
C = [c2 -c2 0 0 0;
-c2 c2+c3 -c3 0 0;
0 -c3 c3+c4 -c4 0;
0 0 -c4 c4+c5 -c5;
0 0 0 -c5 c5];
% stiffness matrix
K = [k2 -k2 0 0 0;
-k2 k2+k3 -k3 0 0;
0 -k3 k3+k4 -k4 0;
0 0 -k4 k4+k5 -k5;
0 0 0 -k5 k5];
% Calculate frequency equation
Zw = w^2*M + 1i*w*C + K; % impedance matrix
freqEq = det(Zw); % take determinant to get frequency equation
pretty(simplify(freqEq)); % display simplified frequency equation
% Display the non-zero natural frequencies
disp(‘Non-zero natural frequencies (Hz):’);
disp(root(freqEq)) matlab MATLAB Answers — New Questions