piloting log in y cordinate
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Mustafa Alhandhali
le 9 Avr 2019
Commenté : Mustafa Alhandhali
le 9 Avr 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.
0 commentaires
Réponse acceptée
Stephan
le 9 Avr 2019
Modifié(e) : Stephan
le 9 Avr 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:
Best regards
Stephan
3 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Subplots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!