0% found this document useful (0 votes)
14 views

pset_7_rnk

Modeling problem set

Uploaded by

Bobby Kent
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

pset_7_rnk

Modeling problem set

Uploaded by

Bobby Kent
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

MATH 463

Computer Lab / Problem Set 7


Bobby Kent
11/11/20

Question 1
a) I would make the potassium channel n behave like the slow component of the sodium channel,
specifically describing its opening rate (An) with an exponential decay function with respect to voltage
(similar to Ah) and its closing rate (Bn) as a sigmoid (similar to Bh). This would make n ∞, and therefore
potassium current, decrease with increasing voltage.
b) I would multiply the sodium current by an additional h term. The main equation would then appear as
follows:
dV 3 2 4
C + gNa m h ( V −E Na ) + g k n ( V −E k ) + g L ( V −E l ) + I App =0
dt
dm dh ,∧dn
c) I would scale the rate equations for sodium (fast and slow) and potassium channels ( , ¿ to
dt dt dt
model an increased opening/closing rate. The main (Kirchoff) equation shouldn’t be changed directly,
though, as this isn’t a temperature-dependent process.
Question 2
Simulations of the Type 1 and Type 2 Morris-Lecar models. Applied current is varied from 0 (dark blue) to 100
(light blue) at an interval of 20.

Bifurcation plots for the Type 1 and Type 2 models show bifurcation points at applied currents of ~40 and ~89
for Type 1 and Type 2 models, respectively.
These plots show how period behaves as a funciton of applied current. The data prior to the bifurcation point
(~40 for Type 1, ~88 for Type 2) are just an artifact of how I found the period; they were the result of a peak
finding algorithm being applied to steady states (no period). The actual data (past the bifurcation point) shows
that Type 1 periods can be arbitrarily long as the applied current approaches the bifurcation point from the
right, while Type 2 periods are less sensitive to applied current.

Type 1 models undergo SNIC bifurcaitons, where two fixed points coalesce to a single fixed point, which then
disappears. At the precise applied current where there’s a single fixed point, the period can become arbitrarily
long, demonstrated by the vertical asymptote at the bifurcation point. In a Type 2 model, a Hopf bifurcation
occurs, whereby a single fixed point becomes less stable with increasing applied current. As a result, while
period still decreases with increasing applied current, it does not increase arbitrarily when approaching the
bifurcation point from the right.

Code:
global II
global type
global correction
correction = 0;

%% Question 2
if Q2 == 1
for type = 1:2

%Initialize figure
h_fig = figure(fc); fc = fc + 1;
set(h_fig,'Units','Normalized','Outerposition',[0 0.3 0.6 0.7]);
hold on

D{type} = [NaN NaN];


i_i = 0;
II_v = 0:1:200;
for II = II_v

[t, x] = ode45(@ml, 0:0.1:2000, [.5 .5]);

if II == 0 || II == 20 || II == 40 || II == 60 || II == 80 || II == 100
plot(t, x(:,1),'LineWidth',2);
title(['Type ' num2str(type)]);
axis([0 1000 -65 40]);
xlabel('Time (msec)');
ylabel('V');
end
%Find maxima and minima in latter tenth of the data
extx = [];
for i=round(length(x)*3/5):length(x)-1
if ((x(i,1)>=x(i-1,1))&&(x(i,1)>=x(i+1,1)))||((x(i,1)<=x(i-
1,1))&&(x(i,1)<=x(i+1,1)))
D{type}=[D{type};II x(i)];

if((x(i,1)>=x(i-1,1))&&(x(i,1)>=x(i+1,1)))
extx=[extx i];
end
end
end

i_i = i_i + 1;
pd{type}(i_i) = mean(extx(2:end) - extx(1:end-1))/10; %Get average difference
between peaks
end

set(gca,'FontSize',35,'TickDir','Out','LineWidth',3);
end

%Initialize figure
h_fig = figure(fc); fc = fc + 1;
set(h_fig,'Units','Normalized','Outerposition',[0 0.2 0.7 0.8]);

for type = 1:2


subplot(2,1,type); hold on
plot(D{type}(:,1),D{type}(:,2),'bo','MarkerSize',5,'MarkerFaceColor',[0 0 1])
xlabel('Applied Current');
ylabel(['Type ' num2str(type)]);
set(gca,'FontSize',35,'TickDir','Out','LineWidth',3);
end

%Plot period
for type = 1:2
h_fig = figure(fc); fc = fc + 1;
set(h_fig,'Units','Normalized','Outerposition',[0 0.3 0.6 0.7]);
hold on
plot(II_v,pd{type},'bo','LineWidth',3,'MarkerFaceColor',[0 0 1]);
ylabel('Period');
xlabel('Applied Current');
title(['Type ' num2str(type)]);
set(gca,'FontSize',35,'LineWidth',3,'TickDir','Out');
end
end

Modified ml.m:
function y = ml(t, x)

% first type global II in your matlab command line. Then define II to be whatever value
you wish
% bifurcation for this parameter set is around II = 88.3 This is for the
% type II parameters

global II;
global type

V = x(1); w = x(2); Vone = -1.2; Vtwo = 18; Vthree = 2; Vfour = 30;


gca = 4.4; gk = 8.0; gl = 2; Vk = -84; VL = -60; Vca = 120;
C = 20; phi = 0.04;
% to try the other parameter set uncoment the following lines, the
% bifurcation occurs around II = 40 and type I behavior

if type == 1
Vthree = 12; Vfour = 17.4; gca = 4.0; phi = (1/15.0);
end

minf = 0.5*(1+tanh((V-Vone)/Vtwo));
winf = 0.5*(1+tanh((V-Vthree)/Vfour));
tw = 1/(cosh((V-Vthree)/(2*Vfour)));

y(1) = (1/20.0)*(-gca*minf*(V - Vca) - gl*(V - VL)- gk*w*(V - Vk) + II);


y(2) = phi*(winf - w)/tw;
y = y';

Question 3
The H-H models with applied currents of 0, 8, and 16 are as follows:
The model is bistable at an applied current 8.
Simulating the model with initial conditions from
the HH.m file ([4.21 0.0858 0.3838 0.4455]) gives
a steady state (solid black), while increasing the
initial conditions to [1 1 1 1] results in oscillations
(dashed black).

This occurs because the model undergoes a subcritical Hopf bifurcation around applied current = 8, whereby
initial conditions closer to a fixed point result in convergence to the fixed point, while starting farther away
results in oscillations.

Code:
%% Question 3
if Q3 == 1

%Initialize figure
h_fig = figure(fc); fc = fc + 1;
set(h_fig,'Units','Normalized','Outerposition',[0 0.3 0.6 0.7]);
hold on
hpc = 1;
color = {'r' 'k' 'b'};

II_v = [0 8 16];
II_i = 0;
for II = II_v

II_i = II_i + 1;
[t, x] = ode45(@HH, 0:0.01:100, [4.21 0.0858 0.3838 0.4455]);

h_p(hpc) = plot(t, x(:,1),color{II_i},'LineWidth',3); hold on; hpc = hpc + 1;

if II == 8
[t, x] = ode45(@HH, 0:0.01:100, [1 1 1 1]);
h_p(hpc) = plot(t, x(:,1),[color{II_i} '--'],'LineWidth',3); hold on; hpc =
hpc + 1;
end
end

legend(h_p,{'Applied Current = 0' 'AC = 8, Steady' 'AC = 8, Firing' 'AC =


16'},'Location','NorthWest');
set(gca,'Box','Off','TickDir','Out','FontSize',35,'LineWidth',3);
ylabel('V');
xlabel('Time');
end

Modified HH.m:
function Y = HH(t, X)

global II
global correction

% Note these equations use the HH scaling so that rest is 0 rather than -70mV.
%Thus, the voltage has been increased by 70mV. You can revert back to the
%original equations by using the commented line in the Bn function.
gna = 120; ena = 115; gk = 36; ek = -12; gl = 0.3; el = 10.613; appcurr = II;

V = X(1);
M = X(2);
N = X(3);
H = X(4);

% The follow code corrects for removable singularities at 10, 25 and 30.
if V == 10
V = 10.000001;
end
if V == 25
V = 25.000001;
end
if V == 30
V = 30.000001;
end

Y(1) = appcurr + gna*M*M*M*H*(ena - V) + gk*(N^4)*(ek - V) + gl*(el-V);


Y(2) = Am(V)*(1-M) - Bm(V)*M;
Y(3) = An(V)*(1-N) - Bn(V)*N;
Y(4) = Ah(V)*(1-H) - Bh(V)*H;
Y = Y';

function y = Ah(V)
y = 0.07.*exp(-V./20.0);
end
function y = Am(V)
y = (25.0 - V)./(10.0.*(exp((25.0 - V)./10.0) - 1.0));
end
function y = An(V)
y = (10.0 - V)./(100.0.*(exp((10.0 - V)./10.0) - 1.0));
end
function y = Bh(V)
y = 1.0./(exp((30.0-V)./10.0)+1.0);
end
function y = Bm(V)
y = 4.0.*exp(-V./18.0);
end
function y = Bn(V)
if correction == 0
y = 0.125.*exp(-V./80.0);
else
y = 0.125.*exp(-V./19.7);%Corrected HH model
end
end
end
Question 4
The modification listed on page 62 of DF causes the closing rate of the potassium gate (Bn) to decrease more
quickly with increasing voltage, which causes the model to take on Type 3 behavior and fire only once:

Code:
%% Question 4
if Q4 == 1

correction = 1; %Turn on HH correction

%Initialize figure
h_fig = figure(fc); fc = fc + 1;
set(h_fig,'Units','Normalized','Outerposition',[0 0.3 0.6 0.7]);
hold on
hpc = 1;
color = {'r' 'k' 'b'};

II_v = [0 8 16];
II_i = 0;
for II = II_v

II_i = II_i + 1;
[t, x] = ode45(@HH, 0:0.01:100, [4.21 0.0858 0.3838 0.4455]);

h_p(hpc) = plot(t, x(:,1),color{II_i},'LineWidth',3); hold on; hpc = hpc + 1;


end

legend(h_p,{'Applied Current = 0' 'AC = 8' 'AC =


16'},'Location','NorthEast','Box','Off');
set(gca,'Box','Off','TickDir','Out','FontSize',35,'LineWidth',3);
ylabel('V');
xlabel('Time');
axis([0 50 -20 100]);
end

**Modified HH.m shown under Question 3**

You might also like