电力系统分析(第二版)Hadi Saadat matlab 程序二习题(教材搬运)

  • 时间:
  • 浏览:
  • 来源:互联网

第二章 基本原理

  • 习题2.1
  • 习题2.2

习题2.1

Vm=input('Enter voltage peak amplitude Vm=');
thetav=input('Enter voltage phase angle in degree thetav=');
Z=input('Enter magnitude of the load impedance Z=');
gama=input('Enter load phase angle in degree gama=');
thetai = thetav-gama;%Current phase angle in degree
Im = Vm/Z;%电流幅值
wt=0:.05:2*pi;%wt from 0 to 2*pi
v=Vm*cos(wt);%瞬时电压
i=Im*cos(wt + thetai*pi/180);%瞬时电流
p=v.*i;%瞬时功率
V=Vm/sqrt(2); I=Im/sqrt(2);%有效电压和电流
theta = (thetav-thetai)*pi/180;%化为弧度制
pr=V*I*cos(theta)*(1+cos(2*wt));
px=V*I*sin(theta)*sin(2*wt);
disp('(a)Estimate from the plots')
P=max(pr)/2,Q=V*I*sin(theta)*sin(2*pi/4)
P=P*ones(1,length(wt));
xline=zeros(1,length(wt));
wt=180/pi*wt;
subplot(221),plot(wt,v,wt,i,wt,xline),grid
title(['v(t)=Vm coswt,i(t)=Im cos(wt+',num2str(thetai),')'])
xlabel('wt,degrees')
subplot(222),plot(wt,p,wt,xline),grid
title('p(t)=v(t) i(t)'),xlabel('wt,degrees')
subplot(223),plot(wt,pr,wt,P,wt,xline),grid
title('pr(t) Eq.2.6'),xlabel('wt,degrees')
subplot(224),plot(wt,px,wt,xline),grid
title('px(t) Eq.2.8'),xlabel('wt,degrees')
subplot(111)
disp('(b)From P and Q formulas using phasor values')
P=V*I*cos(theta);
Q=V*I*sin(theta)

结果:

Enter voltage peak amplitude Vm=100
Enter voltage phase angle in degree thetav=0
Enter magnitude of the load impedance Z=1.25
Enter load phase angle in degree gama=60
(a)Estimate from the plots
P =2000
Q =3.4641e+03
(b)From P and Q formulas using phasor values
P =2000
Q =3.4641e+03

在这里插入图片描述

习题2.2

Vm=200;
t=0:.0001:0.01667;
v=Vm*cos(377*t);
p=800+1000*cos(754*t-36.87*pi/180);
i=p./v;
wt=180/pi*377*t;
xline=zeros(1,length(wt));
subplot(221),plot(wt,v,wt,xline),grid
xlabel('wt,degrees'),title('v(t)')
subplot(222),plot(wt,p,wt,xline),grid
xlabel('wt,degrees'),title('p(t)')
subplot(223),plot(wt,i,wt,xline),grid
xlabel('wt,degrees'),title('i(t)'),subplot(111)

在这里插入图片描述

本文链接http://element-ui.cn/article/show-298666.aspx