So we now have the complete example shown on the screen here, and if we run this, we can see that
the filter is working quite well.
So we have the pendulum estimation.
As the pendulum moves back and forth, the estimates follow the truth.
So the red line is following the blue line quite well.
If we have a look at our measurement innovations, you can see that they are mostly zero remained and
the variance here.
So our covariance for the innovation is about point to four, while our measurement of innovation on
Sandy is about point to five.
So that's fairly well trained.
That sort of a lining up.
And if we have a look at our theater estimates for the position and for Al-Fadl, not for the angle.
Right.
They track quite nicely.
Sorry, there's a little area between the two.
So if we look at the airports here, we can see that our data error is within the three sigma bounds
of our positions.
And we can see that three sigma bounds for the velocity contains the actual velocity error.
So the filter is operating quite well here and it's fairly well tuned.
When we ran this field out here, you could see that we had a non-zero process, more noise, so we
had this talk standard deviation set point zero one.
So if we actually ran this again, but using zero for the torque standard deviation so that our key
metrics is zero.
So we are not adding any additional process, more noise into the system and run it.
We actually find that we get a slightly different response.
So even though the estimates still look fine in terms of the estimated position, if we take a closer
look at the measurement innovations, you can see that our innovations, while they're still see, remain
the star need to creep up.
So the error between the measurements and the estimate starts to increase.
And you can see that sort of almost diverging behavior.
The longer you run, the larger the innovation is going to get.
If we have a look at the position error, you can clearly see that this field is not performing as well
as it did in the previous example.
We can see that our estimated errors for our position and Awasthi increasing.
So you can see this oscillatory behavior.
This is as expected as we have a pendulum system moving back and forth back and say the overall magnitude
of the error is increasing with time and the same thing here for the velocity.
So if we were to run this for a longer period of time, so instead of just running this for 10 seconds,
let's run this for, let's say, 60 seconds.
You might find that we get an even more dramatic increase, so this is our measurement innovation,
so you can see a dramatic increase in the error.
And if we look at our actual errors here, you can see that the system is diverging.
Is is error is increasing with time.
So this is what happens when there's not enough uncertainty inside the system to compensate for the
error in the modelling.
So since we're using a linear approximation, we can get additive error coming in as we run with time.
So if we went back and increased outtalk standard deviation back to the original value of zero point
zero one and run it again, you can see we're going to get a lot better behavior.
So we now we can see that our innovations are back to being zero mean.
And the variance of them sort of follows along with our variance of measurement innovations.
We can also see that our position error for Theta and was the error for Theta Dot nicely contained inside
the three sigma bounds.
So it is clear to say here that for this field of work we need some level of uncertainty injected into
the system to compensate for the modeling errors.
So we were running this system based on a small angle.
So we're starting at a small initial angle and we're oscillating back and forth on small angles.
So if we change this back to 10 seconds, but instead of starting at the known small angle, it starts
at a random angle, which can be large.
And let's have a look at this.
So we've just changed the starting angle to be a random value.
And let's run this.
So now I can see that the pendulum is oscillating back and forth with a lot larger angle, so we started
off at a larger initial angle.
In this case, we started off around 25 degrees and we're oscillating back and forth.
So in this case, you can see a filter is still performing fairly well.
We do start to see this oscillatory behavior on the velocity and we starting to get a slightly larger
errors inside the position estimates.
And we can probably see that we actually is larger errors every now and again.
And these are probably when we're in the nonlinear region.
So we can see that this even though this filter is a linear filter with a linear process model, the
fact that we've increased the uncertainty inside the system allows it to compensate for some of the
nonlinear realities inside the system.
So we basically increased the uncertainty in system to let it to compensate for this.
So even though the system that we're estimating is a nonlinear system, we're using a linear common
filter with a linear approximation.
And this allows it to work because we have model such in the way that we can increase the uncertainty
inside the system to compensate for any errors in modelling.
So hopefully this should be a clear example that we can still apply a linear system to a nonlinear system
if we go about it in a good systematic way.