19
Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 1 Review of Dynamical Systems Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum • decay of radioactive material • a chemical reaction • growth of a plant • formation of a Tornado • galloping of a horse • reaching for a cup of tea • action potential traveling down an axon • remembering an event A universal mathematical language for describing processes unfolding in time is dynamical systems theory. 1. Continuous time systems: differential equations 2. Discrete time systems: iterated maps, difference equations, cellular automata

Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 1

Review of Dynamical SystemsReview of Dynamical Systems

Natural processes unfold over time:• swinging of a pendulum• decay of radioactive material• a chemical reaction• growth of a plant• formation of a Tornado• galloping of a horse• reaching for a cup of tea• action potential traveling down an axon• remembering an event

A universal mathematical language for describing processes unfolding in time is dynamical systems theory.

1. Continuous time systems: differential equations2. Discrete time systems: iterated maps, difference equations, cellular automata

Page 2: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 2

Differential EquationsDifferential Equations

General Problem: can be very hard or even impossible to solve analyticallyThree Approaches:• Numerical simulation: generate approximate solutions with computer• Local stability analysis: study fixed points and surrounding areas• Global stability analysis: look for an “energy” function governing global behavior

Consider these ordinary first orderDEs: ttxftx ),()( )()( txftx autonomous

non-autonomous

Note: non-autonomous systems can always be turned into autonomous systemsby adding a new variable.

Example:)(

1

1)( tx

ttx

2)()(

)()()(

tyty

txtytx

is equivalent tothe system

Page 3: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 3

Idea 1: read this as a prescription of how to chose dx(t)/dt (the slope of x(t))as a function of x(t):

Graphical Interpretations of a DEGraphical Interpretations of a DE

)()( txtx

Solving the DE means to find smooth curves that have these line segments as tangents, there’s one curve through any point.

t

x

)exp()( 0 tAtx

Page 4: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 4

Idea 2: read this as a prescription of how x(t) “flows” as a function of x(t)

This picture is the 1-D flow field of the DE.If x is positive (right side) x will be shrinking (left arrow).If x is negative (left side) x will be growing (right arrow).At x=0, dx/dt=0, i.e. x does not change at all: steady state, fixed point.

x0

)()( txtx )exp()( 0 tAtx

Note: this qualitative analysis is the 1-D version of a “phase space analysis”. It allows to read off the long term behavior easily. It can always be done, even for DEs where solution cannot easily be found analytically.

Page 5: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 5

Linear SystemsLinear SystemsMotivations:• linear systems are easy to work out analytically: the solution essentially reduces to solving a linear algebra problem• few systems are linear, but what we will use what we learn here for the stability analysis of non-linear systems

Consider the following general linear system:

x: N-dim. vector, A: NxN matrix, b N-dim. vector

Note: all essential aspects of linear systems can be studied in 2 dim. systems.

bAxx )()( tt

Page 6: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 6

Stationary state, homogeneous Stationary state, homogeneous and inhomogeneous systemand inhomogeneous system

Inhomogeneous system: x: N-dim. vector, A: NxN matrix,b: N-dim. vector

bAxx )()( tt

Stationary state of inhomogeneous system:

Homogeneous system: )()( tt Axx

bAxbAxx 1000 0

Introduce deviation from stationary state, y(t):

(if A invertible)

)()( )()( 0 tttt xyxxy | plug into DE

)(

)()()()()( 00

t

ttttt

Ay

bAxAybxyAy

If we find a solution to the homogeneous DE for y(t), the solution for x(t) isobtained by simply adding x0.

Page 7: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 7

Solution of homogeneous systemSolution of homogeneous system

Homogeneous system: )()( tt Axx

Besides the trivial solution x(t)=0, a solution requires this determinant to be zero:

Ansatz: )()exp()()exp()( ttttt xaxax

Put back in DE: )()( tt xAx Eigenvalue problem

0 IA

This so-called characteristic equation determines the Eigenvalues or rootsof the system. The Eigenvalues determine the character of the solution:

• all real parts negative: asymptotic stability• highest real part equal to zero: marginal stability• at least one real part positive: unstable• non-zero imaginary parts: oscillatory components

Page 8: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 8

D.H. Ballard, Natural Computation

Page 9: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 9

Some phase portraits of 2-D systemsSome phase portraits of 2-D systems

Page 10: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 10

Physical analogs for different Physical analogs for different kinds of stabilitykinds of stability

Consider object sliding across a hilly landscape. Stationary point: dx/dt=0What happens if system in stationary state gets a small “nudge”?

system returns tostationary point:point is stable

(asymptoticallystable)

system runs awayfrom stationary point:

point is unstable

system rests atneighboring point:marginally stable

x

saddle point:direction of small

nudge matters

Page 11: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 11

Negative Feedback in the RetinaNegative Feedback in the Retina

Page 12: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 12

Electrical response (current) of a primate photoreceptor to 1.0s light stimulus turned on at t=0 (Schnapf et al., 1990)

Model negative feedback to conefrom horizontal cells by the followinglinear system:

chh

lkhcc

h

c

1

1

011

1

c

hh

cc

lk

h

c

h

c

Rewrite in matrix form to better see linear structure:

bAxx )()( tt

Stationary state:

10 0000

k

lchhc

is of the form

Page 13: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 13

Specific case:

Plot of solution to modelequations for step input:

4 ,08.0 ,025.0 kss hc

For L=10 the stationary point is c0=h0=2, leading to the homogeneous equation:

'

'

5.125.12

16040

'

'

h

c

h

c

The Eigenvalues of this matrix are:

i56.4225.26

Both Eigenvalues have negative real partsand non-zero imaginary parts, from whichwe see that the solution has the character ofa spiral point (damped oscillation), inparticular, the stationary point is stable.

Page 14: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 14

Numerical Solution MethodsNumerical Solution Methods

Motivation:In only few instances can we easily obtain analytical solutions to our problems. But we can always simulate.

But:This does not mean that we should run simulations only. Whenever we can get analytical answers, they typically provide interesting insights.

Note:We will consider the 1-dim. case, but all methods we discuss (Euler method, improved Euler method, fourth order Runge Kutta) generalize to N dimensions easily.

Page 15: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 15

Euler MethodEuler Method

Consider the ordinary first order DE: )()( txftx

Idea:approximate derivative with finite ratio:

t

txttx

t

xtx

)()(

)(

)()()(

txft

txttx

ttxftxttx )()()(Now solve for x(t+Δt):

Given an initial condition x(0) we can select a “suitable” Δt andcompute xn=x(t+nΔt) in an iterative manner, n=1,2,3,…

This is the so-called Euler method, a first-order method.

Page 16: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 16

Graphical InterpretationGraphical Interpretation

Idea: extrapolate tangents to x(t) for finite distance

tttxftxttx ),()()(

t

x(t) true x(t)

t0 t0+Δt t0+2Δt

true x(t0+Δt)

estimated x(t0+Δt)

errorslope f(t0)

Page 17: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 17

Improved Euler MethodImproved Euler Method(2(2ndnd order Runge Kutta method) order Runge Kutta method)

Euler Method can be viewed asfirst order Taylor approximation:

Other methods can be derived by considering higher order approximations.

Improved Euler Method works in two steps:

ttxftxttx )()()(

2))((

2

1)()()( t

dt

txdfttxftxttx

txfxfxx

txfxx

nnnn

nnn

11

1

~2

1

~ “trial step”

“real step”

Intuition: average slopes at beginning and end of interval.

Page 18: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 18

44thth order Runge Kutta Method order Runge Kutta MethodMotivation: higher order methods make more accurate steps but are not necessarily better. Important is also the number of computer operations necessary per step. The 4th order Runge Kutta method is good compromise:

432161

1

34

221

3

121

2

1

22

)(

)(

)(

)(

kkkkxx

tkxfk

tkxfk

tkxfk

txfk

nn

n

n

n

n

Notes: The right choice of Δt is problematic:Δt too small: simulations take long, Δt too big: simulations can be grossly incorrect• good heuristic is to halve Δt and see if result remains the same• more advanced: variable step size methods

Page 19: Jochen Triesch, UC San Diego, triesch 1 Review of Dynamical Systems Natural processes unfold over time: swinging of a pendulum

Jochen Triesch, UC San Diego, http://cogsci.ucsd.edu/~triesch 19

Local Stability AnalysisLocal Stability Analysis

Step One: find stationary point(s)

Step Two: linearize around all stationary points (using Taylor expansion),the Eigenvalues of the linearized problem determine nature of stationary point:

Real parts: positive: growth of fluctuations, instability negative: decay of fluctuations, stability

Imaginary parts: if present, solutions are oscillatory (spiraling) spiraling inward or outward if non-zero real parts

Overall: point (asymptotically) stable if all real parts negative