What is Taylor Series? The Taylor series is a way to approximate a function around a point.
For a function f ( x ) f(x) f ( x ) , the Taylor series around the point a a a is:
f ( x ) = f ( a ) + f ′ ( a ) ( x − a ) + f ′ ′ ( a ) 2 ! ( x − a ) 2 + f ( 3 ) ( a ) 3 ! ( x − a ) 3 + … f(x) = f(a) + f'(a)(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \frac{f^{(3)}(a)}{3!}(x-a)^3 + \dots f ( x ) = f ( a ) + f ′ ( a ) ( x − a ) + 2 ! f ′′ ( a ) ( x − a ) 2 + 3 ! f ( 3 ) ( a ) ( x − a ) 3 + …
The approximation is valid around values x = a x=a x = a .
HLT Form An equivalent form in HLT, where x = a + h x = a + h x = a + h , the point we linearise around plus a pertubation:
f ( a + h ) = f ( a ) + h f ′ ( a ) + h 2 2 ! f ′ ′ ( a ) + h 3 3 ! f ( 3 ) ( a ) + ⋯ f(a + h) = f(a) + h f'(a) + \frac{h^2}{2!} f''(a) + \frac{h^3}{3!} f^{(3)}(a) + \cdots f ( a + h ) = f ( a ) + h f ′ ( a ) + 2 ! h 2 f ′′ ( a ) + 3 ! h 3 f ( 3 ) ( a ) + ⋯
This is a simple substitution and arguably makes the formula more intuitive. h h h is the perturbation around the point a a a .
Extension to Multivariable Functions If f ( x , u ) f(x, u) f ( x , u ) is a function of multiple variables , then:
f ( x , u ) ≈ f ( a , b ) + ∂ f ∂ x ( a , b ) ( x − a ) + ∂ f ∂ u ( a , b ) ( u − b ) + … f(x, u) \approx f(a, b) + \frac{\partial f}{\partial x}(a, b)(x - a) + \frac{\partial f}{\partial u}(a, b)(u - b) + \dots f ( x , u ) ≈ f ( a , b ) + ∂ x ∂ f ( a , b ) ( x − a ) + ∂ u ∂ f ( a , b ) ( u − b ) + …
So you're still using values and derivatives at the point ( a , b ) (a, b) ( a , b ) , but now considering partial derivatives .
In HLT form, where x = a + h x x = a + h_{x} x = a + h x and u = a + h u u = a + h_{u} u = a + h u :
f ( a + h x , b + h u ) ≈ f ( a , b ) + ∂ f ∂ x ( a , b ) h x + ∂ f ∂ u ( a , b ) h u + … f(a+h_{x},b+h_{u})\approx f(a,b)+\frac{\partial f}{\partial x}(a,b)h_{x}+\frac{\partial f}{\partial u}(a,b)h_{u}+\dots f ( a + h x , b + h u ) ≈ f ( a , b ) + ∂ x ∂ f ( a , b ) h x + ∂ u ∂ f ( a , b ) h u + …
Proof Starting Point: Nonlinear System x ˙ ( t ) = f ( x ( t ) , u ( t ) ) , y ( t ) = h ( x ( t ) , u ( t ) ) \dot{x}(t)=f(x(t),u(t)),\quad y(t)=h(x(t),u(t)) x ˙ ( t ) = f ( x ( t ) , u ( t )) , y ( t ) = h ( x ( t ) , u ( t ))
Step 1: Nominal Trajectory and Perturbations We want to linearise the system around the nominal trajectory or point ( x ⋆ ( t ) , u ⋆ ( t ) ) (x^\star(t), u^\star(t)) ( x ⋆ ( t ) , u ⋆ ( t )) .
Perturbations around the nominal:
x ( t ) = x ⋆ ( t ) + x p ( t ) , u ( t ) = u ⋆ ( t ) + u p ( t ) x(t) = x^\star(t) + x_p(t), \quad u(t) = u^\star(t) + u_p(t) x ( t ) = x ⋆ ( t ) + x p ( t ) , u ( t ) = u ⋆ ( t ) + u p ( t )
where x p ( t ) , u p ( t ) x_p(t), u_p(t) x p ( t ) , u p ( t ) are small perturbations.
Step 2: Taylor Expansion of f f f Taylor expansion allows us to model the system around our nominal point( x ⋆ ( t ) , u ⋆ ( t ) ) (x^\star(t), u^\star(t)) ( x ⋆ ( t ) , u ⋆ ( t ))
x ˙ ( t ) a m p ; = f ( x ( t ) , u ( t ) ) a m p ; = f ( x ⋆ ( t ) , u ⋆ ( t ) ) a m p ; + ∂ f ∂ x ( x ⋆ ( t ) , u ⋆ ( t ) ) x p ( t ) + ∂ f ∂ u ( x ⋆ ( t ) , u ⋆ ( t ) ) u p ( t ) + higher order terms \begin{aligned}\dot{x}(t) & =f(x(t),u(t))\\ & =f(x^{\star}(t),u^{\star}(t))\\ & \quad+\frac{\partial f}{\partial x}(x^{\star}(t),u^{\star}(t))x_{p}(t)+\frac{\partial f}{\partial u}(x^{\star}(t),u^{\star}(t))u_{p}(t)+\text{higher order terms}\end{aligned} x ˙ ( t ) am p ; = f ( x ( t ) , u ( t )) am p ; = f ( x ⋆ ( t ) , u ⋆ ( t )) am p ; + ∂ x ∂ f ( x ⋆ ( t ) , u ⋆ ( t )) x p ( t ) + ∂ u ∂ f ( x ⋆ ( t ) , u ⋆ ( t )) u p ( t ) + higher order terms
Think of x p ( t ) x_{p}\left(t\right) x p ( t ) as h h h in the HLT form, but for multivaritate.
Step 3: Use Nominal Dynamics By definition of nominal trajectory:
x ˙ ⋆ ( t ) = f ( x ⋆ ( t ) , u ⋆ ( t ) ) \dot{x}^{\star}(t)=f(x^{\star}(t),u^{\star}(t)) x ˙ ⋆ ( t ) = f ( x ⋆ ( t ) , u ⋆ ( t ))
Substitute this back (replaces first term):
x ˙ ( t ) = x ˙ ⋆ ( t ) + ∂ f ∂ x ( x ⋆ ( t ) , u ⋆ ( t ) ) x p ( t ) + ∂ f ∂ u ( x ⋆ ( t ) , u ⋆ ( t ) ) u p ( t ) + higher order terms \dot{x}(t)=\dot{x}^{\star}(t)+\frac{\partial f}{\partial x}(x^{\star}(t),u^{\star}(t))x_{p}(t)+\frac{\partial f}{\partial u}(x^{\star}(t),u^{\star}(t))u_{p}(t)+\text{higher order terms} x ˙ ( t ) = x ˙ ⋆ ( t ) + ∂ x ∂ f ( x ⋆ ( t ) , u ⋆ ( t )) x p ( t ) + ∂ u ∂ f ( x ⋆ ( t ) , u ⋆ ( t )) u p ( t ) + higher order terms
Step 4: Express Perturbation Dynamics Subtract x ˙ ⋆ ( t ) \dot{x}^\star(t) x ˙ ⋆ ( t ) from both sides:
x ˙ ( t ) − x ˙ ⋆ ( t ) = ∂ f ∂ x ( x ⋆ ( t ) , u ⋆ ( t ) ) x p ( t ) + ∂ f ∂ u ( x ⋆ ( t ) , u ⋆ ( t ) ) u p ( t ) + higher order terms \dot{x}(t) - \dot{x}^\star(t) = \frac{\partial f}{\partial x}(x^{\star}(t),u^{\star}(t))x_{p}(t)+\frac{\partial f}{\partial u}(x^{\star}(t),u^{\star}(t))u_{p}(t)+\text{higher order terms} x ˙ ( t ) − x ˙ ⋆ ( t ) = ∂ x ∂ f ( x ⋆ ( t ) , u ⋆ ( t )) x p ( t ) + ∂ u ∂ f ( x ⋆ ( t ) , u ⋆ ( t )) u p ( t ) + higher order terms
Recall:
x ˙ p ( t ) = x ˙ ( t ) − x ˙ ⋆ ( t ) \dot{x}_p(t) = \dot{x}(t) - \dot{x}^\star(t) x ˙ p ( t ) = x ˙ ( t ) − x ˙ ⋆ ( t )
Hence (variables hidden and neglect higher order terms):
x ˙ p ( t ) = ∂ f ∂ x x p ( t ) + ∂ f ∂ u u p ( t ) \dot{x}_{p}(t)=\frac{\partial f}{\partial x}x_{p}(t)+\frac{\partial f}{\partial u}u_{p}(t) x ˙ p ( t ) = ∂ x ∂ f x p ( t ) + ∂ u ∂ f u p ( t )
This is a linear time-varying system describing the perturbation dynamics.
Summary: x ˙ p ( t ) a m p ; = A ( t ) x p ( t ) + B ( t ) u p ( t ) where A ( t ) a m p ; = ∂ f ∂ x ( x ⋆ ( t ) , u ⋆ ( t ) ) , B ( t ) = ∂ f ∂ u ( x ⋆ ( t ) , u ⋆ ( t ) ) \boxed{\begin{aligned}\dot{x}_{p}(t) & =A(t)x_{p}(t)+B(t)u_{p}(t)\\ \text{where}\quad A(t) & =\frac{\partial f}{\partial x}(x^{\star}(t),u^{\star}(t)),\quad B(t)=\frac{\partial f}{\partial u}(x^{\star}(t),u^{\star}(t))\end{aligned}} x ˙ p ( t ) where A ( t ) am p ; = A ( t ) x p ( t ) + B ( t ) u p ( t ) am p ; = ∂ x ∂ f ( x ⋆ ( t ) , u ⋆ ( t )) , B ( t ) = ∂ u ∂ f ( x ⋆ ( t ) , u ⋆ ( t ))
Matrix Form Both f f f and x x x are vectors (multiple functions and states), so we write the different state differentials horizontally and the function changes vertically.
A ( t ) = [ ∂ f 1 ∂ x 1 ( x ⋆ ( t ) , u ⋆ ( t ) ) a m p ; ⋯ a m p ; ∂ f 1 ∂ x n ( x ⋆ ( t ) , u ⋆ ( t ) ) ⋮ a m p ; ⋱ a m p ; ⋮ ∂ f n ∂ x 1 ( x ⋆ ( t ) , u ⋆ ( t ) ) a m p ; ⋯ a m p ; ∂ f n ∂ x n ( x ⋆ ( t ) , u ⋆ ( t ) ) ] A(t) = \begin{bmatrix} \frac{\partial f_1}{\partial x_1}(x^\star(t), u^\star(t)) & \cdots & \frac{\partial f_1}{\partial x_n}(x^\star(t), u^\star(t)) \\ \vdots & \ddots & \vdots \\ \frac{\partial f_n}{\partial x_1}(x^\star(t), u^\star(t)) & \cdots & \frac{\partial f_n}{\partial x_n}(x^\star(t), u^\star(t)) \end{bmatrix} A ( t ) = ∂ x 1 ∂ f 1 ( x ⋆ ( t ) , u ⋆ ( t )) ⋮ ∂ x 1 ∂ f n ( x ⋆ ( t ) , u ⋆ ( t )) am p ; ⋯ am p ; ⋱ am p ; ⋯ am p ; ∂ x n ∂ f 1 ( x ⋆ ( t ) , u ⋆ ( t )) am p ; ⋮ am p ; ∂ x n ∂ f n ( x ⋆ ( t ) , u ⋆ ( t ))
and
B ( t ) = [ ∂ f 1 ∂ u 1 ( x ⋆ ( t ) , u ⋆ ( t ) ) a m p ; ⋯ a m p ; ∂ f 1 ∂ u m ( x ⋆ ( t ) , u ⋆ ( t ) ) ⋮ a m p ; ⋱ a m p ; ⋮ ∂ f n ∂ u 1 ( x ⋆ ( t ) , u ⋆ ( t ) ) a m p ; ⋯ a m p ; ∂ f n ∂ u m ( x ⋆ ( t ) , u ⋆ ( t ) ) ] B(t) = \begin{bmatrix} \frac{\partial f_1}{\partial u_1}(x^\star(t), u^\star(t)) & \cdots & \frac{\partial f_1}{\partial u_m}(x^\star(t), u^\star(t)) \\ \vdots & \ddots & \vdots \\ \frac{\partial f_n}{\partial u_1}(x^\star(t), u^\star(t)) & \cdots & \frac{\partial f_n}{\partial u_m}(x^\star(t), u^\star(t)) \end{bmatrix} B ( t ) = ∂ u 1 ∂ f 1 ( x ⋆ ( t ) , u ⋆ ( t )) ⋮ ∂ u 1 ∂ f n ( x ⋆ ( t ) , u ⋆ ( t )) am p ; ⋯ am p ; ⋱ am p ; ⋯ am p ; ∂ u m ∂ f 1 ( x ⋆ ( t ) , u ⋆ ( t )) am p ; ⋮ am p ; ∂ u m ∂ f n ( x ⋆ ( t ) , u ⋆ ( t ))
Certainly! The matrices you provided are the Jacobian matrices of the function f f f evaluated at the nominal trajectory ( x ⋆ ( t ) , u ⋆ ( t ) ) (x^\star(t), u^\star(t)) ( x ⋆ ( t ) , u ⋆ ( t )) .
We commonly define:
A ( t ) : = ∂ f ∂ x ( x ⋆ ( t ) , u ⋆ ( t ) ) ∈ R n × n A(t) := \frac{\partial f}{\partial x}(x^\star(t), u^\star(t)) \in \mathbb{R}^{n \times n} A ( t ) := ∂ x ∂ f ( x ⋆ ( t ) , u ⋆ ( t )) ∈ R n × n
and
B ( t ) : = ∂ f ∂ u ( x ⋆ ( t ) , u ⋆ ( t ) ) ∈ R n × m B(t) := \frac{\partial f}{\partial u}(x^\star(t), u^\star(t)) \in \mathbb{R}^{n \times m} B ( t ) := ∂ u ∂ f ( x ⋆ ( t ) , u ⋆ ( t )) ∈ R n × m
Explicitly,Summary: A ( t ) A(t) A ( t ) captures how the system dynamics change with respect to the state x x x near the nominal trajectory.
B ( t ) B(t) B ( t ) captures how the system dynamics change with respect to the input u u u near the nominal trajectory.
These matrices are crucial in the linearized system:
x ˙ p ( t ) = A ( t ) x p ( t ) + B ( t ) u p ( t ) \dot{x}_p(t) = A(t) x_p(t) + B(t) u_p(t) x ˙ p ( t ) = A ( t ) x p ( t ) + B ( t ) u p ( t )
Let me know if you want me to write the corresponding matrices for the output function h h h as well!