## Kalman filter

A wind turbine is modeled under the assumption that the rotor is directly attached to the generator and that the generator torque can be controlled directly. Then we can write (without noise):

\dot\omega_\mathrm{r} = \frac{T_\mathrm{a}-T_\mathrm{g}}{J_\mathrm{r}},

where \omega_\mathrm{r} is the rotor speed, T_\mathrm{a} the aerodynamic torque, T_\mathrm{g} the generator torque and J_\mathrm{r} the combined inertia of the rotor and the generator.

#### Model equations

\left[
\begin{array}{ccc}
\dot\omega_\mathrm{r} \\
\dot{T}_\mathrm{a} \\
\end{array}
\right] =
\left[
\begin{array}{ccc}
0 & 1/J_\mathrm{r} \\
0 & 0 \\
\end{array}
\right]
\left[
\begin{array}{ccc}
\omega_\mathrm{r} \\
{T}_\mathrm{a} \\
\end{array}
\right] +
\left[
\begin{array}{ccc}
-1/J_\mathrm{r} \\
0 \\
\end{array}
\right] T_\mathrm{g}+
\left[
\begin{array}{ccc}
w_{\omega_\mathrm{r}} \\
w_\mathrm{T_\mathrm{a}} \\
\end{array}
\right],

where w_{\omega_\mathrm{r}} and w_\mathrm{T_\mathrm{a}} are the process noise of \omega_\mathrm{r} and \mathrm{T_\mathrm{a}} respectively.

The output equation is defined by

y = \omega_\mathrm{r} + v_\mathrm{\omega_\mathrm{r}},

where v_\mathrm{\omega_\mathrm{r}} is the measurement noise.

**Question:**

How can I transform this system into a discrete time system and determine the matrices A, B, C and D that I need for implementing it with LowLevelParticleFilters.jl ?

Input will be T_\mathrm{g} and the noisy measurement of \omega_\mathrm{r}, output filtered estimates for T_\mathrm{a} and \omega_\mathrm{r}.