Lesson 4: Van der Pol Circuit and ode3s 4. Applied Problem. A series LRC circuit when coupled via mutual inductance with a triode circuit can generate a sequence of pulsing currents that have very rapid rates of changes. Because of the very large derivatives, there can be very strong constraints on the step sizes so that large numbers of time steps are required. Such systems are called stiff and require special numerical methods. The Matlab command odedemo illustrates some stiff differential equations and two stiff solvers called ode3s and ode5s. 4. Differential Equation Model. A series LRC circuit with imposed voltage is modeled by a single second order differential equation for the charge, Q(t), L Q'' + R Q' + /C Q = V(t) and Q() and Q'() are given. The current is defined to be I = Q'. This equation is derived from Kirchhoff's law, which requires the sum of the voltage drops to be equal to the imposed voltage, V(t). The voltage drops are L Q'' for self inductance, R Q' for resistance and /C Q for capacitance. In our problem (see the figure below), I is the current in the left circuit. V(t) = M i' where M is the mutual inductance and i(t) is the current in the triode circuit (the right circuit in the figure below). In the center circuit the voltage drop across the capacitor is /C Q, and it must be equal to the grid voltage, x(t), in the triode. Thus, C x(t) = Q(t) and C x' = Q' = I. The x(t) and i(t) are related by empirical observations so that i = a x - b x 3 where
the a and b are constants determined via curve fitting to data. Thus, i' = a x' - b 3x x' and i' = a I/C - b 3(Q/C) I/C. This allows one to write the system in terms of a single second order equation. Moreover, by scaling the time and charge variables, this single equation will have the form, where y and y' are the scaled charge and current and µ is a function of the parameters in the above model, y'' - µ( - y )y' + y =. This is called Van der Pol's equation, and for large µ this is a stiff differential equation. Figure: Van der Pol Circuit
3 The above second order differential equation can be equivalently written as a coupled system of two differential equations for y (t) = y(t) and y (t) = y'(t). By definition the derivative of y must be y. The derivative of y is y'' which we can solve for via the second order differential equation. Thus, the equivalent coupled system is y ' = y y ' = µ( - y )y - y with y () = y() and with y () = y'(). Matlab's ode3s and ode5s can be used to solve such systems. As a first step in the study of this system, we consider the steady state solutions, which are defined by both derivatives being set equal to zero so that = y = f (y, y ) and = µ( - y )y - y = f (y, y ). * * The two solutions are given by y = and y =. The Jacobian of [f f ]' is f = f f = * µ y y y y J * * y f y µ ( (y ) ) =. µ The steady state solutions are not stable because the Jacobian, the derivative matrix, evaluated at (,) has positive real eigenvalues, µ/ ± ((µ/) -) /. Moreover, if µ is large, then the time dependent solutions will have large rates of change so that the system is stiff. 4.3 Method of Solution. We will use Matlab's stiff solver called ode3s. This is much more sophisticated than the simple Euler-trapezoid method that was used in the previous lesson. However, its formulation is some what similar to the implicit nature of each time step in the Eulertraperzoid method.
4 4.4 Matlab Implementation. The single Van der Pol second order differential equation must be converted, as above, to a system of differential equations for the scaled charge, denoted by the symbol y(), and for the scaled current, denoted by the symbol y(). The m-files for this system are called ypvdpol.m and vdpol.m. In the first calculation we use µ = and the final time should be about ten times µ. The graph is for the scaled charge versus time. The graph for the scaled current has a series of spikes; in the Van der Pol circuit this might be series of flashes if the resistance was a light bulb. function ypvdpol=ypvdpol(t,y) ypvdpol() = y(); ypvdpol() = *(-y()^)*y()-y(); ypvdpol= [ypvdpol() ypvdpol()]'; % your name, your student number, lesson number clear; tf = ; % choose tf about ten times mu yo = [ ]; [t y] = ode3s('ypvdpol',[ tf],yo); plot(t,y(:,)); title('your name, your student number, lesson number') xlabel('time') ylabel('charge') %plot(y(:,),y(:,));
.5 your name, your student number, lesson number 5.5.5 charge -.5 - -.5 - -.5 3 4 5 6 7 8 9 time 5 5 current spikes -5 - -5 3 4 5 6 7 8 9 time
6 4.5 Numerical Experiments. In the next calculation we decreased µ from to, and have graphed the output as scaled current versus scaled charge, and as scaled charge and current versus time. Note the derivatives are not as large for the smaller value of µ. 3 van der Pol with mu =. current - - -3 -.5 - -.5 - -.5.5.5.5 charge
7 3 van der Pol with mu =. charge and current - - -3 3 4 5 6 7 8 9 time 4.6 Additional Calculations. Consider the above Van der Pol equation with y() = 3., y'() =., variable µ and using ode3s and ode5s. (a). State the second order differential equation and the equivalent system of differential equations. (b). (c). (d). (e). Modify the ypvdpol.m and vdpop.m files. Execute the vdpol.m file for µ = +*.S. Use ode3s and ode5s. Repeat (c) for µ = 5 +*.S and +*.S. Compare the graphs and number of time steps.