Solving differential equations using operational amplifiers Introduction: An operational amplifier ("op amp") is a differential-input, high gain voltage amplifier, usually packaged in the form of a small integrated circuit. The term "operational" dates back to the early days of analog computers when these devices were employed in circuits that performed mathematical operations such as addition, subtraction, integration, and the solution of differential equations. Today's op amps are used in a much wider variety of circuits and operate at considerably lower voltages and powers; however, the name remains. The modern operational amplifier is a very useful and versatile building block for thousands of circuits in applications as diverse as audio, video, communications, process control and instrumentation. Analog computation: There are two main types of computer. What you probably think of when you say "'computer" is a digital computer. Numbers are represented by sets of 1's and 0's where 1 and 0 are represented by two different voltages, (typically +5V, and 0V). Operations are simple logical operations (i.e. AND, OR, etc.) or arithmetic operations (i.e. addition or subtraction). Calculus-type operations are very complicated to do. The other type is the analogue computer, where numbers are represented by continuously varying quantities. Typically, voltage is the quantity used. You are already familiar with OPAMP circuits for different mathematical operations using various voltages. These circuits can be combined to solve various differential equations. Some exemplary circuits are given in this experiment. The heart of the technique is the op amp integrator circuit shown in Figure 1. The output of the circuit is given as follows: 1 1 Vout = − Vin dt = − Vin ∫ RC jωRC Fig. 1 The following experiments are exercises in problem-solving. It is instructive to think of each experiment as consisting of four steps. The first step is the building of a 'model' of the problem. The model is a mathematical description of the problem derived from known physical laws and/or experimental data after making reasonable simplifications. It will include a set of algebraic and/or differential equations, initial conditions, values of coefficients and range of variables of interest. The second step is to rearrange the equations to get a set of 'computer equations' suitable for interpretation. The third step is to interpret the equations term-by-term and from there construct the computer. The fourth step is running the computer and recording the output. The output, a plot of voltage against time, may be viewed on a SCOPE or may be plotted on an x-y recorder, with the x-input connected to a 'Time Generator". Experiment 1: A Time Generator (The Integrator Revisited) Recall that the integrator integrates with respect to real time. Some processes of interest may vary with real time too quickly or too slowly to be computed conveniently. Therefore, the passage of real time itself can be simulated by a voltage varying linearly (with time) and the output of the computer can be expressed with respect to this voltage. The voltage simulating time can also aid in displaying the output by providing the time base of an oscilloscope or the x-drive of an xy plotter. Fig. 2 For the circuit in Fig. 2, with Vi = -1 Volt, D.C. and S a switch which is closed at time, t = 0, and Vi0 = 0, the output voltage T seconds after the closure is Also, the voltage has increased at the rate of 1 volt/sec. Clearly, the voltage is now simulating time (in second) at a ratio of 1:1. The circuit of Fig. 2 can also be thought of as a clock with displays the passage of time following the closure of S. The 1:1 ratio can be changed by changing the forward gain of the integrator. Procedure: Set up the circuit of Fig. 2 using an Op-Amp. Use a multimeter or a SCOPE to display the output. To obtain Vi use a D.C. power supply. Momentarily short circuit the capacitor, C. This procedure sets the initial condition of 0 volts. Close the switch and record the output Vo(t) on the meter or oscilloscope. Explain your observations. To return to zero, the starting condition short circuit C momentarily. The output should return to zero. Once at zero, you are ready for another run. With the construction of this real time computer, you now have a device which will prove useful in the experiments to follow. ࢊ࢟ Experiment 2 – Solving ࢊ࢚ ࢟ ൌ ࢉ This is an equation which may describe damped oscillation or charge on a capacitor or a simple radioactive decay. Let’s take the case where y(t) is displacement in meter and assume arbitrary values of k and c such that the equation has the following form ࢊ࢟ ࢟ ൌ ࢊ࢚ As an analog, we can let the output of the integrator be proportional to displacement, i.e. Vo(t) = K y(t) Note that in order to maintain linear operation and obtain an accurate solution, we must always be careful to scale output voltages so as not to saturate the op amp. Assuming that VSAT ≈ 12 Volts for the op amp and that the maximum of y(t) ≤ 12m, we can design an op amp circuit to simulate the system by scaling the output voltage of the integrator to be 1 Volt/m, i.e., Vo(t) = y(t) or K = 1 Volt/m. Figure 3 shows one of many possible op amp circuits that can be used to simulate the given differential equation. Fig. 3 Procedure: Set up the circuit in Fig. 3. Note that three op amps are used: one as a summing amplifier, one as an integrator, and one as an inverting amplifier. Also, switches and DC voltages, shown as batteries, are included in the circuit in order to (1) the initial condition of y(0) = -1m (Vo2(0) = -1V) to the feedback capacitor during "reset", i.e., t < 0, and (2) the step input of 2m (V1 = 2V) to the input of the integrator during "operation", i.e., t ≥ 0. Connect the y voltage output to the y input of a SCOPE, and connect the x input to the time generator circuit of Experiment 1. The analog computer simulation shown in Figure 3 was obtained as follows. First, the output of the integrator was chosen to represent the displacement, i.e., Vo2 = y(t). Choosing Ri = 1 MΩ and C = 1 µF so that RiC = 1 second, Vo1 = - dVo2/dt = - dy/dt = -2 + 5 y = - 2 + 5 Vo2 Resetting the time generator circuit as in Experiment 1, observe the plots of y vs t obtained (as a solution to this equation) by switching on the circuit. Find solutions for various values of k and various initial values of y. Experiment 3 – Solve ࢊ ࢟ ࢊ࢚ ࢊ࢟ ࢊ࢚ ࢟ ࢉ ൌ Try to set up a circuit to solve the above equation. Hint: You will need two integrators, a summer and some inverting circuits to realise the solution. Choose some arbitrary values of constants and keep in mind that the opamp will invert the sign at its output. Suggested References: 1. Supplementary manual for operational amplifier (4th sem Advanced electronics lab manual) 2. Jacob Millman, Microelectronics 3. J. Millman and C.C. Halkias, Integrated Electronics