Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Kim Minjung Bioen 485 Lab 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

MINJUNG KIM

BIOEN 485 Lab 3: Nonlinear Analysis

1
=

1 +

2
=

1 +
u & v = protein concentrations
1. Stability Analysis:
a) Solve for the nullclines and equilibrium points and plot them on a phase plane plot. (5 pts)
= = 2 ; 1 = 3.5; 2 = 4

Nullclines
5

du/dt = 0
dv/dt = 0

4.5
4
3.5

3
2.5
2
1.5
1
0.5
0

u
Equilibrium points:
v
3.8032
1.0307
0.3923

clear all; close all; clc


% FINDING NULLCLINES

u
0.2263
1.6977
3.0326

MINJUNG KIM

alpha_1 = 3.5; alpha_2 = 4; beta = 2; gamma = 2;


u = linspace(0,5,100);
v = linspace(0,5,100);
u_nullcline = alpha_1./(1 + v.^beta);
v_nullcline = alpha_2./(1 + u.^gamma);
[v_eq,u_eq] = polyxpoly(v,u_nullcline, v_nullcline, u);
figure(1)
plot(v, u_nullcline,'r-','LineWidth',2)
hold on
plot(v_nullcline, u,'b-','LineWidth',2)
title('Nullclines','FontSize',15)
xlabel('v','FontSize',12); ylabel('u','FontSize',12)
legend('du/dt = 0','dv/dt = 0','equilibrium points','FontSize',12)
plot(v_eq,u_eq,'ko','LineWidth',2)

b) Determine if this is a bistable switch using stability analysis and interpreting your results. (5
pts)
1 1
1
( + 1)2
=
2 1
1
[ ( + 1)2
]
u
0.2263
1.6977
3.0326

v
3.8032
1.0307
0.3923

Stability

-1.4271 -0.5729
Stable
-2.2364 0.2364 Unstable
-1.6937 -0.3063
Stable

% DETERMING STABILITY
J = zeros(2,2);
J(1,1) = -1; J(2,2) = -1;
eig_values = zeros(2,3);
for i = 1:3;
J(1,2) = -alpha_1*beta*(v_eq(i)^(beta-1))/(v_eq(i)^beta + 1)^2;
J(2,1) = -alpha_2*gamma*(u_eq(i)^(gamma-1))/(u_eq(i)^gamma + 1)^2;
eig_values(:,i) = eigs(J);
end

2. Phase plane analysis:


a. Illustrate the bistability by plotting the trajectories on a phase plane plot and interpreting
the results. (10 pts)
function [dX] = toggle(t, X)
alpha_1 = 3.5; alpha_2 = 4; beta = 2; gamma = 2; dX = zeros(2,1);
dX(1) = alpha_1/(1 + X(2)^beta) - X(1);
dX(2) = alpha_2/(1 + X(1)^gamma) - X(2);
end

MINJUNG KIM

Trajectories
4.5
4
3.5
3

2.5
2
1.5
1
0.5
0

0.5

1.5

2.5

3.5

function [dX] = toggle(t, X)


alpha_1 = 3.5; alpha_2 = 4; beta = 2; gamma = 2; dX = zeros(2,1);
dX(1) = alpha_1/(1 + X(2)^beta) - X(1);
dX(2) = alpha_2/(1 + X(1)^gamma) - X(2);
end
figure(2)
quiver(u_mesh,v_mesh,dudt,dvdt)
title('Trajectories','FontSize',15)
xlabel('u','FontSize',12); ylabel('v','FontSize',12)
hold on
plot(u_eq,v_eq,'ko','LineWidth',2)
T_max = 500;
X1_0 = [0; 1];
[T1,X1] = ode45(@toggle, [0 T_max],X1_0,[]);
plot(X1(:,1),X1(:,2),'c-','LineWidth',2)

4.5

MINJUNG KIM
3. Bifurcation Analysis (10 pts)
a alpha1 = 10; alpha2 =10
b alpha1 = 10; alpha2 = 4; linspace to 11, 200 pts

b
10

10
du/dt = 0
dv/dt = 0
Separatrix

du/dt = 0
dv/dt = 0

0
0

10

10

0.8

0.4
0.2
0

-0.4
-0.5

bistable
monostable
others

-0.2

0.5

0.9

log(alpha 1)

log(alpha 2)

log(alpha 2)

0.6

0.8
0.7
0.6
bistable
monostable
others

0.5
0.4
0.4

0.5

0.6

0.7

0.8

log(alpha 1)

0.9

MINJUNG KIM

Graph c without the log axis:

c
10

alpha 2

8
6
4
bistable
monostable
others

2
0

10

alpha 1
From these plots, I think that this system shows a pitchfork bifurcation. This is because plot c shows that
the system is usually monostable or bistable (which is the main characteristic of pitchfork bifurcation
that cannot be found in simple, transcritical, or hopf bifurcation).
clear all; close all;
% REPLICATING FIGURES A AND B FROM PAPER
alpha_1 = 10; alpha_2_a = 10; beta = 2; gamma = 2; alpha_2_b = 4;
u = linspace(0,11,200);
v = linspace(0,11,200);
u_nullcline_a = alpha_1./(1 + v.^beta);
v_nullcline_a = alpha_2_a./(1 + u.^gamma);
u_nullcline_b = alpha_1./(1 + v.^beta);
v_nullcline_b = alpha_2_b./(1 + u.^gamma);
figure(1)
subplot(1,2,1)
plot(u_nullcline_a, v,'r-','LineWidth',2)
hold on
plot(u, v_nullcline_a,'b-','LineWidth', 2)
plot(u, u, 'k--','LineWidth', 2)
title('a','FontSize',15)
xlabel('u','FontSize',12); ylabel('v','FontSize',12)

MINJUNG KIM
legend('du/dt = 0','dv/dt = 0','Separatrix','FontSize',12)
subplot(1,2,2)
plot(u_nullcline_b, v,'r-','LineWidth',2)
hold on
plot(u, v_nullcline_b,'b-','LineWidth',2)
title('b','FontSize',15)
xlabel('u','FontSize',12);
legend('du/dt = 0','dv/dt = 0','FontSize',12)
%%
clear all; close all; clc
% REPLICATING FIGURE C FROM PAPER
% initializing data structures
beta = 2; gamma = 2;
[a1_mesh, a2_mesh] = meshgrid(0:0.5:11,0:0.5:11);
length = max(size(a1_mesh));
all_eig_values = cell(length);
J = zeros(2,2);
J(1,1) = -1; J(2,2) = -1;
u = linspace(0,11,200);
v = linspace(0,11,200);
bistable = zeros(length^2,1); monostable = zeros(length^2,1);
bistable_index = 1; monostable_index = 1;
others = zeros(length^2,1); others_index = 1;
% iterating through all the combinations of alpha 1 and alpha 2
for i = 1:length;
for j = 1:length;
alpha1 = a1_mesh(i,j); alpha2 = a2_mesh(i,j);
% finding equilibrium points
u_null = alpha1./(1 + v.^beta);
v_null = alpha2./(1 + u.^gamma);
[u_eq, v_eq, iout, jout] = intersections(u,v_null,u_null,v,true);
% calculating eigen values of eq points determined
if min(size(u_eq)) == 0;
num_eq_pts = 0;
eig_values = [];
else
num_eq_pts = max(size(u_eq));
eig_values = zeros(2, num_eq_pts);
for k = 1:num_eq_pts;
J(1,2) = -alpha1*beta*(v_eq(k)^(beta-1))/(v_eq(k)^beta +
1)^2;
J(2,1) = -alpha2*gamma*(u_eq(k)^(gamma-1))/(u_eq(k)^gamma +
1)^2;
eig_values(:,k) = eigs(J);
end
end

MINJUNG KIM
all_eig_values{i,j} = eig_values;
% counting stable eq points
stable_count = 0;
for k = 1:num_eq_pts;
if eig_values(:,k) < 0;
stable_count = stable_count + 1;
end
end
% saving this alpha 1 and alpha 2 pair in the
%
appropriate data structure
if stable_count == 2;
bistable(bistable_index,1) = alpha1;
bistable(bistable_index,2) = alpha2;
bistable_index = bistable_index + 1;
elseif stable_count == 1;
monostable(monostable_index,1) = alpha1;
monostable(monostable_index,2) = alpha2;
monostable_index = monostable_index + 1;
else
others(others_index,1) = alpha1;
others(others_index,2) = alpha2;
others_index = others_index + 1;
end
end
end
% run the code up to here first time around
% note indices where the zeros start in bistable, monostable, and others
% use those indices to truncate unnecessary zeros
bistable = bistable(1:182,1:2);
monostable = monostable(1:390,1:2);
others = others(1:53,1:2);
figure;
plot(log10(bistable(:,1)),log10(bistable(:,2)),'b.','LineWidth',2)
hold on
plot(log10(monostable(:,1)),log10(monostable(:,2)),'r.','LineWidth',2)
plot(log10(others(:,1)),log(others(:,2)),'k.','LineWidth',2)
xlabel('alpha 1','FontSize',12); ylabel('alpha 2','FontSize',12);
title('c','FontSize',15);
legend('bistable','monostable','others')

4. Non-dimensionalize the model provided.


1
1
=
1 1

2
1
( 21
) 2 + 1
2 2
2
1
=
2 1

(1 11
) 21 + 1
1 1

MINJUNG KIM
1
2

& =
& =

1
2

1
1

=
1 1
(1
2
2
21 ) 2 + 1
2
2
C2
1

=
2 2
(1
1
1 + 1
)

11
1
1
1
Simplify this to
1
1

=
1
(1
2
2 + 1
)

21
2
=

1
1

=
2
(1
11 ) 11 1 + 1
1
1
Set up the constants so that the equations simplify
1
1
1=
=

1
11
11
(1 11
) 1 = 1 1 1 = 11 1 = (1
1 )1/1
1 1
21
21
(1 21
) 22 = 1 22 = 2
2 2 = (2
2 )1/2
2 2
Now plugging these values into the equations
1

= 2 1 1
+ 1
1


= 1 2 2
+ 1
Define the terms to format it like that of the paper.

1 =

1
1
=

1
11
(1
1

1
)1

& 2 =

2
2
=
21
2
(2 2 )1/2

1
=

+ 1

2
=

+ 1

& = 2 & = 2

You might also like