Matlab Experiment of Holliday Junction Kenny and Ryan.
-
Upload
valerie-harrington -
Category
Documents
-
view
214 -
download
0
Transcript of Matlab Experiment of Holliday Junction Kenny and Ryan.
Matlab Experiment of Holliday Junction
Kenny and Ryan
Matlab Function%ODE's for holiday junctions, A, B, C, E%where A-B and C-E are much slower than B-C function dydt = HolJunct(t,y) k1f=.0000001; % A to B ratek2f=.032; % B to C ratek3f=2.2*(10^-8); % C to E ratek1r=2.8*(10^-8); % B to A ratek2r=.042; % C to B rate dydt(1,1)=-k1f*y(1)+k1r*y(2); % dA/dtdydt(2,1)=-k1r*y(2)+k1f*y(1)-k2f*y(2)+k2r*y(3); % dB/dtdydt(3,1)=k2f*y(2)-k2r*y(3)-k3f*y(3); % dC/dtdydt(4,1)=k3f*y(3); % dE/dt end
Matlab Function Explanation
The function is given a title with the return value of dydt
The reaction constants, k1r, k1f, etc are initialized at the top
The 4 dimension differential equation system is represented using dydt(1,1)dydt(4,1), where (1,1) represents the first row and first column of a matrix we call dydt.
The matrix dydt is thus a column vector (4 x 1) – (rows x columns) that consists of the 4 differential equations dA/dt dE/dt
Solving the System
Now that the system has been created in the function title HolJunct, we need to call and solve it within the Matlab Command Window (the function is created in a script file)
We solve/call using the command [t,y] = ode23(@HolJunct, [0,2000000], [0 1 0.95 0]);
The above ode23 is a built-in Matlab function that solves Ordinary Differential Equations (ODE), where the function being used needs to be defined (@), the time span or interval needs to be set ([0 to 2million]), and the initial conditions for the original functions A,B,C,E need to be inputted ([0 for A, 1 for B, 0.95 for C, 0 for E])
Type help ode23 for more information
Output/Results After typing the command for different initial conditions, the
following graphs were obtained:
A –B –C –E –
Note the ratio between B and C remains constant since this represents short term
0 1 2 3 4 5 6 7 8 9 10
x 106
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Time Interval t
A,B
,C,E
Results Continued After changing k3f and k1r to larger numbers, we can
see a “sped-up” version of the reaction
A –B –C –E –
0 1 2 3 4 5 6 7 8 9 10
x 106
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Time Interval t
A,B
,C,E
END