Help With an Excel Program for an RLC Series Circuit

An RLC series circuit includes a resistor, inductor, and capacitor. It's no surprise then, that the math behind an RLC circuit isn't simple, either; it's a second-order differential equation.

Thanks to Euler's method, algebra students can approximate the circuit's behavior by graphing the solution with hundreds of points. Though the process requires many steps, these points can be generated through Microsoft Excel.
  1. Understanding the Equation

    • The differential equation is L(d^2Q/dt^2) + R(dQ/dt) + 1/C(Q) = Ecos(wt), where L is inductance; R is resistance; C is capacitance; E is maximum emf; w is angular frequency; and t is time. Excluding time, these are all constants and you must know their numerical values.

      Q is a function -- the charge through the circuit, which varies with time. (dQ/dt) is the time derivative of charge. If you haven't taken calculus, you can think of it as the change (or difference) in charge divided by the change in time. You should recognize this quantity as the current through the circuit, which also varies with time.

      (d^2Q/dt^2) is the second time-derivative of charge, the first derivative of current. Again, without calculus, think of this quantity as change in current divided by change in time.

    Constants

    • Enter the numerical values of the constants L, R, C, E, and w in Excel for future reference.

      In order for the algebraic way of thinking (changes, not derivatives) to approximate the differential equation, the change in time must be very small. Below your constants, type 0.001 or 0.005 (seconds); you can always change this value later.

    Excel's First Calculated Column: Time

    • For an accurate depiction of the circuit's behavior, we need hundreds of points, starting with t=0. In the first cell of your first calculated column, type "0."

      In the second cell, type "=" and click on the cell immediately above it (with the 0), type "+", and click on the cell with the value of your change in time. The result should read "=C1+B5", though your actual cell values may vary. Type dollar signs before the B and the 5 (or whatever your second cell reference is), so that the cell now reads "=C1+$B$5". Click on the bottom-right corner of this cell and drag it down four or five hundred cells.

    Second Calculated Column: Charge

    • To model the charge in the circuit, we must know the current. Since current is charge divided by time, charge is current multiplied by time.

      In the first cell of your second calculated column, type "0". In the second cell, type "=" and click on the cell immediately above it, type "+" and click on the change-in-time cell (inserting dollar signs before the letter and the number), type "*" and click on the cell diagonally up and to the right. This adds the previous charge to change in current multiplied by change in time. (Even though we haven't entered current, we know it will occupy the third column, so we can reference those cells. Don't worry about error messages at this point.) Drag the column to the same length as your time column.

    Third Calculated Column: Current

    • Follow the same procedure for current as for charge. In the first cell, type "0"; in the second, type "=" and click on the cell above it, type "+" and click on the cell up and to the right, type "*" and click on the change-in-time cell (inserting dollar signs). Drag this column to full length.

    Fourth Calculated Column: Second Derivative

    • Finally, in the fourth calculated column, use the differential equation, but solve it algebraically: (d^2Q/dt^2)=(1/L)*(Ecos(wt)-Q/C-R(dQ/dt)). Enter the right-hand side of this equation in the first cell, but click on cells instead of typing variables. Use dollar signs for each constant. Use the cells in the same row for t (first column), Q (second), and (dQ/dt) (third).

      Drag this cell down the full length, and Excel should display a number in all cells in those four columns.

    Putting it All Together

    • Now you have hundreds of points, and can graph charge (versus time) with your first two columns or current using your first and third column. If your change in time is small enough, these graphs mimic those you would see by solving the differential equation exactly.

Learnify Hub © www.0685.com All Rights Reserved