https://mitmath.github.io/18337/lecture4/dynamical_systems
dynamical systems show up everywhere
scalar system:
what is the global behavior?
if we know
if
The Geometric Theory of Dynamical Systems is the investigation of their long-term properties and the geometry of the phase space which they occupy. Let’s start looking at this in practical terms: how do nonlinear update equations act as time goes to infinity?
let
-
$d(x,y) ≥ 0$ ,$d(x,x) = 0$ $d(x,y) = d(y,x)$ $d(x,z) \leq d(x,y) + d(y,z)$
(in this case:
if
how do we prove this? we only have metric space properties. third one seems interesting; we can use it to bound distances.
have map: $xn+1 = f(x_n)$
so $d(x_m, x_n) \leq d(x_m, xm-1) + \ellipsis + d(xn+1, x_n)$ for
note: $d(xn+1, x_n) = d(f(x_n), x_n) = d(f(x_n), f(xn-1))$
… lecturer got lost, look up in notes
but, intuition: distance between future points is always shrinking by at least a factor of
proof via geometric sequence + cauchy convergence
(if you have a complete metric space! incomplete metric space, like rationals, may have convergence point outside space.)
let
$xn+1 = f(x_n)$
assume that
if this wasn’t a math class, we could discretize… but this is a math class
if f is continuous, there must be a neighborhood where
now note:
which is to say,
but therefore, in this neighborhood, this function is locally a contraction map!
by banach fixed point theorem, there must be a unique point that sequences converge to.
this is stability
stability of a fixed point: if nearby, then you go to the fixed point!
multidimensional version:
take
So
if you have a map $xn+1 = f(x_n)$ and you find a value
if $xn+1 = f(x_n)$, then near a point
that is, near a fixed point, system will behave as a linear system with the derivative of the fixed point.
example: if $xn+1 = x_n + f(x_n)$, redefine $xn+1 = g(x_n)$.
what’s the analytical solution?
if
if
plug in diagonalization: $\pmb{x}n+1 = P-1DP\pmb{x}_n = P-1D^nPx_0$
so it’s just 3 independent variables moving around, warped by some transformation
do we know if it’s going to a fixed point? well, must have all systems going to fixed point, i.e. eigenvalues
note: it’s not the norm that’s less than one! it’s that each of the eigenvalues should be in the unit circle.
$xn+1 = α_0 x_n + … + α_m xn-m$
write as $[x^1n+1 … xm+1_{+1]^T$
can convert to a matrix:
if there’s a perturbation at time 0, …?
comes down to whether characteristic polynomial of time system has roots in unit circle in
…
can use linearity of expectation, look at how system acts in mean
jhgilles: what if system escapes area around fixed point?
…
jhgilles: parseval networks are sorta like this; if you think of each layer as a function, lipschitz means vector doesn’t escape no matter how many layers you have
don’t necessarily converge to a point though?
periodic behavior $un+1 = -u_n$ that has period 1; can extend period, when you get to infinity period that’s chaos
function solve_system(f, u0, p, n)
u = u0
for i in 1:n-1
u = f(u, p)
end
u
end
for this to be efficient, julia needs to know about type of function in julia, all functions have a unique type; this forces system to auto-specialization mechanism to always specialize higher-order function (this is slightly inside baseball, could get this behavior other ways…) can also force system to work with function pointers (FunctionReprs.jl); but make sure function pointer has sensible return types. also, cost of functionthis system should approach 0:
f(x, p) = x^2 -p*x
solve_system(f, 1., .25, 10)
-> approaches 0!
…
region w/ lipschitz derivative is
solve_system(f, 1.251, .25, 100)
how does all of this perform?
pretty well! it’s also generic.
you can also cache results as you go: TODO look up in notes
don’t worry too much about cost of appending to array, grows by doubling; but can still pre-allocate for slightly better performance if u feel like it
save points as rows: sensible save points as columns: better in memory
important: slices in julia allocate!!?!?! have to use `@view` also, permutation copies by default as well, need to use PermutedDimsArray
pushing is more efficient than rebuilding matrix every time, dumbass