Worksheets/Eulers Method Circuits
From charlesreid1
Background
Setup of basic equation describing a simple inductor circuit - how does an inductor work, what is an inductor used for, how can we model the inductor
Inductor coil in electrical circuit: solving the differential equation for current
Setting up the use of Simpson's Rule to implement Euler's Method and integrate Right Hand side, with Delta x instead of Delta t.
Electrical circuit
Solving a differential equation
Different right-hand sides, different time steps
Content
Introduction
Today we will be using a spreadsheet program to implement Euler’s Method and solve a differential equation. Euler’s Method ties together the concepts of numerical integration and differential equations. We will implement Euler’s Method to solve for the current in the following circuit:
This circuit is described in Example 4 of Section 9.5 of the Stewart Calculus textbook.
Euler's Method
We can use Euler’s Method to solve a differential equation of the general form:
$ \frac{dy}{dt} = F(t,y) $
We start by chopping up the time domain into a set of steps of size $ \Delta $. We will evaluate the solution, and the right‐hand side of the equation, at each timestep.
Start by turning the derivative on the left‐hand side into a finite difference quotient:
$ \frac{dy}{dt} \approx \frac{\Delta y}{\Delta t} $
Next, using the fact that $ \Delta y = y(t+\Delta t)-y(t) $, we can write a relationship between the solution at a given time step $ t_i $, denoted $ y_i = y(t_i) $, and the solution at the next timestep $ t_{i+1} = t_i + \Delta t $, denoted $ y_{i+1} $:
$ y_{i+1} = y_i + \Delta t \left( F(t,y) \right) $
This is the equation you will be implementing in a spreadsheet.
The sequence of timesteps begins at some initial time $ t_0 $ corresponding to an initial state of the system $ y_0 $. This initial condition yields an estimate of the solution after the first timestep:
$ y_1 = y_0 + \Delta t \left( F(t_0,y_0) \right) $
This yields an estimate of the solution at the next timesteps,
$ y_2 = y_1 + \Delta t \left( F(t_1,y_1) \right) $
$ y_3 = y_2 + \Delta t \left( F(t_2,y_2) \right) $
and so on.
The Circuit Differential Equation
The General Differential Equation
On the right is a circuit containing four components: a battery (which is a source of electric current), a resistor R, an inductor L, and a switch to turn the circuit on and off.
We are looking for the current as a function of time. However, current is not conserved – we have to start with something that’s conserved. In this circuit, voltage is conserved. The voltage supplied by the battery will match the voltage drops across the components.
The current - that's what we're solving for - is denoted $ I(t) $.
The voltage supplied by the battery is denoted $ E(t) $ and is a constant function:
$ E(t) = 60 V $
Across the resistor, the voltage dorps by7 an amount proportional to the resistance and the current:
$ \Delta V_{resistor} = R I $
Across the inductor, the voltage drop depends on the rate of change of the current:
$ \Delta V_{inductor} = L \dfrac{dI}{dt} $
Balancing the supplied voltage with the voltage drops gives us our differential equation:
$ L \dfrac{dI}{dt} + RI = E(t) $
The Particular Differential Equation
Let us consider Stewart's Example 4 from Section 9.5, where he uses a circuit with an inductor of 4 Henries, a resistor of 12 Ohms, and a battery with a voltage of 60 Volts, corresponding to L = 4, R = 12, and E(t) = 60. Now we can solve for the current as a function of time.
For the implementation of Euler's Method to solve this circuit, Stewart selected a time step of 0.1 seconds, and a total time of 3 seconds. This makes the particular differential equation:
$ \dfrac{dI}{dt} + 3 I = 15 $
Worksheet Questions
Question 1: Find the particular differential equation corresponding to a circuit with the following components:
- Inductor of 10 Henries, L = 10
- Resistor of 20 Ohms, R = 20
- Voltage of 120 V, E = 120
Question 2: Implement the solution to this differential equation in an Euler's Method spreadsheet program. When you are finished, you should have a column of values that give you the current as a function of time. What is the limiting value of current, $ I_{\infty} = \lim_{t \rightarrow \infty} I(t) $?