Tartalomjegyzék

Basic tools

Teljes Matlab script kiegészítő függvényekkel.

File: basic_tools.m
Directory: 4_gyujtemegy/11_CCS/_2_nonlin-pannon/2018
Author: Peter Polcz (ppolcz@gmail.com)
Created on 2018. July 24.
syms t x1 x2 real

x = [ x1 ; x2 ];

Lie = @(f,h) jacobian(h,x) * f;

f = [
    x2 + 0.4*x2*x1
    -x1-x2 + 0.3*x1^2
    ];

g = [
    -x1+x2
    x2-sin(x1^2 + x2^2)
    ];

h = sin(x1+x2^2)^2 + x2^2;

Lfh_fh = matlabFunction(Lie(f,h),'vars',{x'});

Lie(g,h)
Output:
ans =
(2*x2 + 4*x2*cos(x2^2 + x1)*sin(x2^2 + x1))*(x2 - sin(x1^2 + x2^2)) - 2*cos(x2^2 + x1)*sin(x2^2 + x1)*(x1 - x2)

Meaning of Lie derivative (plot)

The blue line is a system trajectory of $\dot x = f(x)$ with the initial condition illustrated by the blue dot. The red line highlights the value of function $h(x)$ along the trajectory $x(t)$. In this way $h(x(t))$ can be considered as a scalar function of $t$. Its time derivative can be computed by the chain rule: $\frac{\mathrm{d}}{\mathrm{d} t} h(x(t)) = \frac{\partial h}{\partial x} \cdot \dot x = \frac{\partial h}{\partial x} f(x)$.