The Little Vulgar Book of Mechanics (v0.11.0) - Differential Equations I

Last updated: March 6th 2022

Just updated this section of the book: Differential Equations I

Differential Equations I #

Fuck function graphs.

Instead of entering the Calculus headquarters through the front door, we're gonna break in through the kitchen window, at night, while the fat watchman naps.

I think I mentioned in Functions II that sometimes I prefer to talk about some "function of time" by showing you, not the cartesian plane, nor the "algorithm," but rather just a limited list of "outputs." That's what I'm gonna be doing here, to get us started.

So let's start with this data sequence. I'm gonna call it f (yes, later f will be a function, that's why I'm using that letter for the name, but right now it literally is just a plain old list of numbers. And you only know they're "outputs," cos I just told you.)

f = [1, 2, 3, 4, 5]

That looks like an equation, though. Because of the equals sign =. But I really just wanna give a name to the sequence. So let me use the symbol := instead, which means I'm just providing a definition:

f := [1, 2, 3, 4, 5]

Imagine these are the results we get from repeatedly asking for the position of a robot. I.e. the outputs of some function. I.e. data.

Assume some unit of distance for the type of each value. Say, meters. As in, meters from some origin point.

Just looking at that, what can you tell me about the robot? We don't know color, size, or anything other that the data we have. And the one thing we can say is that it's clearly moving. That is literally what it means to have a position change: It's moving.

The rest of our conversation is gonna be about this: Asking questions about data. That's all.

I'm gonna rename f to pos, because we're really talking about the "position from the starting point":

pos := [1, 2, 3, 4, 5]

Yes, I'm describing a position in one dimension. I don't care about 3D space. I'm thinking of the moving robot as a point along a line. One axis, if you will. Moving left to right, from my perspective.

(Or moving vertically, if you prefer. I.e. like a rocket. I'm ultra simplifying things to you, but I do expect you to be able to carry multiple analogies at once. Make up some yourself. Re-read sections with your analogies in mind.)

OK so now I'm gonna show you another sequence, based on analyzing pos:

f' := [1, 1, 1, 1, 1]

Kind of a boring sequence.

But, in case you didn't pay attention to what I said before: f' is based on pos.

So, can you guess what my analysis was? What question did I ask about pos, that f' was the result?

I asked the question: "How much does each output change compared to the previous one?"

I'm gonna rename f' to vel, because it's really telling me how much the position is changing each time, i.e. How fast it's going, i.e. the robot's velocity:

vel := [1, 1, 1, 1, 1]

OK so the robot is going at fixed 1 meter per... Whatever the unit of time is. I already forgot. See? That's the problem with not being specific about types. Anyway, it's seconds. Let's pretend we're looking at data that was sampled per second. I.e. a robot whose position is reported every second. Or hour. Hell, century, if it makes it more interesting to you. Maybe it's not a robot, but a tectonic plate moving North.

Anyway, here's another sequence, that I get from asking a question about vel:

f'' := [0, 0, 0, 0, 0]

Can you guess which question I asked now?

That's right, same question again: "How much does each value change compared to the previous one?" I'm just asking it about vel this time.

And, as you can see, the answer is a bunch of zeros. I.e. nothing. Nada. I.e. the velocity is not changing. Always 1.

I'm gonna rename f'' to acc, because that's what we're talking about now: Acceleration.

acc := [0, 0, 0, 0, 0]

Now we got:

  1. f (or pos). The "original" data.
  2. f' (or vel). The "derived" data, from analyzing the original.
  3. f'' (or acc). The "derived" data (a "level" higher if you will), from analyzing the previous one.

The first takeaways here are:

  1. We built each sequence from analyzing the previous one.
  2. All analyses are essentially the same question: What's the rate of change?
  3. i.e. vel tells us the rate of change of pos.
  4. i.e. acc tells us the rate of change of vel.

One way to categorize our sequences is by using the idea of "order," to reflect how we calculated them.

We started with pos. That's the original sequence. From it, we got vel, which we call a "first order" sequence. And from vel we got acc, which we call a "second order" sequence. And so on, if we keep deriving sequences this way.

In proper math we'd say "first order derivative," and so on. f' would then be the proverbial "first derivative of f", being equally generated: f' = [f'(t), f'(t+1), ...]. But we're in my "data sequence world" right now.

We stopped at acc because we're not gonna derive anything from acc, since we can see that its rate of change doesn't change at all. Bunch of zeros. Whoever controls the robot, with a joystick or something, is keeping the joystick at a fixed position the whole time during our observation (perfect pulse? had it all the way forward? who knows).

Let's introduce some math now.

Remember this equation from Force I?

\[F = {m}\times{a}\]

It's the equation that relates force, mass and acceleration, aka Newton's 2nd Law of Motion.

The variable a in there is the acceleration. And as we know now, as a function of time, acceleration is the "second derivative" of position, or the "first derivative" of velocity. Let's define it as the latter:

\[a := \dfrac{dv}{dt}\]

There's more than one "dialect" in math to express this, but for now we're gonna go with this one.

Now let's rewrite the 2nd Law, using our definition of a as the first derivative of velocity.

\[F(t,v) = {m}\times\dfrac{dv}{dt}\]

Now we're looking at an equation that contains a derivative. We call it a Differential Equation, because it contains a derivative.

You can see that I made time explicit too, on the left side. More on this later.

Anyway, let this be your welcome to Differential Calculus. It's not some "blow your mind" thing. It's a "deriving data from other data" thing.

Now go take a break. Listen to some of my "music": Escape Mechanics Unlocked"

External resources #

Books #

See current full book's WIP here.