Taylor’s Series

In order to compute the normal form of an equation \(\dot{x}=f(x)\), the normal_forms.normal_form.normal_form class first computes the Taylor series of \(f(x)\) up to a specified degree \(k\). The class that implements the Taylor series of \(f(x)\) at a specified center \(x_0\) up to a specified degree \(k\) is normal_forms.jet.jet.

The reason why the class is called jet is that the \(k\)-jet centered at \(x_0\) of a function \(f(x)\) is the Taylor’s series truncated at degree \(k\):

\[J_k(x) = \sum_{0\leq |m|\leq k}\frac{f^{(m)}(x_0)}{m!}(x-x_0)^{m}.\]

Like when creating a normal_form object, \(f(x)\), \(x_0\), and \(k\) should be supplied to create the jet object, and non-algebraic functions in \(f(x)\) should be defined with the sympy variants of those functions. Once the jet is created, it can be evaluated at points in the domain:

In [1]: from normal_forms import jet

In [2]: import sympy

In [3]: f = lambda x: sympy.exp(x)

In [4]: h = jet(f, x=0, k=10)

In [5]: h(1)
Out[5]: 2.718281801146385

The formula above makes sense for \(f:\mathbb{R}^n\rightarrow\mathbb{R}^p\) with any natural number dimensions \(n\) and \(p\) when \(m\) is a multiindex \(m=(m_1,\ldots,m_n)\) with derivative, exponent, factorial, and absolute value defined as

\[\begin{split}f^{(m)} &= \frac{\partial^{m_1}}{\partial^{m_1} x_1}\cdots\frac{\partial^{m_n}}{\partial^{m_n} x_n}f \\ x^{m} &= x^{m_1}\cdots x^{m_n} \\ m! &= m_1!\cdots m_n! \\ |m| &= |m_1|+\cdots+|m_n|.\end{split}\]

To follow are a few examples for different choices of domain \(\mathbb{R}^n\) and range \(\mathbb{R}^p\) of \(f\).

A \(\mathbb{R}\rightarrow\mathbb{R}\) example

The domain and range may have the same dimension, for example, \(f(x)=\sin(x)\):

(Source code, png, hires.png, pdf)

_images/R1_to_R1.png

A \(\mathbb{R}\rightarrow\mathbb{R}^2\) example

The dimension of the range may be greater than the dimension of the domain, for example, \(f(t)=(\sin(t),\cos(t))\) viewed here as a parametric plot in the \(xy\)-plane:

(Source code, png, hires.png, pdf)

_images/R1_to_R2.png

A \(\mathbb{R}^2\rightarrow\mathbb{R}\) example

The dimension of the range may be less than the dimension of the domain, for example, \(f(x,y)=\sin(x)\cos(y)\):

(Source code, png, hires.png, pdf)

_images/R2_to_R1.png