Alternative ways to plot a bode diagram

13 visualizaciones (últimos 30 días)
francesco capirci
francesco capirci el 23 de En. de 2017
I'm trying to make a Bode diagram of a function. The problem is that said function contains a (j*w)^n inside, where (0.87 < n < 0.93). That means that i cannot use the bode function, the way that works i need all s to have an integer exponential. I tried to use semilog plot:
if true
%defining logspace
f = logspace(0,6,1e6);
w = 2*pi*f;
%the impedance which contains the (j*w)^n
Zel = Rct./(1 + Rct*(1j*w*Cdl).^n);
% defining H
H_num = Rseal*Zload;
H_den = Rseal*Zm + (Zm + Rseal)*(Zload + Zel);
H=H_num./H_den;
%plotting the bode diagram
subplot(2,1,1)
semilogx(f, 20*log10(abs(H)))
subplot(2,1,2)
semilogx(f,unwrap(angle(H))*180/pi)
end
and yet the result was off, while i got a high pass filter as it should be, it was wrong.
this is the result i was expecting:
I tried with symbolic functions too:
if true
% code
syms s f;
s= 1j*(2*pi*f);
H_num = Rseal*Zload;
H_den = Rseal*Zm + (Zm + Rseal)*(Zload + Zel);
H=H_num/H_den;
H_modulo = matlabFunction(20*log10(abs(H)));
H_fase = matlabFunction(radtodeg(phase(H)));
end
and this time i got this, still wrong:
So, while i triple check the values of the parameters and the calculations, someone has any idea of why this isn't working? or just a suggestion on where to look. Thanks in advance for you help.

Respuestas (0)

Categorías

Más información sobre Get Started with Control System Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by