ECSE597 – Assignment 3 (Solution)

$ 35.00
Category:

Description

Preliminaries
1. You can reuse and build upon your previous code for this assignment.
2. We provide you with the following additional functions that help to handle BJT elements.
a) npnBJT.m is function that adds the element BJT to the list of the BJTs. It serves a similar functionality as the diode.m function.
b) fvect.m is the function that adds the nonlinear stamp to the vector (). You can use this function to fill the () vector.
b. nljacobian.m is the function that creates/ updates the Jacobian for the nonlinear elements. Similar, to diode add the Jacobian for the BJT in this function.

3. For adding the AC sources to the circuit, use the function named vol_ac.m. The vol_ac.m function creates a global variable bac. The variable bac contains the contribution of DC sources.
The addition of DC sources to the circuit can be done using the vol.m function.
4. In your submission please provide all code in a zip file in a way that allows us to run the testbenches ourselves (include all code, not just the recent one).
4. Also submit a pdf file containing the answers to the questions, the output plots and the code for functions you have written for this assignment.
Question I
Write a matlab function dcsolvealpha.m that finds the dc solution of the augmented system:
+ () = The functions is defined as follows:
function Xdc = dcsolvealpha(Xguess,alpha,maxerr)
% Compute dc solution using newtwon iteration for the augmented system % G*X + f(X) = alpha*b % Inputs:
% Xguess is the initial guess for Newton Iteration
% alpha is a paramter (see definition in augmented system above)
% maxerr defined the stopping criterion from newton iteration: Stop the % iteration when norm(deltaX)<maxerr % Oupputs:
% Xdc is a vector containing the solution of the augmented system

Deliverables:
1. Submit the matlab file dcsolvealpha.m containing your function
2. Include the code above in your PDF file submission for the assignment.

Question II
function Xdc = dcsolvecont(n_steps,maxerr)
% Compute dc solution using newtwon iteration and continuation method % (power ramping approach) % inputs:
% n_steps is the number of continuation steps between zero and one that are % to be taken. For the purposes of this assigments the steps should be
% maxerr is the stopping criterion for newton iteration (stop iteration
% when norm(deltaX)<maxerr

2. Test this function by finding the dc solution (at node Vo) of the following diode circuit at three different values of Vi (-10V, -2V, and 8V). Use 10 continuation steps in this test. Note, we provide the netlist for this circuit in the file Sedra4_93.m. All diodes in this circuit have Is=2e-15A and Vt=26e-3V.
3. Run the provided script: TestBenchDiodeckt4_93.m shown in Figure 1, This script will use your dcsolvecont.m function in order to compute and plot Vo as a function of Vi.

Deliverables
1. The matlab function dcsolvecont.m
2. A pdf file containing the matlab function dcsolvecont.m. The solutions found in part 2, and the plot provided by the script in part

Figure 1: Diode circuit.

Question III
Using the transistor model shown in Appendix, add the contribution of the BJT in the circuit simulator. Complete the contribution of BJT in MATLAB functions named f_vect.m and nlJacobian.m.

Deliverables:
After completing the stamp of the BJT in circuit simulator. Run the file named BJT_CB.m containing the circuit shown below in Figure 2.

Figure 2: BJT circuit.
Compute the DC solution of the circuit shown in Figure 2 for the following values of base node, = 4V, 6V and 0V.
1. Run the BJT_CB.m using the dcsolve.m function you implemented in Assignment 1. Report your observations.

2. Run the BJT_CB.m using the dcsolvecont.m function you implemented in Question II. Report the values of the nodal voltages obtained after using dcsolvecont.m.

Question IV
Plot the AC response of the circuit shown in Figure 3 between 0Hz to 5000Hz. Complete the function names nlACresponse.m and write your algorithm for computing the AC response. To run the file named BJT_CE.m containing the circuit shown below in Figure 3.

Figure 3: Common Emitter circuit.
1. Run the BJT_CE.m and plot the gain at node 7 for the frequencies between 0 to 106Hz obtained and include it in the assignment.

Appendix
Figure 1 below shows the Ebbers-Moll model of a NPN BJT transistor. In this assignment you are required to model the BJT using the MNA equations.

Figure 4: Ebbers-Moll model of BJT.
The currents and , are the currents in the Base-Emitter and Base-Collector Junction, respectively. The equations of junction currents and are shown below in (1.1) and (1.2), respectively.
(1.1)
= ( − 1)
(1.2)
= ( − 1)

is voltage difference between base and emitter nodes. is voltage difference between base and collector nodes. and are the saturation current and thermal voltages for the BaseEmitter and Base-Collector Junctions. and are forward and reverse coefficients.
The using the Ebers-Moll model for , emitter current, and , collector current, are obtained as shown in (1.3) and (1.4)
= − + (1.3)
= − +

Using the Kirchhoff’s Law, we can obtain the equation for base current (1.4)
= −( + ) (1.5)
= − + − (1.6)

These are the nonlinear equations of currents and can be stamped in the MNA equation as shown in (1.7)

0 0 0 − + 0
[0 0 0] [] + [ − + − ] = [0]
⏟0 0 0 ⏟ ⏟ − + ⏟0
(1.7)
()

As can be in seen in (1.7), only nonlinear vector () contains the contribution of the BJT.

Reviews

There are no reviews yet.

Be the first to review “ECSE597 – Assignment 3 (Solution)”

Your email address will not be published. Required fields are marked *