Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

have Power Electronics assignment which is about DC/AC Inverters using MATLAB. T

ID: 1812038 • Letter: H

Question

have Power Electronics assignment which is about DC/AC Inverters using

MATLAB. The MATLAB code is already given but need to modified to work

well.


To help you get started, here is a Matlab

listing to do the above:


clear;


Vs = 500;       % supply

voltage


f0 = 50;        % output

fundamental frequency


w0 = 2*pi*f0;


T = 2/f0;       % time (secs)

for two cycles


dt =

T/1000;    % time

step for plotting


t = 0:dt:T;     % array of time values


tm =

1000*t;    % time in

milliseconds


theta =

w0*t;   % angle in

radians


Va =

Vs/2*square(theta);    %

Phase a voltage


Vb =

Vs/2*square(theta-2*pi/3);


Vc =

Vs/2*square(theta-4*pi/3);



Max_Harmonic =

17;


Nt = size(t,

2);   


Va_Fourier_Components

= zeros(Max_Harmonic, Nt);


Vb_Fourier_Components

= zeros(Max_Harmonic, Nt);


Vc_Fourier_Components

= zeros(Max_Harmonic, Nt);



for n =

1:2:Max_Harmonic


    V_Phase_FC = Vs/2*4/n/pi;   % Phase voltage Fourier

coefficients


    Va_Fourier_Components(n,:) =

V_Phase_FC*sin(n*theta);


    Vb_Fourier_Components(n,:) =

V_Phase_FC*sin(n*(theta - 2*pi/3));


    Vc_Fourier_Components(n,:) =

V_Phase_FC*sin(n*(theta - 4*pi/3));


end


Va_Fourier_Approximation

= sum(Va_Fourier_Components, 1);


Vb_Fourier_Approximation

= sum(Vb_Fourier_Components, 1);


Vc_Fourier_Approximation

= sum(Vc_Fourier_Components, 1);



m = 3; n = 1;


figure(1);


subplot(m, n,

1);


plot(tm, Va, tm,

Va_Fourier_Components, tm, Va_Fourier_Approximation);


title('Phase

a Voltage (Va)');


xlabel('Time

(ms)');


ylabel('Volts');



subplot(m, n,

2);


plot(tm, Vb, tm,

Vb_Fourier_Components, tm, Vb_Fourier_Approximation);


title('Phase

b Voltage (Vb)');


xlabel('Time

(ms)');


ylabel('Volts');



subplot(m, n,

3);


plot(tm, Vc, tm,

Vc_Fourier_Components, tm, Vc_Fourier_Approximation);


title('Phase

c Voltage (Vc)');


xlabel('Time

(ms)');


ylabel('Volts');






Explanation / Answer

clc clear; Vs = 500; % supplyvoltage f0 = 50; % outputfundamental frequency w0 = 2*pi*f0; T = 2/f0; % time (secs)for two cycles dt =T/1000; % timetep for plotting t = 0:dt:T; % array of time values tm =1000*t; % time inmilliseconds theta =w0*t; % angle inradians Va =Vs/2*square(theta); %Phase a voltage Vb =Vs/2*square(theta-2*pi/3); Vc =Vs/2*square(theta-4*pi/3); Max_Harmonic =17; Nt = size(t,2); Va_Fourier_Components= zeros(Max_Harmonic, Nt); Vb_Fourier_Components= zeros(Max_Harmonic, Nt); Vc_Fourier_Components= zeros(Max_Harmonic, Nt); for n =1:2:Max_Harmonic V_Phase_FC = Vs/2*4/n/pi; % Phase voltage Fourier coefficients Va_Fourier_Components(n,:) =V_Phase_FC*sin(n*theta); Vb_Fourier_Components(n,:) =V_Phase_FC*sin(n*(theta - 2*pi/3)); Vc_Fourier_Components(n,:) =V_Phase_FC*sin(n*(theta - 4*pi/3)); end Va_Fourier_Approximation= sum(Va_Fourier_Components, 1); Vb_Fourier_Approximation= sum(Vb_Fourier_Components, 1); Vc_Fourier_Approximation= sum(Vc_Fourier_Components, 1); m = 3; n = 1; figure(1); subplot(m, n, 1); plot(tm, Va, tm,Va_Fourier_Components, tm, Va_Fourier_Approximation); title('Phasea Voltage (Va)'); xlabel('Time(ms)'); ylabel('Volts'); subplot(m, n, 2); plot(tm, Vb, tm,Vb_Fourier_Components, tm, Vb_Fourier_Approximation); title('Phaseb Voltage (Vb)'); xlabel('Time(ms)'); ylabel('Volts'); subplot(m, n,3); plot(tm, Vc, tm,Vc_Fourier_Components, tm, Vc_Fourier_Approximation); title('Phasec Voltage (Vc)'); xlabel('Time(ms)'); ylabel('Volts');