0% found this document useful (0 votes)
69 views5 pages

Sheet of Chapter (3) : Plotting

This document provides instructions for plotting various mathematical functions and waveforms in MATLAB. It includes: 1) Plotting sin and cos functions, adjusting axes, comparing plots of functions versus their arrays. 2) Creating polar plots of functions of theta versus r arrays. 3) Plotting sums of sinewaves with different frequencies and observing the results. 4) Drawing complex voltage and current waveforms, calculating rms values and power. 5) Plotting I-V curves for a solar cell at different irradiance levels and finding maximum power points. 6) Analyzing an RLC series circuit, calculating resonance properties, and plotting impedance versus frequency.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views5 pages

Sheet of Chapter (3) : Plotting

This document provides instructions for plotting various mathematical functions and waveforms in MATLAB. It includes: 1) Plotting sin and cos functions, adjusting axes, comparing plots of functions versus their arrays. 2) Creating polar plots of functions of theta versus r arrays. 3) Plotting sums of sinewaves with different frequencies and observing the results. 4) Drawing complex voltage and current waveforms, calculating rms values and power. 5) Plotting I-V curves for a solar cell at different irradiance levels and finding maximum power points. 6) Analyzing an RLC series circuit, calculating resonance properties, and plotting impedance versus frequency.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Sheet of chapter (3)

Sheet of chapter (3)


Plotting

Section (A)
1) Do the following
a. Plot x versus y for y = sin(x). Let x vary from 0 to 2π in increments of 0.1π.
b. Add a title and labels to your plot.
c. Plot x versus y1 and y2 (use new figure) for y1 = sin(x) and y2 = cos(x). Let x vary from 0
to 2π in increments of 0.1π. Add a title and labels to your plot (use one vertical axis for y1
and y2).
d. Re-create the plot from Exercise c (use new figure), but make the sin(x) line dashed and
red. Make the cos(x) line green and dotted.
e. Add a legend to the graph in Exercise d.
f. Adjust the axes so that the x-axis goes from −1 to 2π + 1 and the y-axis from −1.5 to +1.5.
g. Create a new vector, a = cos(x). Let x vary from 0 to 2π in increments of 0.1π. Plot just a
without specifying the x values (plot(a)) in a new figure and observe the result. Compare
this result with the graph produced by plotting x versus a.

2) Do the following.

3) Do the following.
a. Define an array called theta, from 0 to 2π, in steps of 0.01π. Define an array of distances r
= 5*cos(4*theta). Make a polar plot of theta versus r.
b. Use the hold on command to freeze the graph. Assign r = 4*cos(6*theta) and plot.
c. Create a new figure. Use the theta array from the preceding exercises. Assign r = 5 −
5*sin(theta) and create a new polar plot.
d. Create a new figure. Use the theta array from the preceding exercises. Assign r =
sqrt(5^2*cos(2*theta)) and create a new polar plot.
e. Create a new figure. Define a theta array such that theta = pi/2:4/5*pi:4.5pi; Create a six-
member array of ones called r. Create a new polar plot of theta versus r.

1
Computer Applications

4) Create appropriate x and y arrays to use in plotting each of the expressions that follow. Use the
subplot command to divide your figures into four sections, and create each of these four graphs
for each expression:
• Rectangular (normal plotting)
• Semilogx
• Semilogy
• Loglog
1. y = 5x + 3
2. y = 3x2
3. y = 12e(x+2)
4. y = 1 / x
Physical data usually are plotted so that they fall on a straight line. Which of the
preceding types of plot results in a straight line for each problem?

5) The following equation represent a summation of a two sinewave with different frequencies
va =100 sin(ωt) + 30 sin(3ωt)
the first term represents the fundamental sinewave with a peak value of 100 V. the second term
represents a 3rd harmonic waveform with a peak of 30% from the fundamental.
for time variation from 0:2π with a step of 0.001π (wt=0: 0.001π:2π), draw the first term with
time variation and the second term and the total (plot(wt,100*sin(ωt), wt, 30*sin(3*ωt), wt,va).
Write your observations.
Then, in a new figure, draw the following waveforms for at least one cycle for the fundamental
component and write your observation. (using subplot to plot all functions on the same figure)
va =100 sin(ωt) + 30 sin(3ωt)
vb =100 sin(ωt) + 30 sin(3ωt) + 20 sin(5ωt)
vc=100 sin(ωt) + 30 sin(3ωt+π/2)
vd=100 sin(ωt) + 30 sin(3ωt − π/2)
ve=100 sin(ωt) + 30 sin(3ωt + π)
vf=100 sin(ωt) − 30 sin(3ωt + π/2)

6) The following equation represent a summation of a two sinewave with different frequencies
ia = 10 sin(ωt) + 4 sin(2ωt)
the first term represents the fundamental sinewave with a peak value of 10 V. the second term
represents a 2nd harmonic waveform with a peak of 40% from the fundamental.
for time variation from 0:2π with a step of 0.001π (wt=0: 0.001π:2π), draw the first term with
time variation and the second term and the total (plot(wt,10*sin(ωt), wt, 4*sin(2*ωt), wt,ia).
Write your observations.

2
Sheet of chapter (3)

Then, in a new figure, draw the following waveforms for at least one cycle for the fundamental
component and write your observation. (using subplot to plot all functions on the same figure)
ia = 10 sin(ωt) + 4 sin(2ωt)
ib = 10 sin(ωt) + 4 sin(2ωt) + 3 sin(4ωt)
ic = 10 sin(ωt) + 4 sin(2ωt + π/2)
id = 10 sin(ωt) + 4 sin(2ωt + π)

7) The following equation represent a summation of three sinewave with different frequencies
vg = 50 sin(ωt) + 25 sin(2ωt) + 15 sin(3ωt)
the first term represents the fundamental sinewave with a peak value of 50 V. the second term
represents a 2nd harmonic waveform with a peak of 25V and the third term represent a 3rd
harmonic waveform with a peak of 15V.
for time variation from 0:2π with a step of 0.001π (wt=0: 0.001π:2π), draw the three terms and
vg with time variation (plot(wt,50*sin(ωt), wt, 25*sin(2*ωt), wt, 15*sin(3*ωt), wt,vg). Write
your observations.
Then, in a new figure, draw the following waveforms for at least one cycle for the fundamental
component and write your observation. (using subplot to plot all functions on the same figure)
vg = 50 sin(ωt) + 25 sin(2ωt) + 15 sin(3ωt)
vh = 50 sin(ωt) + 25 sin(2ωt −π) + 15 sin(3ωt+ π/2)

8) Draw the following waveforms for at least three cycle for the fundamental component and write
your observation. (draw each term and the summation)
i =32 + 50 sin(ωt) + 20 sin(2ωt − π/2)

9) A complex voltage waveform represented by:

is applied across (a) a pure 40 Ω resistance, (b) a pure 7.96 mH inductance, and (c) a pure 25 µF
capacitor. Draw the current flowing for each case and the voltage if the fundamental frequency is 1
kHz (using subplot to show the three cases in the same figure). For the voltage and current calculate
the rms value of the applied voltage and the flowing current. Find the active power supplied from the
source and the overall power factor.

10) As mentioned in Sheet-2 the I-V characteristics curve of a solar cell (PV) is given or calculated
at certain condition of irradiance and temperature. At different irradiation condition the solar PV
has a different I-V characteristic curves as shown in the following figure. For each curve there is
a MPP that the control circuit can track. The following tables give I-V measured values at three
different irradiations. Do the following (using new figure for each case)

3
Computer Applications

a- Draw a three-dimension drawing of V, I, P for the first table and from drawing find the
maximum power.
b- Draw the output power for the three cases using bar plot. Find the maximum power for
each irradiation from the drawing.
c- Repeat the previous using bar3 plot.
d- Draw the output power for the second table using pie and pie3 plotting and find the
maximum power from the drawing.
e- Using surf plot, draw the output power for the three irradiation and find the maximum
power for each irradiation from the drawing.

200W/m2
Voltage (V) 0.0 2.5 5 7.5 10 12.5 15 17.5 20 22.5 25 27.5 30 31 32 33 34 35 36 37 38

Current (A) 1.2 1.2 1.2 1.2 1.2 1.2 1.2 1.2 1.2 1.19 1.17 1.12 1.08 1.05 1.03 1 0.95 0.9 0.7 0.4 0.0

600W/m2
Voltage (V) 0.0 5 10 15 20 24 26 28 30 31 32 33 34 35 36 37 38 39 40 41 42

Current (A) 3.7 3.7 3.7 3.7 3.7 3.68 3.64 3.62 3.6 3.58 3.53 3.5 3.4 3.2 3.0 2.6 2.4 2.1 1 0.6 0.0

1000W/m2
Voltage (V) 0.0 5 10 15 20 25 28 20 31 32 33 34 35 36 37 38 39 40 41 42 43

Current (A) 6.4 6.4 6.4 6.4 6.4 6.4 6.35 6.3 6.2 6.1 6.0 5.9 5.6 5.4 4.1 3.6 3.1 2.8 2 0.4 0.0

11) Consider the circuit of the following figure, which represent a series RLC circuit. Varying the
frequency of the voltage source changes the system total impedance, where the inductive
reactance directly proportional to the frequency and the capacitive reactance inversely
proportional to the frequency. At certain frequency called “resonance frequency” the reactive
impedance cancels the capacitive impedance and the circuit equivalent impedance is the total
circuit resistance only. The resonance frequency can be obtained be equaling the imaginary part
of the system impedance by zero. Write a MATLAB m-file to do the following
a. Find the resonant frequency expressed as ω(rad/s) and f(Hz). (102krad/s – 16.2kHz)
b. Determine the total impedance at resonance. (55Ω)
c. Solve for I, VL, and VC at resonance. (0.206A∟0o ,46.0∟90 o, 46.0∟-90 o)
d. Calculate reactive powers QC and QL at resonance. (9.46 VAR)
e. Find the quality factor, Qs, of the circuit, where quality factor can be defined as the ratio of
reactive power to average power. (4.07)
f. Draw the total impedance versus frequency using semilog plot for frequency axis. The
frequency axis should be from Fs/100 to Fs*100
g. Redraw the system impedance on the same previous figure (using hold on) when RG is 200
and 1000 ohm, write your observation.

4
Sheet of chapter (3)

h. Redraw the system impedance on the same previous figure (using hold on) when 1) coil
inductance is doubled and capacitance is halved 2) coil inductance is halved and
capacitance is doubled, write your observation.

You might also like