
Title:
0711 Roundoff Error

Description:

Up to now we have only dealt with the effect of a finite time step,
¶

but actually also the representation of the values on the x axis is crossgrained.

Now we have a look at what this leads to,

and for simplicity it's again the forward Euler method.

As a test case, we're using that satellite that's almost geostationary from Unit 2.

It takes precisely 24 hours to complete one orbit around the earth.

What's critical about the forward Euler method in terms of roundoff error

is this addition and this one.

X(t) is a number of reasonable size.

In this case quite an amount of meters.

I'm just drawing some ghost figures here to give an impression,

but the step size times the velocity is pretty small in comparison,

because we're multiplying by that small step size.

If the velocity is of reasonable size and we multiply by that small step size,

we get a number that's rather small in comparison to x.

Then we form the sum of these two numbers and get something that looks like this,

but actually this number again is computed and is being stored

at the position of xthe loose position in that process.

Actually, you see the value of x didn't have enough position to start with.

The smaller we choose the step size, the smaller this number becomes,

the more grave the effect of roundoff error will be.

The effect of the round off error is that we actually are losing the details of velocity and force.

We could have gotten away with not computing these digits anyway.

To see a noticeable effect of roundoff errors in a manageable time, I'm cheating a little here.

I'm using standard Euler, but them I'm multiplying by a number of 1 plus tiny random number.

This epsilon is defined to be 2 * 10⁻⁶ in advance.

This looks as though I have a pretty huge roundoff error every time.

This is the result that we get.

First I have to explain why we see several points for each step size.

This is because we're dealing with random numbers

and because I let the computer try out every step size 10 times.

The overall behavior is what we know.

With the forward Euler method the error depends linearly on the step size,

at least for step sizes that are small enough.

But for very small step sizes you seeuhohthe error explodes,

and we have many small steps.

Roundoff error accumulates and destroys our result.

What you should be learning from this reducing the step size

only takes you so far.

There is a threshold after which the error goes up again

and may become severe.

Let's look at the same data from a different viewpoint.

Let's note that the error depends on the step size,

but let's plot how the error depends on the number of steps.

This is what we get.

For a small number of steps, the step size is large,

and the forward Euler method introduces a huge error,

which then decreases in a linear fashion,

but as the number of steps grows, we get more and more error due to round off.

The simple model for this behavior would be to say that the error introduced by rounding

is proportional to the number of steps

and hence inversely proportional to the step size plus h.