State space discretization I have a question for you:
I'm playing with a continuous state space system and I have to discretize it. I've looked around and it seems pretty easy:
$\dot{x}(t) = Ax(t) + Bu(t)\ $ and  $\ y(t) = Cx(t) + Du(t) = Cx(t) \rightarrow$ because $D = 0$;
Turns to:
$x(k+1) = A_dx(k) + B_du(k)\ $ and $\ y(k) = Cx(k)$ 
where:
$A_d = e^{AT_s}\ $ and $\ B_d = A^{-1}(A_d-I)B$ 
My problem is that when computing $B_d$, the matrix $A^{-1}$ increases a lot and destroys the subsequent state prediction. I assumed that discretizing my state space was making it unstable, so I checked the eigenvalues of $A_d$. There is one of them that is positive.
Is there any solution to avoid this non stability? I need this discrete system. What would you do?
 A: In general, for discretizing the LTI system
$$\dot x=Ax+Bu$$
you can think of $\dot x$ as
$$\dot x\approx\frac 1T(x_{k+1}-x_k)$$
So a reasonable estimation for $x_{k+1}=A_dx_k+B_du_k$ would be:
$$A_d=I+AT,\;B_d=BT$$
This is called the zero-order hold estimation.
A: Positive eigenvalues of $A_d$ do not mean that the discrete-time system is unstable. As long as all the eigenvalues of $A_d$ are inside the unit circle, the discrete-time system is stable.
The solution
$A_d = e^{AT_s}\ $ and $\ B_d = A^{-1}(A_d-I)B$ 
provided in the question is an exact discretization if the input $u(t)$ is constant between sampling instances (see for example this derivation on Wikipedia). This discretized model is stable if the original continuous-time system is stable. The discretized system essentially expresses the relationship between the input and output at the sampling instances only (thus at $t=k T_s$ for $k\in\mathbb{Z}$), whereas the continuous-time system expresses the relationship between the input and output signals (thus at all time instances $t$). If the continuous-time system is bounded input bounded output (BIBO) stable, then so is this exact discretized system.
If your input is not constant between sampling instances, then you could use a forward Euler discretization ($\dot{x}(kT_s)\approx\frac{1}{T_s}(x_{k+1}-x_k)$) like @polfosol mentioned in his answer. Another option is a backward Euler approximation ($\dot{x}(kT_s)\approx\frac{1}{T_s}(x_k-x_{k-1})$). The problem is that these discretizations do not necessarily preserve stability. A discretization that does preserve stability is the Tustin discretization (also called bilinear transform). 
