solve a forced vibration equation for x and w
Mostra commenti meno recenti
Hi,
I am about to solve this forced-viration equation; considering I already calculate w in the first part but don't know how to calculate x
I tried using this method to calculate w and it worked
m=1;
k=5;
f=10;
M=[3*m 0;0 m];
K=[2*k -k;-k k];
F=[0;f];
syms w
my_eigenvalues=0;
my_eigenvalues=det(K-(w^2)*M);
w=solve(my_eigenvalues,w);
w=double (w)
But when I start to solve the mentioned equation to calculate x , it won't work !!!
syms x
my_eigenvectors=(K-(w^2)*M)*x;
x=solve(my_eigenvectors,x);
x=double (x)
How can I solve this equation ? K-(w^2)*M)*x
4 Commenti
Sam Chak
il 20 Giu 2022
Your equation says
that either
or
Since the latter is a trivial solution, then I guess you want to solve
?
Fatemeh Salar
il 20 Giu 2022
Modificato: Fatemeh Salar
il 20 Giu 2022
Is this approach acceptable?
m = 1;
k = 5;
M = [3*m 0; 0 m];
K = [2*k -k; -k k];
A = -M\K
[V, D] = eig(A) % columns of eigenvectors in matrix V and Diagonal matrix D of eigenvalues
Fatemeh Salar
il 20 Giu 2022
Risposta accettata
Più risposte (2)
Torsten
il 20 Giu 2022
Sam Chak
il 20 Giu 2022
Maybe like this?
function v = dxdt(t, x)
m = 1;
k = 5;
f = 10;
M = [3*m 0; 0 m]; % mass matrix
K = [2*k -k; -k k]; % stiffness matrix
F = [0; f]; % force input matrix
n = size(M, 1);
A = [zeros(n) eye(n); -M\K zeros(n)]; % state matrix
b = M\F;
B = [zeros(n, 1); b]; % input matrix
v = A*x + B; % state-space
end
xo = [0; 0; 0; 0]; % initial condition
tspan = [0 20]; % simulation time
[t, x] = ode45(@dxdt, tspan, xo);
plot(t, [x(:,1) x(:,2)], 'linewidth', 1.5)
grid on
xlabel('t')
ylabel('\bf{x}')
title('Forced Response')
legend('x_{1}(t)', 'x_{2}(t)')

Categorie
Scopri di più su Eigenvalues & Eigenvectors in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




