A smaller delta t makes Euler's method
more accurate, and we can see why:
The reason Euler's method isn't accurate
is that we're pretending that a constantly changing rate
is actually constant over some time interval.
Over a time interval of 2 minutes, that rate might change quite a bit,
but the rate will change less if the time interval is smaller.
So, if the time interval is 1 minute, instead of 2,
the bit of make-believe, where we pretend that
the rate isn't changing, will be closer to reality,
and I can illustrate that on this next plot.
So, I won't go through all the numerics of this,
but here is Euler's method
for 2 different delta t's.
So, first, the squares, which we've already seen,
we calculated those before,
that's Euler's method with a delta t of 2,
where we're pretending that a constantly changing rate
is actually constant for a whole two minutes.
Delta T of 1, that's the triangles with the dash, and not dotted line.
a little hard to see, but the key thing is it's between these two
- it's closer to the exact solution which is the solid curve.
It's closer because the ignoring of the problem is a less bad thing to do,
- we're pretending now that a continually changing rate
is only constant for 1 minute, instead of 2, so it's not as much of a lie,
and by now you can probably guess
how we could make this better and better and better
- we would let delta t get smaller and smaller and smaller,
and then we would see that the Euler method
would be exactly on top of this line.
Now that we've seen part of a particular example
let me talk about Euler's method a bit more generally.
Euler's method applies to differential equations of this form.
A differential equation is a dynamical system,
a rule for how something changes in time.
What makes differential equations a little bit tricky
is that the rule is indirect.
This tells us how the derivative changes
and we're interested in how the quantity X itself changes.
Euler's method is just a way to go from this
indirect information derivative, to the direct information about X
So Euler's method converts this indirect rule,
the differential equation - indirect rule involving the derivative
- the rate of change, and it converts that in to values for X.
It does so, by pretending that this rate of change
is constant over a time interval.
So, Euler's method does this conversion by pretending that the derivative,
which is constantly changing, is actually constant
over some time interval delta t.
This bit of make-believe gets better
closer to the true value, as delta t gets smaller.
So, as delta t, our time interval over which were pretending the rate isn't changing,
as delta t gets closer and closer to 0,
this Euler pretending will get less and less wrong,
and in this way, Euler's method, a solution obtained
from Euler's method, will get closer and closer to the true answer.
So, as delta t gets closer and closer to 0,
a solution obtained by Euler's method will get
closer and closer to the exact solution.
So, Euler's method is a computational way of
finding a solution to a differential equation.
It requires doing a computation,
and you can see that as delta t gets smaller and smaller
the computational will get longer and longer.
- we'll need to do more and more steps to get anywhere,
so these are almost always done on a computer.
So, this is an algorithmic solution to differential equations.
It's a procedure, it's well-defined,
for well-defined differential equations, it's guaranteed
to converge to the exact solution.
So, Euler's method is very general,
it almost always works, and I think it gets at
the core idea of a differential equation:
a differential equation is a dynamical system,
a rule for how something changes.
The rule is a little bit indirect, because it is in terms of the derivative,
the rate of change of this quantity X, and not X itself
but Euler's method is a little bit of a trick
that converts this indirect information about the derivative
into direct information about values for X