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 Harmonic Balance elements. a) makeHB_Gmat.m this function creates the matrix ๐ฎฬ using the matrix ๐ฎ. This function is already implemented for you.
b) makeHB_Cmat.m this function creates the matrix ๐ชฬ using the matrix ๐ช. This function is already implemented for you.
c) vol_HB.m this function adds the single tone harmonic balance sources to the circuit. This function is already implemented for you. You need to code this function using the provided framework.
3. You need to implement the following functions using the provided framework.
a) make_Gamma.m this function creates the Direct Fourier Transform (DFT) matrix. It takes the number of harmonics, H, as input and outputs the DFT matrix.
b) HB_fvect.m is the function that adds the Harmonic Balance based nonlinear stamp to the vector ๐ญฬ (๐ฟฬ ). This function takes the vector of Fourier coefficients of nodal voltages, ๐ฟฬ , as input and then returns the ๐ญฬ (๐ฟฬ ).
c) HB_nljacobian.m is the function that creates/updates the Harmonic Balance Jacobian, ๐๐ญฬ (๐ฟฬ ) ฬ , for the nonlinear elements. This function also takes ๐ฟฬ (i.e. the vector of Fourier ๐๐ฟ coefficients of nodal voltages) as input.
d) HBsolve.m this function solves the Harmonic Balance system of equations using Newton-Raphson Method. This method requires initial guess, and the number of Harmonics as input and returns a vector of nodal Fourier coefficients as output.
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).
5. 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 Implement the functions described in above to solve the Harmonic Balance equation described as ๐ฎฬ ๐ฟฬ + ๐ ๐ชฬ ๐ฟฬ + ๐ญฬ (๐ฟฬ ) = ๐ฉฬ (๐ ) where ๐ = 2๐ โ ๐๐๐๐๐ข๐๐๐๐ฆ
After implementing the required functions, run the file TestBench.m to simulate the circuit shown in Figure 1. Figure 1 shows a half-wave rectifier connected to a 60Hz sinusoidal source with 1Volt amplitude.
Figure 1: Half-wave Rectifier.
Deliverables: 1. Simulate the above circuit and then plot the time-domain steady state response for the circuit at nodes 1, 2, and 3. 2. To verify your simulation, compare it with the nonlinear transient response you implemented in the previous assignments. 3. Include the code above in your PDF file submission for the assignment.