Starting from:

$30

ECSE 343 half-wave rectifier circuit

ECSE 343
1
The main aim of this project is to write a computer program for simulating the transient response
of a half-wave rectifier circuit.
The circuit shown in Figure 1 is called the Half-Wave Rectifier. For this circuit we will compute
the transient response of the circuit for all the voltage nodes, namely, V1, V2, and 𝑉3.
Figure 1: Half-Wave Rectifier.
𝐼𝐸 is the current passing into voltage source. 𝐼𝐷 is the diode current shown in (1)
𝐼𝐷 = 𝐼𝑆 (𝑒
𝑉2−𝑉3
𝑉𝑡 − 1)
(1)
𝐼𝑆
is the saturation current of the diode and 𝑉𝑡
is the thermal voltage. As we can see that the diode
current is a nonlinear function of the node voltages 𝑉2 and 𝑉3, this makes the nodal equations of
the above circuit (shown in (2)) nonlinear.
[






1
50 −
1
50 0 1

1
50
1
50 0 0
0 0
1
50 0
1 0 0 0]







𝑮
[
𝑉1
𝑉2
𝑉3
𝐼𝐸
]
⏟𝑿(𝑡)
+[
0 0 0 0
0 0 0 0
0 0 10−6 0
0 0 0 0
]

𝐶
[




𝑉1
̇
𝑉2
̇
𝑉3
̇
𝐼𝐸
̇ ]





𝑿(𝒕
̇ )
+
[





0
𝐼𝑆 (𝑒
𝑉2−𝑉3
𝑉𝑡 − 1)
−𝐼𝑆 (𝑒
𝑉2−𝑉3
𝑉𝑡 − 1)
0 ]






𝑫(𝑿(𝑡))
− [
0
0
0
𝐴 sin(𝜔𝑡)
]

𝑩(𝒕)
= [
0
0
0
0
]
(2)
The above equation can be written in compact form as,
𝑭(𝑿) = 𝑮 𝑿(𝑡) + 𝑪 𝑿̇(𝑡) + 𝑫(𝑿(𝑡)) − 𝑩(𝑡) = 𝟎 (3)
The expression in (3) represents system of Nonlinear Differential Algebraic equations. The solution
vector 𝑿(𝑡) and the input vector 𝑩(𝑡) are time varying. At time, 𝑡 = 𝑡𝑛, 𝑿(𝑡) and 𝑩(𝑡) can be written
as 𝑿𝒏 and 𝑩𝑛, respectively.
𝑭(𝑿𝒏
) = 𝑮 𝑿𝒏 + 𝑪 𝑿̇
𝑛 + 𝑫(𝑿𝑛
) − 𝑩𝑛 = 𝟎 (4)
ECSE 343:W2021
2
In this problem, we will use the Backward Euler formula give by
𝑿̇
𝑛 =
𝑿𝑛 − 𝑿𝑛−1
Δ𝑡
(5)
where Δ𝑡 is the length of the time step. Upon substituting (5) in (4) we get the following difference
equation
𝑭(𝑿𝒏
) = (𝑮 +
1
Δ𝑡
𝑪)𝑿𝑛 + 𝑫(𝑿𝑛
) − 𝑩𝑛 −
1
Δ𝑡
𝑪𝑿𝑛−1 = 𝟎
(6)
By using the Backward Euler approximation we have reduced the system of Nonlinear Differential
Algebraic Equations in (4) to a system of Nonlinear Difference equations in (6). Using (6) we can
compute 𝑿𝑛 if we know 𝑿𝑛−1. Note that in order to solve (6) at each time step we need to use the
Newton-Raphson Method.
In order to use Newton Iteration, you need to be able to evaluate 𝑭(𝑿𝒏
). You also need to be able to
evaluate the jacobian of system of nonlinear equations in (6) is given as
𝝏𝑭(𝑿𝒏
)
𝝏𝑿𝒏
= (𝑮 +
1
Δ𝑡
𝑪) +
𝝏𝑫(𝑿𝒏
)
𝝏𝑿𝒏
(8)
where 𝝏𝑫(𝑿𝒏)
𝝏𝑿𝒏
is the Jacobian of the diode vector and it given by
𝝏𝑫(𝑿)
𝝏𝑿 =
[





0 0 0 0
0
𝜕𝐼𝐷
𝜕𝑉2
𝜕𝐼𝐷
𝜕𝑉3
0
0
−𝜕𝐼𝐷
𝜕𝑉2
−𝜕𝐼𝐷
𝜕𝑉3
0
0 0 0 0]





=
[






0 0 0 0
0
𝐼𝑆
𝑉𝑡
(𝑒
𝑉2−𝑉3
𝑉𝑡 ) −
𝐼𝑆
𝑉𝑡
(𝑒
𝑉2−𝑉3
𝑉𝑡 ) 0
0
−𝐼𝑆
𝑉𝑡
(𝑒
𝑉2−𝑉3
𝑉𝑡 )
𝐼𝑆
𝑉𝑡
(𝑒
𝑉2−𝑉3
𝑉𝑡 ) 0
0 0 0 0]






(9)
Thus, equation (8) becomes,
𝝏𝑭(𝑿𝒏
)
𝝏𝑿𝒏
=
[






1
50 −
1
50 0 1

1
50
1
50 0 0
0 0
1
50 0
1 0 0 0]






+
1
Δ𝑡
[
0 0 0 0
0 0 0 0
0 0 10−6 0
0 0 0 0
] +
[






0 0 0 0
0
𝐼𝑆
𝑉𝑡
(𝑒
𝑉2−𝑉3
𝑉𝑡 ) −
𝐼𝑆
𝑉𝑡
(𝑒
𝑉2−𝑉3
𝑉𝑡 ) 0
0
−𝐼𝑆
𝑉𝑡
(𝑒
𝑉2−𝑉3
𝑉𝑡 )
𝐼𝑆
𝑉𝑡
(𝑒
𝑉2−𝑉3
𝑉𝑡 ) 0
0 0 0 0]






(10)
Starting with an initial guess 𝑿𝒏
(0)
for vector 𝑿𝒏, you can obtain an improved guess as shown in (11)
𝑿𝒏
(1) = 𝑿𝒏
(0) − (
𝝏𝑭(𝑿𝒏
)
𝝏𝑿𝒏
|
𝑿𝒏=𝑿𝒏
(0)
)
−𝟏
𝑭 (𝑿𝒏
(0)
) (11)
ECSE 343:W2021
3
Repeating the above process for k iteration we get,
𝑿𝒏
(𝑘+1) = 𝑿𝒏
(𝑘) − (
𝝏𝑭(𝑿𝒏
)
𝝏𝑿𝒏
|
𝑿𝒏=𝑿𝒏
(𝑘)
)
−𝟏
𝑭 (𝑿𝒏
(𝑘)
) (12)
The above procedure is repeated until the following two convergence conditions are simultaneously met,
• The function value at new guess point is sufficiently small, i.e., ‖𝑭(𝑿𝒏
(𝑘+1)
)‖
2
< 𝜖𝑡𝑜𝑙𝑒𝑟𝑎𝑛𝑐𝑒
• The difference between the two consecutive solutions is sufficiently small, i.e.,
‖𝑿𝒏
(𝑘+1) − 𝑿𝒏
(𝑘)

2
< 𝜖𝑡𝑜𝑙𝑒𝑟𝑎𝑛𝑐𝑒
Upon solving the above equations we obtain the solution 𝑿𝑛 for time 𝑡 = 𝑡𝑛, we repeat the above
procedure for all the time values ranging from 𝑡1,𝑡2, … ,𝑡𝑛, … , 𝑡𝑠𝑡𝑜𝑝.
In other words, start with time 𝑡1, solve the nonlinear equations in (6) to obtain 𝑿1. Use 𝑿0 =
[0 0 0 0]
𝑇
, at 𝑡0 = 0 as an initial condition. The nonlinear equations in (6) are solved using the
Newton-Raphson equations described in (12). After obtaining 𝑿1, solve the nonlinear equations in (6) at
time 𝑡2 using the Newton-Raphson to obtain 𝑿2. Repeat this process for all time points.
This document showed how to solve the Nonlinear-Differential Equations using the Backward Euler
method. In this project your task is to compute find the transient response of the circuit, which means find
the solution vector for all values of time. The use transient voltage source with amplitude equal to 5V
with the frequency of 60Hz. Use saturation current for the diode, 𝐼𝑆 = 10−13 and the thermal voltage of
the diode,𝑉𝑇 = 0.025. Simulate, the circuit for 0.5s with the time step, Δ𝑡 = 10−4
. Use the tolerance
value, 𝜖𝑡𝑜𝑙𝑒𝑟𝑎𝑛𝑐𝑒 = 10−5
, to check for convergence of the Newton-Raphson. Plot the obtained solution
for V1, V2, and 𝑉3.
Submit a typed report not more than 2 pages describing your implementation. Discuss in the
report, about the initial guess you used for the time points 𝑡2, … ,𝑡𝑛, … , 𝑡𝑠𝑡𝑜𝑝. Does the result
obtained for node voltage V3 consistent with diode response? How did you check if the simulation results
are correct?
Also submit your MATLAB code.

More products