# Differential equations modeling ODE basics help

I haven’t taken a calculus class in years. I recently took the mit computational modeling class in Julia. In the modeling class we used the SIR model. I’ve been trying to understand how to apply/ synthesize differential equations for modeling problems. I’ve read a handful of medium articles l, and I’m still struggling.

Example…I work in IT. Let’s say there are 24 interfaces on a switch, 4 switches and 6 different types of errors I want to model over time with respect to throughput.

What’s the conceptual framework? My current answer is to just get the values in a table and do a rate of change between times and turn it into a heat map across all interfaces for time… this might be a good answer and bad example. So, feel free to use another.

I really want to leverage the power of ODE’s, but I know I need to work on my base understanding first.

Any help or tips you use for application or for grasping application In a programmatic way is appreciated.

Most of the common ODE’s you run into in everyday life, are continuous quantities in continuous time.

For example, radioactive decay is described by a first-order ODE: the rate at which radioactive material decays at any instant, is in proportion to how much radioactive material there is. The solution to such an ODE is a decaying exponential, which we characterize by the “half-life” t_{1/2}.

In electric circuits, if you take a charged capacitor and discharge it through a resistor, the rate at which charge flows is in proportion to how much charge is stored. Again, the solution to this first-order ODE is a decaying exponential, which we characterize by the “time constant” \tau.

When a child is swinging on a swing set and stops kicking, the decaying oscillation is described by a second-order ODE as the energy periodically changes form between potential energy (altitude) and kinetic energy (momentum), while some is lost to air drag. The solution to this ODE is, again, a decaying exponential (but with two “time constants” which are complex conjugates of each other). We characterize this solution by the “characteristic frequency” \omega_0 (which describes the resonance frequency) and the “damping coefficient” \zeta (which describes how quickly the oscillation decays).

There are so many ODEs (more generally, DEs) that we encounter in daily life, that we don’t even think about them. From the behavior of shock absorbers, to riding a bicycle, to heat flow, to reaching terminal velocity while skydiving. Most of them we manage with the unconscious mind, the lizard part of our brains that makes handling them instinctive and natural.

The SIR model is a particular ODE that’s been on people’s minds lately, and I probably don’t need to explain why but it’s just one (simplified) member out of a grand family of rich and interesting behaviors that we observe in the real world.

Working in IT, you might be more familiar with difference equations, which are the discrete-time (or sampled-time) counterpart to differential equations; in the limit as sample period goes to zero, difference equations approach differential equations—so as long as the sample rate is high enough they’re interchangeable. IIR filters (infinite impulse response filters) are a popular example of an application for difference equations.

An example difference equation describing exponential decay would be: x[n] = \alpha x[n-1] where 0\le \alpha< 1, and where x[n] denotes the value of x at sample n. Note that this is recursive, so to solve it there needs to be a base case (also called an “initial condition” or a “boundary condition”) specified.

1 Like

Thank you for this detailed explanation! I appreciate the specifics of direction and the general explanation of concepts to build my intuition. Give me some time to work through some of the examples provided and continue this conversation next week.