Effacer les filtres
Effacer les filtres

Where does my impedance problem come from?

1 vue (au cours des 30 derniers jours)
damien bertein
damien bertein le 5 Juin 2018
Good morning, I have a problem with my matlab code to plot my impedance module according to frequency. The problem is that I can't find my error despite the help of the documentation.
Here is my matlab code
if true
close all
clear all
pas = 10;
F= (0:pas:20000);
w= 2*pi*F;
x= w.^2;
Re= 9.54;
Le= 0.19;
Lem= 0.000011*5.07;
Rem= (5.07^2)/1.905;
Cem= 0.011/5.05;
Cer1= 5.07^2/(13.2*0.18);
Cer2= Cer1;
Z= Re+1i*w*Le+((1i*w*Lem)/(1+1i*w*(Lem/Rem)-(Cer1+Cer2+Cem)*Lem*x));
Fr= ((1/(2*pi))*(1/(Lem*(Cem+Cer1+Cer2))));
R=abs(Z);
f=(1:10:20000);
figure, loglog(f,R,'r');
xlabel('Fréquence', 'fontSize',15);
ylabel('Impédance acoustique Z', 'fontsize', 15);
end

Réponses (1)

Kim Winter
Kim Winter le 3 Juil 2018
Hi, I believe that your issue is when you plot loglog. When you plot, for every x value, you should have a corresponding y value. If you check the lengths of f and R respectively, f is 2001 points and R is 2000 points. So, if instead, you plotted:
figure, loglog(f,R(2:end),'r');
or
figure, loglog(f,R(1:end-1),'r');
a figure will show.

Catégories

En savoir plus sur Acoustics, Noise and Vibration dans Help Center et File Exchange

Produits


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by