Discretisation of ordinary differential equations for a linear filter design. I want do develop a discretized filter for some sensor data.
The filter can be defined as linear differential equation system:
$$\dot x =Ax+Bu(t)$$
I could discretize this equation for timesteps $\Delta T$ as
$$x_k-x_{k-1}=\Delta T\cdot(Ax_k+Bu(t_k))$$
which is equal to
$$x_k =\left(I-\Delta TA\right)^{-1}\cdot\left(x_{k-1} +\Delta  T Bu\left(t_k\right)\right)$$
or as 
$$x_k-x_{k-1}=\Delta  T\cdot(Ax_{k-1}+Bu(t_k))$$
equal to 
$$x_k=x_{k-1}+\Delta  T\cdot(Ax_{k-1}+Bu(t_k))$$
I'm aware that there is a small numeric difference between these equations but I'm not aware on how this does affect the solution quality of the filter. 
Can you help me finding reasons to decide which solution is better?
 A: In order to get down to essentials, consider instead the following, almost trivial but quite analogous, differential equation.
$$
   \tau \dot x + x = 0 \quad ; \quad \tau > 0 \quad ; \quad x(0) = x_0 = 1
$$
Forward differences, with $\Delta T > 0$ :
$$
    \frac{\tau}{\Delta T} \left( x_k - x_{k-1} \right) + x_k = 0
$$
Numerical solution approximates exact solution for $\Delta T = t/n$ small enough:
$$
    x_k = \frac{x_{k-1}}{1 + \Delta T/\tau} \quad \Longrightarrow \quad x_n =
   \frac{1}{\left(1 + \frac{t/\tau}{n}\right)^n}
    \approx \frac{1}{e^{t/\tau}}
$$
Because $\Delta T > 0$ and $\tau > 0$ , this solution is decreasing monotonically; we say that it is numerically stable, even better: unconditionally stable.
Backward differences:
$$
    \frac{\tau}{\Delta T} ( x_k - x_{k-1} ) + x_{k-1} = 0
$$
Numerical solution approximates exact solution for $\Delta T = t/n$ small enough:
$$
    x_k =(1 - \Delta T/\tau) x_{k-1} \quad \Longrightarrow \quad
    x_n = \left(1 - \frac{t/\tau}{n}\right)^n \approx e^{-t/\tau}
$$
However, for $\Delta T > \tau$ this solution is oscillating, i.e. numerically unstable.
Central differences ("Crank-Nicolson"):
$$
    \frac{\tau}{\Delta T} ( x_k - x_{k-1} ) + \frac{x_{k-1} + x_k}{2} = 0
$$
Numerical solution approximates exact solution for $\Delta T = t/n$ small enough:
$$
   x_k = \frac{1 - \frac{1}{2} \Delta T/\tau}{1 + \frac{1}{2} \Delta T/\tau} x_{k-1} 
   \quad \Longrightarrow \quad x_n = \frac{(1 - \frac{t/\tau/2}{n})^n}
  {(1 + \frac{t/\tau/2}{n})^n}
   \approx \frac{e^{-t/\tau/2}}{e^{+t/\tau/2}}
$$
But for $\Delta T > 2 \tau$ this solution is oscillating, i.e. numerically unstable.
As far as the real thing is concerned, it may be considered as an assembly of many 1-D decays as the one above (?) The decay times $\tau$ can be quite different in magnitude, though, giving rise to so-called stiff differential equations. See: Stiff equation (Wikipedia). That's why unconditional stability is an issue and IMHO forward differences are to be preferred.
A: If $-A$ is positive definite, then the first method is the forward Euler method, and is unconditionally stable.  This makes it better than your other method (the usual Euler method).
I would suggest the Crank-Nicolson method, and write it as
$$x_k - x_{k-1} = \tfrac12 \Delta T(A(x_k+x_{k-1}) + B(u(t_k)+u(t_{k-1}))$$
Then you get unconditional stability and the method is of order 2 instead of order 1.  (The stuff I did with $Bu$ is not crucial for the stability.)
