# Problem 3 - Is the A matrix zero?

**Q:** Is the A matrix zero in problem 3?

**A:** No it is not.

The problem dynamics are given as where and . Use for simplicity.

The estimator can be built directly from the system dynamics: . As Kalman showed, the optimal observer gain is , where comes from a solution of the Riccati equation

Note, there are no random disturbances affecting the system dynamics, so F=0 in these equations. The entries of matrix come from linearization of the observer: . If you utilize the A matrix with the initial state of the observer with the Matlab lqe or kalman command, you will receive an error. This is because these Matlab functions assume . This will not work in this problem due to its nonlinearity.

You will need to numerically integrate the Riccati equation to get . Additionally, over time the observer state will also change, and the linearization A at time zero will not be valid for all time. Thus, your numerical integration will need to update the A matrix for each step of your iteration.

Suggestion: Utilize the same numerical integration call to integrate the original dynamics , the estimator dynamics , and the Riccati Equation simultaneously. This will allow you to simultaneously update the A matrix, P matrix, and L matrix.

--John