Example of lab 6matlab 201 essay

Part 1 Solutions Using Symbolic Math

Creating Symbolic Variables in MATLAB
1-2. The following codes create a symbolic variable ‘ x’ and find the roots of the equation x2-4x+7= 0:
The roots are: x= 2±3 j

Using MATLAB to Solve a Simple Problem

1-2. Using symbolic variable in MATLAB, a KVL equation is solved using the following code:
The current is equivalent to the symbolic variable II. The current computed is: II= 0. 4068 A

Part 2 Using MATLAB to Solve Node Voltage Equations

1-2. Node voltage solution using the following equation:
1. 5- VA1000-VA-3. 01500= 0

This equation is modelled in MATLAB using symbolic variable:

The node voltage computed is: VA= 2. 1 V

3-4. The node voltage equations are:

The following codes are inputted in MATLAB to solve these node voltage equations:
The computed node voltages are: VB= 23. 2 V, VC= 21

Part 3 Exponential Response of RC Circuits

1-2. The time constant τ is computed using R*C:
In this case, the power of 10 for the capacitance value 10µF is inputted using ‘ e’. The resulting time constant is: τ= 10 ms
3-6. The series of time values are initialized to the variable ‘ t’. Then, the capacitor and resistor voltages (Vc and Vr) are computed using the following equations:
VCt= 10 1- e-tτ, VRt= 10e-tτ

The following code are inputted in MATLAB to compute for the voltages and plot the results:

The resulting graph is shown in the following figure: