Discretization of nonlinear curvilinear dynamics equations

43 Views Asked by At

I am considering a tracking model of the form $$ \dot{x} = v\cos\psi\\ \dot{y} = v\sin\psi\\ \dot{v} = a\\ \dot{a} = 0\\ \dot{\psi} = \omega\\ \dot{\omega} = 0 $$ which is considering 2D position in $x$ and $y$, speed $v$ in direction $\psi$ from pos $x$ with turn rate $\omega$.

I am trying to discretize this. A similar model, assuming $a=0$, has been discretized in doi.org/10.1109/cdc.1996.573612. In the paper it is proposed that $$ x_{k+1} = x_{k} + \int_{t}^{t+T} v\cos\psi d\tau $$ where if $\dot{v}=0$ then $$ x_{k+1} = x_{k} + \frac{v}{\omega}\big(\sin(\omega(t+T)) - \sin(\omega t)\big)\\ \quad= x_{k} + \frac{2v}{\omega}\sin(\frac{\omega T}{2}) \cos(\psi + \frac{\omega T}{2}) $$ leveraging $\psi = \int \dot{\psi} dt = \int \omega dt = \omega t$.

I am trying to expand this in order to allow for a constant, but non-zero, $a$. So I set up the integral $$ \begin{aligned} x_{k+1} &= x_{k} + \int_{t}^{t+T} v\cos\psi d\tau\\ &= x_{k} + \int_{y}^{t+T} v\cos(\omega\tau)d\tau \end{aligned} $$ I figured this can be solved using integration by parts, where $$ u=v\\ du = a\\ d\nu=\cos(\omega\tau)d\tau\\ \nu = \frac{1}{\omega} \sin(\omega\tau) $$ such that $$ \begin{aligned} \int_{y}^{t+T} v\cos(\omega\tau)d\tau &= \frac{v}{\omega}\sin(\omega\tau)\bigg|_{t}^{t+T} - \int_{t}^{t+T} \frac{a}{\omega}\sin(\omega\tau)d\tau\\ &= \frac{v|_{t+T}}{\omega}\sin(\omega(t+T)) - \frac{v|_{t}}{\omega}\sin(\omega t) + \frac{a}{\omega^{2}} \bigg(\cos(\omega(t+T)) - \cos(\omega t) \bigg)\\ &= 2\frac{v|_{t+T}-v|_{t}}{\omega} \sin(\frac{\omega T}{2}) \cos(\psi+\frac{\omega T}{2}) - \frac{2a}{\omega^{2}} \sin(\frac{\omega T}{2})\sin(\psi + \frac{\omega T}{2}) \end{aligned} $$ I figure here that $v|_{t}$ is just $v$ and $v_{t+T}$ is $v+aT$? But I am in doubt if this is even a correct way to integrate this? As well I imagine there will be some numerical problems in evaluating $\frac{a}{\omega^{2}}$ for small turn rates. Is this a correct discretization of the original dynamics assuming that $a\neq 0$?

1

There are 1 best solutions below

7
On BEST ANSWER

Indeed you get $$ x\rvert_{t+T}=x\rvert_t+\frac{(v\rvert_t+aT)\sin(\psi\rvert_t+\omega T)- v\rvert_t\sin(\psi\rvert_t)}{\omega}+\frac{a}{\omega^2}[\cos(\psi\rvert_t+\omega T)-\cos(\psi\rvert_t)] $$ but you shouldn't compute it this way when $\lvert\omega\rvert$ is small. Instead, we have \begin{align*}\require{color} x\rvert_{t+T}&=x\rvert_t +\frac{v\rvert_t[\sin(\psi\rvert_t+\omega T)-\sin(\psi\rvert_t)]}{\omega}\\ &\hphantom{{}=x\rvert_t} +\frac{a}\omega \frac{\omega T\sin(\psi\rvert_t+\omega T)+\cos(\psi\rvert_t+\omega T)-\cos(\psi\rvert_t)}{\omega}\\ &=x\rvert_t +v\rvert_t T\cos(\psi\vert_t+\tfrac12\omega T)\operatorname{sinc}(\tfrac12\omega T)\\ &\hphantom{{}=x\rvert_t} +\tfrac12 aT^2 \cos(\psi\rvert_t+\tfrac12\omega T)\operatorname{sinc}(\tfrac12\omega T)\\ &\hphantom{{}=x\rvert_t} +\frac{aT}{\omega} \sin(\psi\rvert_t+\tfrac12\omega T) \underbrace{\color{blue}[\cos(\tfrac12\omega T)-\operatorname{sinc}(\tfrac12\omega T)]}_{= -\frac1{12}\omega^2T^2+\frac1{480}\omega^4T^4+\dots }\\ &=x\rvert_t +(v\rvert_t T+\tfrac12aT^2)\cos(\psi\vert_t+\tfrac12\omega T)\operatorname{sinc}(\tfrac12\omega T)\\ &\hphantom{{}=x\rvert_t} -\tfrac1{12}{\color{red}(1-\tfrac1{40}\omega^2T^2+\dots)}a\omega T^3\sin(\psi\rvert_t+\tfrac12\omega T). \end{align*} The relative error of approximating the term in red by $\cos(\omega T/\sqrt{20})$ is approximately $(\omega T)^4/8400$ (or with $\operatorname{sinc}(\omega T\sqrt{3/20})$ is $(\omega T)^4/28000$), so should be small enough practically when $\omega T$ is small.