Alternative ways to plot a bode diagram
14 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with Control System Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!