i want to find out area under the curve using quad command ,the curve is generated after running the programme

4 次查看(过去 30 天)
clc
clear all
s=tf('s')
alpha=0.05
mu=0.05;
ztap=0;
ztaa=sqrt(3*mu/(8*(1+mu)));
omegaa=(1/(1+mu));
a1=1-alpha;
a2=2*ztaa*omegaa+2*ztap+2*ztaa*omegaa*mu;
a3=omegaa^2+4*ztap*ztaa*omegaa+mu*omegaa^2+1;
a4=2*ztap*omegaa^2+2*ztaa*omegaa;
a5=omegaa^2;
A=s^2+2*ztaa*omegaa*s+omegaa^2;
D=a1*s^4+a2*s^3+a3*s^2+a4*s+a5;
G=A/D;
bodemag(G)
After running this programme a curve is generated (bode plot) i want find out area under this curve by using quad syntax i tried to solve this many times i m very new to matlab please help me to find out the answer

回答(1 个)

Grzegorz Knor
Grzegorz Knor 2012-11-7
If you draw yourself Bode plot (see code), you receive vectors 'x' and 'y', which can be numerically integrate.
[HMag, HPhase, HOmega] = bode(G);
HMag = squeeze(HMag);
HPhase = squeeze(HPhase);
figure
semilogx(HOmega, 20*log10(HMag),'r')
xlabel('Frequency (rad/s)')
ylabel('Magnitude (dB)')
title('Bode Diagram')

类别

Help CenterFile Exchange 中查找有关 Classical Control Design 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by