finding the nullclines of a two connected ODE's
up vote
0
down vote
favorite
so I've given the following problem:
$dn_1/dt=N(t)n_1-n_1$
$dn_2/dt=N(t)n_2-4n_2$
$N(t)=25-6n_1-3n_2$
so I've found the fixed points of the 2 equations and got:
[(0,0),(0,7),(4,0)]
now I want to find the nullclines of them:
so for $dn_1/dt=0$ we get $n_1(24-6n_1-3n_2)$ which means:
$n_1=0$ for all $n_2$
$n_1=4-0.5n_2$
so for $dn_2/dt=0$ we get $n_2(21-6n_1-3n_2)$ which means:
$n_2=0$ for all $n_1$
$n_2=7-2n_1$
plotting the following using matlab in order to find the phase plane and basin of attraction gives peculiar results which I can't find to be able to understand. (fig attached below)
I thought the the 3 nullcline need to be intersecting both the fixed points which is more intuitive to me but instead I get the following.
the Matlab code generating this plot is as follows:
clear, close all; clc
%Const
N0=25;
G1=1;G2=1;
a1=6;a2=3;
k1=1;k2=4;
%Params
t0 = 0; % starting time
dt = 0.5; % step size
tEnd = 50; % end time
timeVec=t0:dt:tEnd;
NumSteps=floor(tEnd./dt);
%Function Handlers
N_t=@(n1,n2) N0-a1.*n1-a2.*n2;
n1_dot=@(n1,n2) G1.*N_t(n1,n2).*n1-k1.*n1;
n2_dot=@(n1,n2) G2.*N_t(n1,n2).*n2-k2.*n2;
%%finding the fixed point's
%%%%%%%%%
system=@(n1,n2) [n1_dot(n1,n2);n2_dot(n1,n2)];
s = solve(system);
%%%%%%%%%
%TODO RECHECK!!!!
%%nulclines
%%%%%%%%%
%n1_dot=0
%case 1: n1 = 0
%case 2: n1 != 0
%n2_dot=0
%case 1: n2 = 0
%case 2: n2 != 0
%%%%%%%%%
ptsMesh=-10:0.2:25;
figure
[X,Y]=meshgrid(ptsMesh);
U=n1_dot(X,Y);
V=n2_dot(X,Y);
normalizedFactor=sqrt(U.^2+V.^2);
quiver(X,Y,U./normalizedFactor,V./normalizedFactor,1,'b')
hold on
plot(s.n1,s.n2,'k*','lineWidth',8)
%plot the trivial nullclines on the axis
[x,y]=size(ptsMesh);
nullclineN1_zero=[0,min(ptsMesh);0,max(ptsMesh)];
nullclineN2_zero=[min(ptsMesh),0;max(ptsMesh),0];
plot(nullclineN2_zero(:,1),nullclineN2_zero(:,2),'g','lineWidth',2);
plot(nullclineN1_zero(:,1),nullclineN1_zero(:,2),'r','lineWidth',2);
t1=@(x2) 4-(0.5).*x2;
res1=t1(ptsMesh);
plot(res1,ptsMesh,'c','lineWidth',2);
t2=@(x1) 7-(2).*x1;
res2=t2(ptsMesh);
plot(ptsMesh,res2,'k','lineWidth',2);
will appreciate some help here
thanks
mathematical-modeling stability-in-odes
add a comment |
up vote
0
down vote
favorite
so I've given the following problem:
$dn_1/dt=N(t)n_1-n_1$
$dn_2/dt=N(t)n_2-4n_2$
$N(t)=25-6n_1-3n_2$
so I've found the fixed points of the 2 equations and got:
[(0,0),(0,7),(4,0)]
now I want to find the nullclines of them:
so for $dn_1/dt=0$ we get $n_1(24-6n_1-3n_2)$ which means:
$n_1=0$ for all $n_2$
$n_1=4-0.5n_2$
so for $dn_2/dt=0$ we get $n_2(21-6n_1-3n_2)$ which means:
$n_2=0$ for all $n_1$
$n_2=7-2n_1$
plotting the following using matlab in order to find the phase plane and basin of attraction gives peculiar results which I can't find to be able to understand. (fig attached below)
I thought the the 3 nullcline need to be intersecting both the fixed points which is more intuitive to me but instead I get the following.
the Matlab code generating this plot is as follows:
clear, close all; clc
%Const
N0=25;
G1=1;G2=1;
a1=6;a2=3;
k1=1;k2=4;
%Params
t0 = 0; % starting time
dt = 0.5; % step size
tEnd = 50; % end time
timeVec=t0:dt:tEnd;
NumSteps=floor(tEnd./dt);
%Function Handlers
N_t=@(n1,n2) N0-a1.*n1-a2.*n2;
n1_dot=@(n1,n2) G1.*N_t(n1,n2).*n1-k1.*n1;
n2_dot=@(n1,n2) G2.*N_t(n1,n2).*n2-k2.*n2;
%%finding the fixed point's
%%%%%%%%%
system=@(n1,n2) [n1_dot(n1,n2);n2_dot(n1,n2)];
s = solve(system);
%%%%%%%%%
%TODO RECHECK!!!!
%%nulclines
%%%%%%%%%
%n1_dot=0
%case 1: n1 = 0
%case 2: n1 != 0
%n2_dot=0
%case 1: n2 = 0
%case 2: n2 != 0
%%%%%%%%%
ptsMesh=-10:0.2:25;
figure
[X,Y]=meshgrid(ptsMesh);
U=n1_dot(X,Y);
V=n2_dot(X,Y);
normalizedFactor=sqrt(U.^2+V.^2);
quiver(X,Y,U./normalizedFactor,V./normalizedFactor,1,'b')
hold on
plot(s.n1,s.n2,'k*','lineWidth',8)
%plot the trivial nullclines on the axis
[x,y]=size(ptsMesh);
nullclineN1_zero=[0,min(ptsMesh);0,max(ptsMesh)];
nullclineN2_zero=[min(ptsMesh),0;max(ptsMesh),0];
plot(nullclineN2_zero(:,1),nullclineN2_zero(:,2),'g','lineWidth',2);
plot(nullclineN1_zero(:,1),nullclineN1_zero(:,2),'r','lineWidth',2);
t1=@(x2) 4-(0.5).*x2;
res1=t1(ptsMesh);
plot(res1,ptsMesh,'c','lineWidth',2);
t2=@(x1) 7-(2).*x1;
res2=t2(ptsMesh);
plot(ptsMesh,res2,'k','lineWidth',2);
will appreciate some help here
thanks
mathematical-modeling stability-in-odes
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
so I've given the following problem:
$dn_1/dt=N(t)n_1-n_1$
$dn_2/dt=N(t)n_2-4n_2$
$N(t)=25-6n_1-3n_2$
so I've found the fixed points of the 2 equations and got:
[(0,0),(0,7),(4,0)]
now I want to find the nullclines of them:
so for $dn_1/dt=0$ we get $n_1(24-6n_1-3n_2)$ which means:
$n_1=0$ for all $n_2$
$n_1=4-0.5n_2$
so for $dn_2/dt=0$ we get $n_2(21-6n_1-3n_2)$ which means:
$n_2=0$ for all $n_1$
$n_2=7-2n_1$
plotting the following using matlab in order to find the phase plane and basin of attraction gives peculiar results which I can't find to be able to understand. (fig attached below)
I thought the the 3 nullcline need to be intersecting both the fixed points which is more intuitive to me but instead I get the following.
the Matlab code generating this plot is as follows:
clear, close all; clc
%Const
N0=25;
G1=1;G2=1;
a1=6;a2=3;
k1=1;k2=4;
%Params
t0 = 0; % starting time
dt = 0.5; % step size
tEnd = 50; % end time
timeVec=t0:dt:tEnd;
NumSteps=floor(tEnd./dt);
%Function Handlers
N_t=@(n1,n2) N0-a1.*n1-a2.*n2;
n1_dot=@(n1,n2) G1.*N_t(n1,n2).*n1-k1.*n1;
n2_dot=@(n1,n2) G2.*N_t(n1,n2).*n2-k2.*n2;
%%finding the fixed point's
%%%%%%%%%
system=@(n1,n2) [n1_dot(n1,n2);n2_dot(n1,n2)];
s = solve(system);
%%%%%%%%%
%TODO RECHECK!!!!
%%nulclines
%%%%%%%%%
%n1_dot=0
%case 1: n1 = 0
%case 2: n1 != 0
%n2_dot=0
%case 1: n2 = 0
%case 2: n2 != 0
%%%%%%%%%
ptsMesh=-10:0.2:25;
figure
[X,Y]=meshgrid(ptsMesh);
U=n1_dot(X,Y);
V=n2_dot(X,Y);
normalizedFactor=sqrt(U.^2+V.^2);
quiver(X,Y,U./normalizedFactor,V./normalizedFactor,1,'b')
hold on
plot(s.n1,s.n2,'k*','lineWidth',8)
%plot the trivial nullclines on the axis
[x,y]=size(ptsMesh);
nullclineN1_zero=[0,min(ptsMesh);0,max(ptsMesh)];
nullclineN2_zero=[min(ptsMesh),0;max(ptsMesh),0];
plot(nullclineN2_zero(:,1),nullclineN2_zero(:,2),'g','lineWidth',2);
plot(nullclineN1_zero(:,1),nullclineN1_zero(:,2),'r','lineWidth',2);
t1=@(x2) 4-(0.5).*x2;
res1=t1(ptsMesh);
plot(res1,ptsMesh,'c','lineWidth',2);
t2=@(x1) 7-(2).*x1;
res2=t2(ptsMesh);
plot(ptsMesh,res2,'k','lineWidth',2);
will appreciate some help here
thanks
mathematical-modeling stability-in-odes
so I've given the following problem:
$dn_1/dt=N(t)n_1-n_1$
$dn_2/dt=N(t)n_2-4n_2$
$N(t)=25-6n_1-3n_2$
so I've found the fixed points of the 2 equations and got:
[(0,0),(0,7),(4,0)]
now I want to find the nullclines of them:
so for $dn_1/dt=0$ we get $n_1(24-6n_1-3n_2)$ which means:
$n_1=0$ for all $n_2$
$n_1=4-0.5n_2$
so for $dn_2/dt=0$ we get $n_2(21-6n_1-3n_2)$ which means:
$n_2=0$ for all $n_1$
$n_2=7-2n_1$
plotting the following using matlab in order to find the phase plane and basin of attraction gives peculiar results which I can't find to be able to understand. (fig attached below)
I thought the the 3 nullcline need to be intersecting both the fixed points which is more intuitive to me but instead I get the following.
the Matlab code generating this plot is as follows:
clear, close all; clc
%Const
N0=25;
G1=1;G2=1;
a1=6;a2=3;
k1=1;k2=4;
%Params
t0 = 0; % starting time
dt = 0.5; % step size
tEnd = 50; % end time
timeVec=t0:dt:tEnd;
NumSteps=floor(tEnd./dt);
%Function Handlers
N_t=@(n1,n2) N0-a1.*n1-a2.*n2;
n1_dot=@(n1,n2) G1.*N_t(n1,n2).*n1-k1.*n1;
n2_dot=@(n1,n2) G2.*N_t(n1,n2).*n2-k2.*n2;
%%finding the fixed point's
%%%%%%%%%
system=@(n1,n2) [n1_dot(n1,n2);n2_dot(n1,n2)];
s = solve(system);
%%%%%%%%%
%TODO RECHECK!!!!
%%nulclines
%%%%%%%%%
%n1_dot=0
%case 1: n1 = 0
%case 2: n1 != 0
%n2_dot=0
%case 1: n2 = 0
%case 2: n2 != 0
%%%%%%%%%
ptsMesh=-10:0.2:25;
figure
[X,Y]=meshgrid(ptsMesh);
U=n1_dot(X,Y);
V=n2_dot(X,Y);
normalizedFactor=sqrt(U.^2+V.^2);
quiver(X,Y,U./normalizedFactor,V./normalizedFactor,1,'b')
hold on
plot(s.n1,s.n2,'k*','lineWidth',8)
%plot the trivial nullclines on the axis
[x,y]=size(ptsMesh);
nullclineN1_zero=[0,min(ptsMesh);0,max(ptsMesh)];
nullclineN2_zero=[min(ptsMesh),0;max(ptsMesh),0];
plot(nullclineN2_zero(:,1),nullclineN2_zero(:,2),'g','lineWidth',2);
plot(nullclineN1_zero(:,1),nullclineN1_zero(:,2),'r','lineWidth',2);
t1=@(x2) 4-(0.5).*x2;
res1=t1(ptsMesh);
plot(res1,ptsMesh,'c','lineWidth',2);
t2=@(x1) 7-(2).*x1;
res2=t2(ptsMesh);
plot(ptsMesh,res2,'k','lineWidth',2);
will appreciate some help here
thanks
mathematical-modeling stability-in-odes
mathematical-modeling stability-in-odes
edited Nov 14 at 18:57
asked Nov 14 at 17:53
chemist
143
143
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2998593%2ffinding-the-nullclines-of-a-two-connected-odes%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown