You are on page 1of 3

clc

clear all
close all
%========================================================================= % Plots of
Instantaneous Power v(t).i1(t) and v(t).i2(t)
%
%
%
%

Given waveforms as
v(t)=141,2cos377t volts
i1(t)=150cos(377t-60) amperes
i2(t)=60cos(377t+30) amperes

% Initailizing X-axis
wt=-2*pi:0.01:2*pi;
% Amplitude of waveform v(t)
Vm=141.2;
v=Vm*cos(wt);
% plot(wt,v,'k');
grid on
% Amplitude of waveform i1(vt)
I1m=150;
i1=I1m*cos(wt-((pi/180)*60));
% Instantaneous power as
%P1=v.*i1;
% Double Frequency Component
P1doublefreq=((Vm*I1m)*cos(2*wt-(-60)*(pi/180)))/2;
% Constant Component i.e Average Power
P1av=(Vm*I1m)*cos(-60*(pi/180))/2;
P1inst=P1av+P1doublefreq;
figure(1);
plot(wt,P1inst,'-g');
hold on
plot(wt,P1doublefreq,'-.r')
hold on
plot(wt,P1av,'k')
hold on
ylabel('Power W')
xlabel('wt')
title('Instantaneous Power: p1(t) vs (wt)');
hleg1 = legend('P1inst','P1doublefreq','P1av');
set(hleg1,'FontAngle','italic','TextColor',[.4,.3,.2,.1])
xlim([-6.5 6.5])
% Amplitude of waveform i2(t)

I2m=60;
i2=I2m*cos(wt+((pi/180)*30));
% Instantaneous power as
%P2=v.*i2;
% Double Frequency Component
% Constant Component i.e Average Power
P2av=((Vm*I2m)*cos(30*(pi/180)))/2;
P2doublefreq=((Vm*I2m)*cos(2*wt-(30)*(pi/180)))/2;
P2inst=P2av+P2doublefreq;
figure(2)
plot(wt,P2av,'-.k')
plot(wt,P2inst,'b');
hold on
plot(wt,P2doublefreq,'-.g')
hold on
plot(wt,P2av,'k')
hold on
ylabel('Power W')
xlabel('wt')
hleg2 = legend('P2inst','P2doublefreq','P2av');
set(hleg2,'FontAngle','italic','TextColor',[.4,.3,.2,.1])
xlim([-6.5 6.5])

You might also like