EEN-291 ENGINEERING ANALYSIS AND DESIGN
ELECTRICAL ENGINEERING DEPARTMENT
INDIAN INSTITUTE OF TECHNOLOGY, ROORKEE
Lab-2: Plotting with MATLAB
Maximum marks 17.5
Note: Before solving the exercises, go through the recorded tutorials. We expect you to have
the MATLAB2019 version and above installed in your systems. A tutorial is also available in
the recorded demo. Attached the screen shot of the MATLAB screen for the exercise.
Q.1 Use MATLAB to plot the polynomial
𝑦 = 3𝑥 4 − 5𝑥 3 − 28𝑥 2 − 5𝑥 + 200
over the interval −1 ≤ 𝑥 ≤ 1 [1.5]
(a) Put grid on the plot and trace should be red colour [1]
(b) Find the coordinate of the peak of the curve using “ginput” [1]
Q.2 Use MATLAB to find the values of x, θ, z which minimizes the following function [3.5]
4𝑥
𝑓(𝑥, 𝜃, 𝑧) = 𝑧 + + 𝑥2
(𝑠𝑖𝑛𝜃)
Where,
𝑥3
20 = 𝑥𝑧 +
𝑡𝑎𝑛𝜃
Q.3 Write a MATLAB script and plot the following function
√𝑥 2 + 1 ;𝑥 < 0
𝑦 = { 3𝑥 + 1 ; 0 ≤ 𝑥 < 10
9 sin(5𝑥 − 50) ; 𝑥 ≥ 10
for, −2 ≤ 𝑥 < 20 [3.5]
Q.4 The half bridge rectifier is shown in below circuit has the diode D, which has a diode
forward voltage drop of 0.7V. Due to the circuit operation the voltage across load resistance
(Rl) is given by [3.5]
𝑣 − 0.7 ; 𝑖𝑓 𝑣𝑠 > 0.7
𝑣𝑙 = { 𝑠
0 ; 𝑖𝑓 𝑣𝑠 ≤ 0.7
The supply voltage (vs) is
𝑣𝑠 (𝑡) = 4sin(π𝑡)
D
+
+
vs(t) Rl vl
- -
Where, t is the time in seconds. Use the MATLAB to plot the voltage across the load vl (t) for
the time 0 ≤ 𝑡 ≤ 10.
Q.5 The electric potential field V at a point in the free space, due to two charges is represented
by
1 𝑞1 𝑞2
𝑉= ( + )
4π𝜀0 𝑟1 𝑟2
Where, q1 and q2 are the charge in coloumb (C), r1 and r2 are the distances of the charges from
𝐶2
the point (m) and ε0 is the permittivity of free space (𝜀0 = 8.854 × 10−12 𝑁𝑚2).
The charges q1 and q2 are 6 x 10-10 C and 12 x 10-10 C. The q1 and q2 are placed in xy plane at
the point (4,0) and (-4,0)m respectively. Using MATLAB, plot the electric potential field on a
three-dimensional space (x, y, z) over the ranges−2 ≤ 𝑥 ≤ 2, −2 ≤ 𝑦 ≤ 2, −10 ≤ 𝑧 ≤ 10.
[3.5]