how to plot constant gain with bode
조회 수: 20 (최근 30일)
이전 댓글 표시
How does one plot a constant gain with bode?
The following example gives me the following error:
R1 = 81800;
R2 = 18200;
R3 = 5600;
C1 = 13e-9;
RTH = (R1*R2)/(R1 + R2);
gmmin = 100e-6;
gmmax = 1e-3;
w1 = (1/(C1*R3)); % f1 and f2 from G
f1 = w1/2*pi;
w2 = (1/(C1*R1));
f2 = w2/2*pi;
w3 = (1/(C1*RTH)); % f3 and f4 from T
f3 = w3/2*pi;
w4 = (1/(C1*(RTH+R3)));
f4 = w4/2*pi;
>> Go = R2/(R1 + R2);
>> fmin = 10; % minimum frequency = 10 Hz
fmax = 100e6; % maximum frequency = 10 MHz
% Set Bode plot options
BodeOptions = bodeoptions;
BodeOptions.FreqUnits = 'Hz'; % we prefer Hz, not rad/s
BodeOptions.Xlim = [fmin fmax]; % frequency-axis limits
BodeOptions.Ylim = {[-100,100];[-180,180]}; % magnitude and phase axes limits
BodeOptions.Grid = 'on'; % include grid
figure(2);
% define plot title
BodeOptions.Title.String = 'Go';
bode(Go, BodeOptions, 'b'); % generate the magnitude and phase responses
legend('Go')
Error using tf (line 299)
The values of the "Numerator" and "Denominator" properties must be row vectors or cell arrays of row
vectors, where each vector is nonempty and containing numeric data. Type "help tf.num" or "help tf.den" for
more information.
Error in bode (line 107)
sys = tf(a,b);
댓글 수: 0
채택된 답변
Birdman
2019년 1월 30일
To plot Bode of constant, define it as a transfer function but in the following way:
Gs=tf(R1/(R1+R2),1);
bode(Gs);
추가 답변 (1개)
Avirup
2023년 3월 22일
h1=((1/(s*Cf1)*(Rf1+(1/(s*Cb1))))/((1/s*Cf1)+Rf1+(1/(s*Cb1))));
H=h1/((s*Lf1)+h1);
Re=(2*L)/((D^2)*1/fs)
zn=tf(-Re,1);%Re is simply a dc gain
zd=tf(Re,1);%Re is simply a dc gain
BodeOptions=bodeoptions('cstprefs');
BodeOptions.Grid='on';
BodeOptions.XLim=[10,500000];
BodeOptions.Ylim = {[-100,30];[-180,180]};
BodeOptions.FreqUnits='Hz';
BodeOptions.Title.String='Zn Zd Zout Plot';
bode(zout, zn, zd, BodeOptions)%this gives the bode of Dc gain, zn, zd are dc gains
댓글 수: 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!