Ordinary differential equations
A circuit with a capacitor or an inductor is described not by an algebraic equation but by a differential one. Solving it means predicting how the circuit evolves in time.
01Equations where the unknown is a function
A differential equation relates a function to its derivatives. Its unknown is not a number: it is the entire function. Differential equations appear as soon as anything changes in time, and in electronics they appear as soon as there is a capacitor or an inductor, because their laws are already derivatives.
The order is that of the highest derivative, and it equals the number of elements that store energy: one capacitor, first order; one capacitor and one inductor, second order. The general solution has as many constants as the order, and those constants are fixed by the initial conditions, which are the capacitor voltage and the inductor current at t = 0: precisely the quantities that cannot jump.
02First order
Separable variables
If the equation can be written as g(y)dy = f(x)dx, you integrate both sides and you are done. It is the most direct method and it solves the discharge of a capacitor:
RC·dv/dt + v = 0 separates as dv/v = −dt/(RC). Integrating: ln v = −t/(RC) + k, and therefore v(t) = V₀·e−t/RC.
The constant τ = RC is the characteristic time: at τ, 37% of the initial value remains, and after five time constants, less than 1%.
First-order linear equations
This method gives the charging of a capacitor with a constant source, and also with a variable source, which is the case that cannot be solved “by heart.”
03Second order: the characteristic equation
For a·y″ + b·y′ + c·y = 0 we propose y = est. Substituting leaves the polynomial a·s² + b·s + c = 0, the characteristic equation, and everything depends on its roots:
| Roots | Solution | In an RLC circuit |
|---|---|---|
| Distinct real s₁ ≠ s₂ | C₁es₁t + C₂es₂t | Overdamped: settles without oscillating, but slowly |
| Double real s | (C₁ + C₂t)·est | Critically damped: as fast as possible without oscillating |
| Complex α ± jωd | eαt(C₁cos ωdt + C₂sin ωdt) | Underdamped: oscillates and dies out |
These roots are the poles of the circuit, and they are the same eigenvalues as those of the matrix of the system written in state variables. If the real part is negative, the response dies out and the circuit is stable; if it were positive, it would grow without bound.
04The RLC, live
Change the components and watch what happens to the roots and to the response. It is the same circuit that appears in every transient and in every second-order control system.
05Free response and forced response
With a source, the solution is built in two parts:
To find yp for typical sources, we propose a function of the same type: a constant for a DC source, a sinusoid of the same frequency for a sinusoidal one, a polynomial for a ramp. That is the method of undetermined coefficients, and its version for sinusoids is, at bottom, the phasor calculus of alternating current: in steady state everything reduces to complex numbers because the transient part has already died out.
If the source drives exactly at the natural frequency and the damping is small, the particular solution grows: this is resonance. In a tuned circuit it is sought; in a mechanical structure it is avoided. The mathematics is the same.
06The same equation, many systems
| System | Equation | Analogy |
|---|---|---|
| Series RLC | \( L\cdot q″ + R\cdot q′ + \dfrac{q}{C} = E \) | — |
| Mass, spring and damper | \( m\cdot x″ + b\cdot x′ + k\cdot x = F \) | L ↔ mass, R ↔ friction, 1/C ↔ spring constant |
| Servomotor with feedback | \( J\cdot \theta ″ + b\cdot \theta ′ + k\cdot \theta = \tau \) | Same behavior: overshoot, settling time |
| Cooling of a component | \( C_t \, T' + \dfrac{T - T_{amb}}{R_t} = P \) | First order: thermal resistance and thermal capacitance |
The fact that they all share the equation explains why an electronics engineer can reason about a mechanical system: the units change, not the mathematics. That is also why the design of a control loop is done with the same parameters ζ and ω₀, as seen in PID control.
07In the lab
Build a series RLC with L = 10 mH and C = 10 nF and drive it with a low-frequency square wave. Try R of 100 Ω, 2 kΩ and 10 kΩ and record the three responses. Compare the measured oscillation frequency with the calculated ωd.
From a captured underdamped response, measure the overshoot and the period of the oscillation, and from them solve for ζ and ω₀. Compare with the values calculated from R, L and C.
Measure the charging of an RC and verify 63% at t = τ. Then put two RC stages in cascade and observe that the response is no longer a simple exponential: it has become second order.
08Common mistakes
- Forgetting the constant of integration, which is the initial condition of the circuit.
- Confusing the general solution with the particular one: without initial conditions the problem is not solved.
- Misusing the initial conditions: they are vC(0) and iL(0), not the capacitor current or the inductor voltage, which can indeed jump.
- Believing that a second-order circuit always oscillates: with ζ ≥ 1 it never does.
- Mixing units in ω₀ = 1/√(LC): L in henrys and C in farads.
- Discarding the transient in applications where it is exactly what matters: switching, motor starting, protection.
09Self-assessment
Solve v′ + v/τ = 0 with v(0) = V₀.
v(t) = V₀·e−t/τ.
What is the order of the equation of a circuit with two capacitors and one inductor?
Third: there are three elements that store energy (if they are independent of each other).
For L = 10 mH and C = 10 nF, what is ω₀ and at what frequency is it?
ω₀ = 1/√(10−2·10−8) = 105 rad/s, that is, f₀ = ω₀/2π ≈ 15.9 kHz.
What R makes that circuit critical?
α = ω₀ → R = 2L·ω₀ = 2·0.01·105 = 2000 Ω.
If the roots are −100 ± j3000, what is the response like?
Underdamped: it oscillates at 3000 rad/s with an envelope e−100t, which decays with a time constant of 10 ms. It is stable.
Why is phasor calculus equivalent to finding the particular solution?
Because the phasor describes the sinusoidal steady state: the homogeneous part, the transient, has already died out.
10Further reading
- Dennis G. Zill. A First Course in Differential Equations with Modeling Applications. 9th ed. (Spanish edition, “Ecuaciones diferenciales con aplicaciones de modelado”), Brooks/Cole, 2009. The most widely used: first- and second-order methods with applications to circuits and mechanical systems.
- William E. Boyce and Richard C. DiPrima. Elementary Differential Equations and Boundary Value Problems. 5th ed. (Spanish edition, “Ecuaciones diferenciales y problemas con valores en la frontera”), Wiley. More theoretical, with a good treatment of existence and uniqueness.
- Charles K. Alexander and Matthew N. O. Sadiku. Fundamentals of Electric Circuits. 5th ed. (Spanish edition, “Fundamentos de circuitos eléctricos”), McGraw-Hill, 2013. The chapters on first- and second-order transients, with dozens of solved circuits.