Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

ELEC 201: Circuit Analysis I

Additional problems 5 (for practice on your own--no need to submit)

The objective is to design and implement a numerical solver for an elaborate time-dependent circuit.

1. Consider the circuit below. The goal is to calculate and plot the behaviour of the voltages of all the elements for
t > 0.

R1 C1
R2
+
Vin -
L1
C2

a) Assume that Vin has been zero for a long time before t = 0. At t = 0, it jumps to V 0 and stays constant at that
value forever after.
b) Assume that Vin has been zero for a long time before t = 0. At t = 0, it starts as a sinusoidal function with an
amplitude of V0 and an angular frequency of ω0. Its phase is such that the voltage is 0 at t = 0.

In order to complete this exercise, follow an approach generally similar to what you did for the numerical portion
of assignment 3. The idea is, using KVL/KCL/element relations, to find the time derivatives of some of the quantities
in terms of other quantities, and propagate in time step-by-step. Note that analytical solutions are not accepted—
this is a numerical exercise.

Write a computer code that asks the user for the values of all the parameters, implements the time propagation
algorithm, and plots all the voltages as a function of time on the same graph (use proper legends and line
types/markers to make sure the different curves are distinguishable). There will be one graph for part a and one
graph for part b. Both parts are to be implemented in the same code.

2. Imagine now that we want to extend this approach to an arbitrary circuit, which will be defined by the user of
your code. How would you go about implementing such a general circuit solver, in terms of accepting it from the
user as an input, implementing the solution algorithm, and reporting the results back to the user? You do not need
to actually write a code for this part—just explain your thoughts about the approach you would take, the challenges
you think you would face, and how you would address them.

You might also like