Question: % 1 . Initialize inputs % initialize omega and peak voltage omega = 2 * * pi * * 6 0 ; v m =

%1. Initialize inputs
% initialize omega and peak voltage
omega =2** pi **60;
vm=
% Create a 1-d array for segment 10.0t0.2 using a small interval 0.001 and initialize the peak current for that segment
t1=0:0.001:0.2;
I_m1=sqrt(2); % RMS current for segment 1(for a sine wave, RMS = peak/sqrt(2))
% Create a 1-d array for segment 20.2t0.3 using a small interval 0.001 and initialize the peak current for that segment
t2=0.2:0.001:0.3;
I_m2=2**22;
% Create a 1-d array for segment 30.3t0.5 using a small interval 0.001 and initialize the peak current for that segment
t3=0.3:0.001:0.5;
I_m3=22;
%2. Do the magic - calculate current, voltage, and power
:' Calculate instantaneous current for segement 1, segment 2, and segement 3 respectively
omega **t1);
i2=I-m2**ones(size(t2));
omega **t3;
% Join the time t for the three segements into one big 1-d array
t=[t1,t2,t3];
% Join the instantaneous current for the three segements into one big 1-d array
i=
%calculate the instantaneous voltage for all segments
v=
%Calculate the instantaneous power for all segments
p=
%plot the voltage, current, and power
figure(1);
plot(t,v);
title ('Instantaneous Voltage vs. Time')
x label('Time (s)')
ylabel('Voltage (V)')
 %1. Initialize inputs % initialize omega and peak voltage omega =2**

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!