31
Recap

Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

  • Upload
    volien

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Recap

Page 2: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Terminologyrecap

• Variableorstate• Differentialequation• Initialcondition• Trajectory• Parameter• Steadystate• Transientbehaviour• Perturbation• Ordinarydifferentialequations(ODE)• 3dimensionalODE

Page 3: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Terminologyrecap

• Phasespace/statespace• Vectorfield• Fixedpoint(stable/unstable,focus/node)• Nullcline• Saddles,separatrix• Bistability

Page 4: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

DynamicalSystems

[email protected]

Page 5: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Overview• Whataredynamicalsystems?• Howtointerpretadifferentialequation• Howtoanalyse differentialequationsystems• Howtosolvedifferentialequationsystems• Stabilityanalysis,multistability• Oscillatorysolutions• Parametervariations,bifurcations• Choiceofcoolstuff:Chaos,turbulence,spatio-temporalsystems,slow-fastsystems,transients,andmore.

Page 6: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Numericallysolvingdifferentialequations

Page 7: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Numericallysolvingdifferentialequations

• Why?– Veryrarethatwecananalyticallysolveequations– Implementationspeed– Convenience

• Whynot?– Sometimeslongsimulationtimes– Inaccuracies– Variationsbetweendifferentsolvers

Page 8: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Numericallysolvingdifferentialequations:methods

• Euler• Heun• Runge-kutta

Page 9: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Eulermethod

Exampleequation:dydt=f(t,y)Solvesinafixedstep(h=1)iterativemanner

Letssayinitialcondition,y0 = 1 and f(t,y)=y

Ifwestartwithy=0 attime(t)=0,howmuchdoesy changebetweent=0 andt=4?

Page 10: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Eulermethod

Exampleequation:dydt=f(y)Solvesinafixedstep(h=1)iterativemanner

Letssayinitialcondition,y0 = 1 and f(y)=y

Time->

Page 11: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Eulermethod

• Notveryaccurateifh istoolarge

Page 12: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Eulermethod

• Notveryaccurateifh istoolarge

• Alternatively:Notveryaccurateifthechangeiny,relativetothechangeint(i.e.h)istoolarge

Page 13: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Eulermethod

Page 14: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Eulermethod:anotherexample

Page 15: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Eulermethod:anotherexample

• Inphasespace

Page 16: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Eulermethod:code

Page 17: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Eulermethod• Knownasafixedstepsolversinceh isaconstant(intheseexamplesalwaysh=1)

• Easytoimplement• Predictableruntimes(scaleslinearlywithnumberoftimesteps)

• Easilyadaptedtoincorporatedelayse.g.wheredydt=f(y,t-τ)

• Easilyadaptedtoincorprate noisee.g.dydt=f(y,t)+w• Canbeslowandinaccuratecomparedtoothersolvers...

Page 18: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

• Usesinformationfromtwopoints– Changeiny aty(t)– Changeinyatpredictedy(t+Δt)– dydt= y(t) + h/2 (f(y,t) + f(t+Δt,y+h f(y,t)))

Heun’s method

Page 19: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Heun’s method• Usesinformationfromtwopoints

– Changeiny aty(t)– Changeiny atpredictedy(Δt)– dydt= y(t) + h/2 (f(y,t) + f(t+Δt,y+h f(y,t)))

Page 20: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Heun’s method

SameasEuler’smethod• Usesinformationfromtwopoints

– Changeiny aty(t)– Changeiny atpredictedy(Δt)– dydt= y(t) + h/2 (f(y,t) + f(t+Δt,y+h f(y,t)))

Page 21: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Heun’s method• Usesinformationfromtwopoints

– Changeiny aty(t)– Changeiny atpredictedy(Δt)– dydt= y(t) + h/2 (f(y,t) + f(t+Δt,y+h f(y,t)))

Page 22: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Euler’smethod• Usesinformationfromonepoint

– Changeiny aty(t)

Page 23: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

ComparingEulerandHeun methods

Euler Heun

Page 24: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Heun’s methodcode

Page 25: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Heun’s method

• Knownasasecondordermethod• IsmorecomputationallyexpensivethanEuler’smethodforthesamestepsize(twofunctionevaluations)

• OutperformsEuler’smethodforthesamestepsize

• Canincorporatenoise(morecomplicatedthough)• Canincorporatedelays(again,morecomplicated)• Stillnotthebestthough...

Page 26: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Runge Kutta• Fourthordersolver• InHeun’s methodthemeanbetweenthestartandendpointsistaken

• InRunge Kutta differentweightsaregiventodifferentpoints

Page 27: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Runge Kutta code

Page 28: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Runge Kutta’s method• Knownasafourthordermethod• IsmorecomputationallyexpensivethanEuler’smethodforthesamestepsize(fourfunctionevaluations)

• OutperformsEuler’smethodforthesamestepsize

• OutperformsHeun’s method• Canincorporatedelays(complicated)• Difficult&complicatedtoincludenoise(ongoingresearch)

Page 29: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Errortolerance

• Canestimatetheerrormadeateachstep(inaniterativemanner)

• Thiserroriscalledtheabsoluteerror• Canthencalculatetherelativeerror(absoluteerror/currentstate)

• WecantelltheMatlab solverswhaterrorswecantolerate:

• options =odeset(’RelTol',1e-3,’AbsTol',1e-6)ode45(@odefunc,timespan,initialConditions,options,…)

Page 30: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Variablestepsolvers

Page 31: Recap - Dynamic Connectome Lab · PDF fileTerminology recap •Variable or state •Differential equation •Initial condition •Trajectory •Parameter •Steady state •Transient

Finalwordsofcaution

• Whensimulatinganewsystemitisalwaysworthcheckingtheresultswithdifferentsolversanderrortolerancesettings

• Especiallywhenexpectyourdynamicstochangeslowly,butwithsuddenfastburstsofactivity

• NumericalsolutionsareALWAYSONLYANAPPROXIMATION