piloting log in y cordinate

1 visualización (últimos 30 días)
Mustafa Alhandhali
Mustafa Alhandhali el 9 de Abr. de 2019
Comentada: Mustafa Alhandhali el 9 de Abr. de 2019
format shortG
kxx = 2.0e4; kyy = 8.8e4;
kxy = 1.0e3; kyx = 1.5e3;
cxx = 1.0 ; cyy = 1.0; cxy = 1.0e-1;
cyx = 1.0e-1;
l=2; m=5; id=0.1;
er=0.13-3; ez=1e-3; mu=0.02;
i = sqrt(-1);
syms w
stiffnes_matrix=[kxx kyy 0 0; kyx kyy 0 0; 0 0 0.25*l^2*kxx 0.25*l^2*kxy;0 0 0.25*l^2*kyx 0.25*l^2*kyy];
mass_matrix=[m 0 0 0; 0 m 0 0; 0 0 id 0; 0 0 0 id];
force_unblance=[mu*er*w^2; -i*mu*er*w^2; mu*er*w^2*ez; -i*mu*er*w^2*ez];
D=stiffnes_matrix-(w^2*mass_matrix);
xss=inv(D)*force_unblance
p1=xss(1,1)
p2=xss(2,1)
p3=xss(3,1)
p4=xss(4,1)
set(gca, 'YScale', 'log')
w = linspace(0,1200)';
plot(p1,w)
plot(p2,w)
plot(p3,w)
plot(p4,w)
i want to drwa but this error appear
Error using plot
Data must be numeric, datetime, duration or an array convertible to double.

Respuesta aceptada

Stephan
Stephan el 9 de Abr. de 2019
Editada: Stephan el 9 de Abr. de 2019
Hi,
try:
format shortG
kxx = 2.0e4; kyy = 8.8e4;
kxy = 1.0e3; kyx = 1.5e3;
cxx = 1.0 ; cyy = 1.0; cxy = 1.0e-1;
cyx = 1.0e-1;
l=2; m=5; id=0.1;
er=0.13-3; ez=1e-3; mu=0.02;
i = sqrt(-1);
syms w
stiffnes_matrix=[kxx kyy 0 0; kyx kyy 0 0; 0 0 0.25*l^2*kxx 0.25*l^2*kxy;0 0 0.25*l^2*kyx 0.25*l^2*kyy];
mass_matrix=[m 0 0 0; 0 m 0 0; 0 0 id 0; 0 0 0 id];
force_unblance=[mu*er*w^2; -i*mu*er*w^2; mu*er*w^2*ez; -i*mu*er*w^2*ez];
D=stiffnes_matrix-(w^2*mass_matrix);
xss=D\force_unblance;
fun_xss = matlabFunction(xss);
clear w
w = linspace(0,1200);
p_all=fun_xss(w);
subplot(2,2,1)
semilogy(w,abs(p_all(1,:)))
subplot(2,2,2)
semilogy(w,abs(p_all(2,:)))
subplot(2,2,3)
semilogy(w,abs(p_all(3,:)))
subplot(2,2,4)
semilogy(w,abs(p_all(4,:)))
results in:
plot-4.PNG
Best regards
Stephan
  3 comentarios
Stephan
Stephan el 9 de Abr. de 2019
Editada: Stephan el 9 de Abr. de 2019
See my edited answer - it works now.
Please accept if it was helpful.
Mustafa Alhandhali
Mustafa Alhandhali el 9 de Abr. de 2019
thank you so much

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by