Home / Week 9 Exercises / Circuit Solver: Op-Amp

Circuit Solver: Op-Amp

The questions below are due on Tuesday April 16, 2019; 11:00:00 PM.
 
You are not logged in.

If you are a current student, please Log In for full access to this page.
Music for this Problem

1) Op-Amps

In this exercise, we will add support for operational amplifiers to the circuit solver we built in previous exercises. You should do your work in circ.py from that problem's code distribution, or wherever you did your work for the previous circuit solver exercises.

We can model an op-amp as a voltage-controlled voltage source, which is a two-port (i.e., a circuit that is defined by two currents and two voltage differences).

In the voltage-controlled voltage-source model of an op-amp, the left port represents the positive and negative inputs of the op-amp, and the right port represents a voltage source whose output is K times the potential difference between the two input terminals.

Write a subclass of OnePort called VoltageSensor to represent the input part of an op-amp. Instances of VoltageSensor should be initialized with three strings, representing e_{a1}, e_{a2}, and i_a in the diagram above.

Now write a subclass of OnePort called VCVS to represent the voltage-controlled voltage source. Instances of VCVS should be initialized with five inputs. The first represents the instance of VoltageSensor associated with this voltage-controlled voltage source. The second, third, and fourth are strings representing e_{b1}, e_{b2}, and i_b, respectively. The final input should be an optional value of the op-amp gain K, which defaults to K=10^6.

Finally, write a function called op_amp. This function should take arguments e_{a1}, e_{a2}, i_a, e_{b1}, e_{b2}, i_2, and K (in that order), and it should return a list containing an instance of VoltageSensor and an instance of VCVS to represent the op-amp. Notice that e_{b2} will generally be the ground node when we create instances of op-amps.

Enter your definitions for VoltageSensor, VCVS, and op_amp below:

  No file selected

A Python Error Occurred:

Error on line 8 of Python tag (line 224 of source):
    from lib601.circ import *

ModuleNotFoundError: No module named 'lib601'

2) Solving

Now use your circuit solver to solve the following circuit, which should look familiar from an earlier exercise:

when:

  1. R_1 = 60.0M\Omega
  2. R_2 = 1.3k\Omega
  3. R_3 = 130.0k\Omega
  4. I_{PMT} = 560.0pA

Store a list of circuit components representing the circuit above in the variable circuit_components. Use the variable name 'transamp_out' for the output of the transimpedance amplifier (the left-most op-amp), and 'v_out' for the output of the inverting amplifier (the right-most op-amp). Use the name 'gnd' for your ground node.

You do not need to re-paste your class definitions from the previous exercises below. Staff versions of these solutions are already available for you

  No file selected
Use your solver to determine the following quantities. Enter your answers as decimal numbers, accurate to four decimal places. Assume that all voltages are measured relative to gnd.

A Python Error Occurred:

Error on line 3 of question tag.
    csq_soln=solved['i_r3']/1e-6

NameError: name 'solved' is not defined

A Python Error Occurred:

Error on line 3 of question tag.
    csq_soln=solved['e3']/1e-6

NameError: name 'solved' is not defined

A Python Error Occurred:

Error on line 3 of question tag.
    csq_soln=solved['i_transamp']/-1e-6

NameError: name 'solved' is not defined