0
$\begingroup$

I have been trying to develop to solve a state space model in discrete time. I have the following equation for my state space: $$\dot{x} = Ax + Bu, $$

I am developping the equation, but I do not understand why I don't have the right form as equations 7 and 8 in this website (link): $$ \dot{x} = \frac{dx}{dt} = f(x, t) \\ \implies \frac{x_{n} - x_{n-1}}{h} = f(x_n, t_n) \\ \implies \frac{x_{n} - x_{n-1}}{h} = Ax_n + Bu_n \\ \implies x_n - x_{n-1} = hAx_n + hBu_n \\ \implies (I - hA)x_n = x_{n-1} + hBu_n \\ \implies \boxed{x_n = (I-hA)^{-1}x_{n-1} + (I-hA)^{-1}hBu_n} $$

I should obtain $ x_n = (I-hA)^{-1}x_{n-1} + hABu_{n-1} $ according to equation 8 here.

$\endgroup$
3
  • $\begingroup$ Please make the question self contained; perhaps by typing out the right form of the equation from the website or by posting a screenshot containing only the relevant portions. $\endgroup$
    – AJN
    Nov 28, 2022 at 14:47
  • $\begingroup$ In the above derivation, it is not clear how line 3 is obtained from line 2 and how a negative sign appeared in line 6. $\endgroup$
    – AJN
    Nov 28, 2022 at 14:51
  • $\begingroup$ @AJN Oups my bad for line 6 I made a mistake in writing. For line 3 I just took $\dot{x} = Ax + Bu$ from the state space equations. $\endgroup$ Nov 28, 2022 at 14:59

2 Answers 2

0
$\begingroup$
  1. The resource contains two distinct symbols; $A_c$ and $A = (I-hA_c)^{-1}$. So, $h \color{red}{A} Bu_{n-1}$ in equation (8) expands to $h \color{red}{(I-hA_c)^{-1}} Bu_{n-1}$
  2. Equation (7) in linked page has $B_c u_{k \color{red}{-1}}$. You appear to have used $B u_{n}$.

These are the only two differences I could find.

$\endgroup$
2
  • $\begingroup$ Thank you, what is wrong in my development that leads me to $u_{n}$ instead of $u_{n-1}$ as derived in the linked source ? $\endgroup$ Nov 28, 2022 at 17:02
  • $\begingroup$ Since that step in the derivation doesn't involve any mathematical logic. From line 2 to 3, it is more of an assumption or definition rather than logic. So nothing wrong per se, I think. If you could have replaced $f$ by $\dots B u_{k-1}$ instead. $\endgroup$
    – AJN
    Nov 29, 2022 at 2:01
0
$\begingroup$

The state space model is defined as

$$\dot{x}=A_c\,x +B_c\,u$$ And he is replacing $\dot{x}=u$ using the Backward Euler method, that is $u_k = \frac{x_k - x_{k-1}}{h}$, where h is the discretization time step. Thus we have:

$$\frac{x_k - x_{k-1}}{h} = A_c\,x +B_c\,u $$

As you noticed he is somehow combining discrete time and continous time, but he claims that an approximation is done through equation (7), i.e.

$$\frac{x_k - x_{k-1}}{h} = A_c\,x +B_c\,u \approx A_c\,x_k + B_c\,u_{k-1}$$

Unfortunately is not clear from where he got this approximation, and personally I would not use that approximation. Anyway, (and doing in his way) the rest is quite easy to solve \begin{equation} x_k - x_{k-1} = h\,Ac\,x_k + h\,B_c\,u_{k-1} \\ x_k =(I-h\,Ac)^{-1}\,x_{k-1} + (I-h\,Ac)^{-1} h B_c\,u_{k-1}\\ x_k =(I-h\,Ac)^{-1}\,x_{k-1} + h\,(I-h\,Ac)^{-1}\,B_c\,u_{k-1} \end{equation} Then, we define $A := (I-h\,Ac)^{-1}$ and replace, that is $$x_k = A\,x_{k-1} + h\,A\,B_c\,u_{k-1}$$ last step we define $B:= h\,A\,B_c $ giving us equation (8), i.e. $$x_k = A\,x_{k-1} + B\,u_{k-1}$$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.