May28 Lab 1 3-D Tyson Model Bifurcation and Hodgkin Huxley coupling Notes written by Jiafen Gong, edited slightly by Leah Keshet Below is what Bard taught in the lab on May 28 for Tyson’s model and Hodgekin Huxley model. The code for the two files appears below. 2 Tyson Model Bifurcation • Change the integration method to ”STIFF” (nUmerics, Method, Stiff, return, escape). • First ’Initial condition’, ’Go’, we can get some periodic graph at the bottom of the drawing area. Click two peaks of the graph to find the approximate the period of the solution. It is about 56.45. • ’numerics’—change ’total’: 56.45, ’dt’:0.05, escape. • erase the original graph, ’IL’ several time to make sure to get closer and closer to the exact stable period orbit. • open the auto window. Select the auto settings as follows: ’Parameter’—’Par1’: m; ’Axes’—’hilo’— ’Xmax’: 30, ’Ymax’: 5; ’Numerics’—’Ntst’:60,’Nmax’:200,’Npr’:500,’Epsl’: 0.000001, ’ParMax’:30; • ’Run’—’Periodic’, two short lines appears in the left bottom corner, if necessary, click ’abort’ to stop them.; • ’Grab’ and enter. • ’Numerics’—’Ds’:-0.02. • ’Run’—’extend’, you will find the both two ends will extend, but it takes a long time, so if necessary, click ’abort’ to stop them. • Then we want to find the steady state. Before we do that, ’file’—’clear grab’. • Go back to Xpp, ’Parameter’—m:10, and ’IL’ several times. • Go back to Auto, and ’Run’—’Steady State’, a window will appear to ask you whether want to destroy the diagram, choose ’No’, a fancy S-shaped graph will be added to the diagram (lighter than the original one). • To see them more clearly, ’Axes’—’fit’, ’redraw’. You might get a graph with some space between the first set of darker lines and lighter S-shaped curve, depending on how long you run before you click ’abort’ when you run the extension. • ’Axes’—’fit’,’redraw’, the the former two darker line are averaged. 1 May28 Lab 2 • There is more interesting behaviour for smaller values of m. To see these, click file, clear grab, and go back to XPP window. Change m to 0.3, and resimulate (Initial Cond, Go, I L,I L,I L, I L). Return to AUTO windo, and reset the numerics so that Parmin=0.3, Parmax = 2. Run. This will allow you to see the fold bifurction. There is also a subcritical Hopf bifurcation at m = 0.5719. You can see this by grabbing the Hopf point, adjusting the numerics menu to get Parmin=0.2, Parmax=0.6 and running the periodic. • The last graph is the same as ’Tyson.ps’. Y 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 1 2 3 4 5 m 6 7 8 9 10 Fig 2.1: Bifurcation diagram produced by the tyson.ode file as per instructions described in the text May28 Lab 3 Y 0.5 0.4 0.3 0.2 0.1 0.5 1 1.5 2 2.5 m Fig 2.2: A zoom into part of the diagram shown in Fig 2.1. Y 0.5 0.4 0.3 0.2 0.1 0.2 0.4 0.6 m 0.8 Fig 2.3: A further zoomed view. 1 May28 Lab 4 2 1.8 A 1.6 1.4 1.2 P 1 0.8 0.6 Y 0.4 0.2 0 0 50 100 150 200 Fig 2.4: The oscillating YPA system when cell mass is m = 2.2 May28 Lab 3 Hodgkin Huxley coupling • Open hhh.ode, change ’i0’=10. • ’Initial conditions’—’go’, a vertical line appears. • ’IL’ several times, ’erase’—’IL’—’Xi vs t’, input ’V’. some nice periodic function appears. • change ’numerics’—’total’=15 (a little bigger than the approximate period, so that you can have two peaks appear in your graph), enter escape. ’erase’,IL, almost one and one half period appear. • We want to simulate exactly one period. So select the blue button on the top of the XPP simulation window ’data’—’find’—’Variable’:V,’value’:1000 (any number you expect bigger than the peak.), click Ok, the v value in first line is the peak, press ’get’. • Go back to Xpp,’IG’, the the graph begins as peak, but is a little bit more than one period. • Go back to ’data’—’end’—use upper arrow to find 14.65 in the next time for peak (need to judge by value of v). • Go back to Xpp, change ’numerics’—’total’=14.65. enter, escape ; ’erase’-’IL’. we get an exact period. • ’numerics’—’Averaging’—’New adjoint’—escape—’Xi vs t’, input ’v’, a phase resetting curve will appear. • ’numerics’—’Averaging’—’Make H’— input ”v’-v” for coupling for v, and use default for the other queries (click enter), escape—’Xi vs t’, input ’v’, another graph appears. • ’numerics’—’stochastic’—’fourier’—’v’, then go back to ’data’—’home’, the first column(labeled by v) is coeff. for cos, and second column(labeled by M) is coeff. For P sin in the fourier expansion. you can check and plot i = 0K v(i) ∗ cos(i ∗ x) , you will find it is a nice approximation of the graph in last step. K can be chosen 4 or 5, it fits very well. 4 Saving graphs • In Auto, ’file’—’postcript’, save graph as a picture can be opened by GSview. • In Xpp, ’file’-’write set’, the file is end by expansion ’set’. When you want to use these data, just open the file(exact the same when you create the set file), then ’file’—’read set’—’IL’. you have your graph redraw again. 5 May28 Lab 6 0.5 0.4 0.3 0.2 0.1 0 -0.1 -0.2 0 2 4 6 8 10 12 14 12 14 Fig 3.5: The phase resetting curve. 3 2 1 0 -1 -2 -3 0 2 4 6 8 10 Fig 3.6: The function H for the file hhh.ode. May28 Lab 5 Tyson.ode #tyson.ode # Equations # Equations Y’=k1-(k2p+k2pp*P)*Y P’=(1-P)*(k3p+k3pp*A)/(J3+1-P)-P*k4*m*Y/(J4+P) A’=k5p+k5pp* ((m*Y/J5)^n)/(1+(y*m/J5)^n)-k6*A # p p p p p Parameters with units of 1/time: k1=0.04 k2p=0.04,k2pp=1 k3p=1,k3pp=10 k4=35 k5p=0.005,k5pp=0.2,k6=0.1 # mass of cell (try m=0.6, m=0.3, m=1) p m=1 # p # @ @ @ @ @ @ Dimensionless parameters: J3=0.04,J4=0.04,J5=0.3,n=4 Numerics TOTAL=2000,DT=.1,xlo=0,xhi=2000,ylo=0,yhi=6 NPLOT=1,XP1=t,YP1=Y MAXSTOR=10000000 BOUNDS=100000 dsmin=1e-5,dsmax=.1,parmin=-.5,parmax=.5,autoxmin=-.5,autoxmax=.5 autoymax=.4,autoymin=-.5 # IC Y(0)=1 P(0)=0.5 A(0)=0.1 done 6 hhh.ode # hhh.ode init v=-65 m=.05 h=0.6 n=.317 par i0=0 par vna=50 vk=-77 vl=-54.4 gna=120 gk=36 gl=0.3 c=1 phi=1 par ip=0 pon=50 poff=150 7 May28 Lab is(t)=ip*heav(t-pon)*heav(poff-t) am(v)=phi*.1*(v+40)/(1-exp(-(v+40)/10)) bm(v)=phi*4*exp(-(v+65)/18) ah(v)=phi*.07*exp(-(v+65)/20) bh(v)=phi*1/(1+exp(-(v+35)/10)) an(v)=phi*.01*(v+55)/(1-exp(-(v+55)/10)) bn(v)=phi*.125*exp(-(v+65)/80) v=(I0+is(t) - gna*h*(v-vna)*m^3-gk*(v-vk)*n^4-gl*(v-vl))/c m=am(v)*(1-m)-bm(v)*m h=ah(v)*(1-h)-bh(v)*h n=an(v)*(1-n)-bn(v)*n # track the currents aux ina=gna*(v-vna)*h*m^3 aux ik=gk*(v-vk)*n^4 aux il=gl*(v-vl) # track the stimulus aux stim=is(t) @ bound=10000 done 8