Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.60 KB | None | 0 0
  1. %% Chris Rowland
  2. %% BALLER CODE!!!
  3. %% Parameters
  4. clear all; clf;
  5. options = [];
  6. tspan = linspace(0, 30, 1000); % Th%% PART 4!!!
  7. %e reaction lasts 30 minutes
  8.  
  9.  
  10. %% Solves the differential equations
  11. [t1,y] = ode45(@DiffEQ, tspan, [0, 0.5*10^5, 0, 23357, 0], options); % Part 2
  12. [t , x] = ode45(@DiffEQ, tspan, [5*10^-12, 0.5*10^5, 0, 23357, 0], options); % Part 3
  13. [t5,x1] = ode45(@DiffEQ1, tspan, [5*10^-12, 0.5*10^5, 0, 23357, 0], options); % Part 3
  14. [t6,x2] = ode45(@DiffEQ2, tspan, [5*10^-12, 0.5*10^5, 0, 23357, 0], options); % Part 3
  15. [t2,z] = ode45(@DiffEQ, tspan, [2.5*10^-11, 0.5*10^5, 0, 23357, 0], options); % Part 4
  16. [t3,w] = ode45(@DiffEQ, tspan, [7*10^-10, 0.5*10^5, 0, 23357, 0], options); % Part 4
  17. [t4,v] = ode45(@DiffEQ, tspan, [5*10^-9, 0.5*10^5, 0, 23357, 0], options); % Part 4
  18. %% PART 2!!!
  19.  
  20. figure(1)
  21. subplot(3,2,1)
  22. plot(t1, y(:,1),'k','LineWidth', 2)
  23. title('Free Ligand Concentration versus Time (CL = 0)', 'FontSize',12)
  24. xlabel('Time (min)', 'FontSize',12)
  25. ylabel('Ligand Concentration', 'FontSize',12)
  26. axis([0 30 4.95*10^-12 5.1*10^-12])
  27.  
  28. subplot(3,2,2)
  29. plot(t1, y(:,2),'b','LineWidth', 2)
  30. title('Free Surface Recepors versus Time', 'FontSize',12)
  31. xlabel('Time (min)', 'FontSize',12)
  32. ylabel('Number of Surface Receptors', 'FontSize',12)
  33. axis([0 30 0 6*10^4])
  34.  
  35. subplot(3,2,3)
  36. plot(t1, y(:,3),'r','LineWidth', 2)
  37. title('Complex Concentration versus Time', 'FontSize',12)
  38. xlabel('Time (min)', 'FontSize',12)
  39. ylabel('Complex Concentration', 'FontSize',12)
  40. axis([0 30 0 40])
  41.  
  42. subplot(3,2,4)
  43. plot(t1, y(:,4),'g','LineWidth', 2)
  44. title('Intracellular Receptor Concentration versus Time', 'FontSize',12)
  45. xlabel('Time (min)', 'FontSize',12)
  46. ylabel('Intracellular Receptor Concentration', 'FontSize',12)
  47. axis([0 30 0 30000])
  48.  
  49. subplot(3,2,5)
  50. plot(t1, y(:,5),'y','LineWidth', 2)
  51. title('Intracellular Ligand Concentration versus Time', 'FontSize',12)
  52. xlabel('Time (min)', 'FontSize',12)
  53. ylabel('Intracellular Ligand Concentration', 'FontSize',12)
  54. axis([0 30 0 200])
  55.  
  56.  
  57.  
  58. %% PART 3!!!
  59. figure(2)
  60. subplot(3,2,1)
  61. plot(t, x(:,1),'k',t5, x1(:,1),'b',t6, x2(:,1),'r','LineWidth', 2)
  62. legend('NC = 10.5^8','NC = 10.5^5','NC = 10.5^11', 'location','northeast')
  63. title('Free Ligand Concentration versus Time', 'FontSize',12)
  64. xlabel('Time (min)', 'FontSize',12)
  65. ylabel('Ligand Concentration', 'FontSize',12)
  66. axis([0 30 4.95*10^-12 5*10^-12])
  67.  
  68. subplot(3,2,2)
  69. plot(t, x(:,2),'k',t5, x1(:,2),'b',t6, x2(:,2),'r','LineWidth', 2)
  70. legend('NC = 10.5^8','NC = 10.5^5','NC = 10.5^11', 'location','southeast')
  71. title('Free Surface Recepors versus Time', 'FontSize',12)
  72. xlabel('Time (min)', 'FontSize',12)
  73. ylabel('Number of Surface Receptors', 'FontSize',12)
  74. axis auto
  75.  
  76. subplot(3,2,3)
  77. plot(t, x(:,3),'k',t5, x1(:,3),'b',t6, x2(:,3),'r','LineWidth', 2)
  78. legend('NC = 10.5^8','NC = 10.5^5','NC = 10.5^11', 'location','southeast')
  79. title('Complex Concentration versus Time', 'FontSize',12)
  80. xlabel('Time (min)', 'FontSize',12)
  81. ylabel('Complex Concentration', 'FontSize',12)
  82. axis auto
  83.  
  84. subplot(3,2,4)
  85. plot(t, x(:,4),'k',t5, x1(:,4),'b', t6, x2(:,4),'r','LineWidth', 2)
  86. legend('NC = 10.5^8','NC = 10.5^5','NC = 10.5^11', 'location','southeast')
  87. title('Intracellular Receptor Concentration versus Time', 'FontSize',12)
  88. xlabel('Time (min)', 'FontSize',12)
  89. ylabel('Intracellular Receptor Concentration', 'FontSize',12)
  90. axis auto
  91.  
  92. subplot(3,2,5)
  93. plot(t, x(:,5),'k',t5, x1(:,5),'b',t6, x2(:,5),'r','LineWidth', 2)
  94. legend('NC = 10.5^8','NC = 10.5^5','NC = 10.5^11', 'location','northwest')
  95. title('Intracellular Ligand Concentration versus Time', 'FontSize',12)
  96. xlabel('Time (min)', 'FontSize',12)
  97. ylabel('Intracellular Ligand Concentration', 'FontSize',12)
  98. axis auto
  99.  
  100.  
  101. %% PART 4!!!
  102.  
  103. figure(3)
  104. subplot(3,2,1)
  105. plot(t2, z(:,1),'k',t3, w(:,1),'b',t4, v(:,1),'r','LineWidth', 2)
  106. legend('2.5*10^-11','7*10^-10','5*10^-9', 'location','northeast')
  107. title('Free Ligand Concentration versus Time (NC = 10.5^8)', 'FontSize',12)
  108. xlabel('Time (min)', 'FontSize',12)
  109. ylabel('Ligand Concentration', 'FontSize',12)
  110. axis([0 30 0 6*10^-9])
  111.  
  112. subplot(3,2,2)
  113. plot(t2, z(:,2),'k',t3, w(:,2),'b',t4, v(:,2),'r','LineWidth', 2)
  114. legend('2.5*10^-11','7*10^-10','5*10^-9', 'location','northeast')
  115. title('Free Surface Recepors versus Time', 'FontSize',12)
  116. xlabel('Time (min)', 'FontSize',12)
  117. ylabel('Number of Surface Receptors', 'FontSize',12)
  118. axis([0 30 0 6*10^4])
  119.  
  120. subplot(3,2,3)
  121. plot(t2, z(:,3),'k',t3, w(:,3),'b',t4, v(:,3),'r','LineWidth', 2)
  122. legend('2.5*10^-11','7*10^-10','5*10^-9', 'location','northeast')
  123. title('Complex Concentration versus Time', 'FontSize',12)
  124. xlabel('Time (min)', 'FontSize',12)
  125. ylabel('Complex Concentration', 'FontSize',12)
  126. axis([0 30 0 20000])
  127.  
  128. subplot(3,2,4)
  129. plot(t2, z(:,4),'k',t3, w(:,4),'b',t4, v(:,4),'r','LineWidth', 2)
  130. legend('2.5*10^-11','7*10^-10','5*10^-9', 'location','southeast')
  131. title('Intracellular Receptor Concentration versus Time', 'FontSize',12)
  132. xlabel('Time (min)', 'FontSize',12)
  133. ylabel('Intracellular Receptor Concentration', 'FontSize',12)
  134. axis([0 30 0 60000])
  135.  
  136. subplot(3,2,5)
  137. plot(t2, z(:,5),'k',t3, w(:,5),'b',t4, v(:,5),'r','LineWidth', 2)
  138. legend('2.5*10^-11','7*10^-10','5*10^-9', 'location','northwest')
  139. title('Intracellular Ligand Concentration versus Time', 'FontSize',12)
  140. xlabel('Time (min)', 'FontSize',12)
  141. ylabel('Intracellular Ligand Concentration', 'FontSize',12)
  142. axis([0 30 0 60000])
  143.  
  144.  
  145.  
  146.  
  147. DIFFEQ____________________________________________________
  148. %% Chris Rowland
  149. %% DiffEQ.m
  150.  
  151.  
  152.  
  153.  
  154.  
  155. function dxdt = f(t, x);
  156.  
  157. %% Parameters
  158. k1 = 7.2*10^7; % 1/M 1/min
  159. kr1 = 0.3; % 1/min
  160. ker = 0.03; % 1/min
  161. kec = 0.3; % 1/min
  162. krec = 0.08; % 1/min
  163. kdegr = 0.0011; % 1/min
  164. kdegl = 0.01; % 1/min
  165. fr = 0.2; %
  166. fl = 0.6; %
  167. nc = 10.5^8; % 1/L
  168. nri = 23357; % #
  169. Vs =5.14; % M/s
  170. NA = 6.0221415*10^23; % Avegadros number
  171.  
  172.  
  173. dxdt=zeros(5,1); % column vector, creates vector fo DIFFY Qs
  174.  
  175. dxdt(1) = (nc/NA).*(-k1.*x(1).*x(2) + kr1*x(3) + krec*(1-fl)*x(5));
  176. dxdt(2) = -k1*x(1).*x(2)+ kr1*x(3)-ker*x(2)+krec*(1-fr)*x(4)+Vs;
  177. dxdt(3) = k1*x(1).*x(2)-(kr1+kec)*x(3);
  178. dxdt(4) = ker*x(2)+kec*x(3)-(kdegr*fr+krec*(1-fr))*x(4);
  179. dxdt(5) = kec*x(3)-(kdegl*fl+krec*(1-fl))*x(5);
  180.  
  181.  
  182. DIFFEQ1______________________________________________________________________
  183. %% Chris Rowland
  184. %% DiffEQ.m
  185.  
  186.  
  187.  
  188.  
  189.  
  190. function dxdt = f(t, x);
  191.  
  192. %% Parameters
  193. k1 = 7.2*10^7; % 1/M 1/min
  194. kr1 = 0.3; % 1/min
  195. ker = 0.03; % 1/min
  196. kec = 0.3; % 1/min
  197. krec = 0.08; % 1/min
  198. kdegr = 0.0011; % 1/min
  199. kdegl = 0.01; % 1/min
  200. fr = 0.2; %
  201. fl = 0.6; %
  202. nc = 10.5^5; % 1/L
  203. nri = 23357; % #
  204. Vs =5.14; % M/s
  205. NA = 6.0221415*10^23; % Avegadros number
  206.  
  207.  
  208. dxdt=zeros(5,1); % column vector, creates vector fo DIFFY Qs
  209.  
  210. dxdt(1) = (nc/NA).*(-k1.*x(1).*x(2) + kr1*x(3) + krec*(1-fl)*x(5));
  211. dxdt(2) = -k1*x(1).*x(2)+ kr1*x(3)-ker*x(2)+krec*(1-fr)*x(4)+Vs;
  212. dxdt(3) = k1*x(1).*x(2)-(kr1+kec)*x(3);
  213. dxdt(4) = ker*x(2)+kec*x(3)-(kdegr*fr+krec*(1-fr))*x(4);
  214. dxdt(5) = kec*x(3)-(kdegl*fl+krec*(1-fl))*x(5);
  215.  
  216. DIFFEQ2____________________________________
  217. %% Chris Rowland
  218. %% DiffEQ.m
  219.  
  220.  
  221.  
  222.  
  223.  
  224. function dxdt = f(t, x);
  225.  
  226. %% Parameters
  227. k1 = 7.2*10^7; % 1/M 1/min
  228. kr1 = 0.3; % 1/min
  229. ker = 0.03; % 1/min
  230. kec = 0.3; % 1/min
  231. krec = 0.08; % 1/min
  232. kdegr = 0.0011; % 1/min
  233. kdegl = 0.01; % 1/min
  234. fr = 0.2; %
  235. fl = 0.6; %
  236. nc = 10.5^11; % 1/L
  237. nri = 23357; % #
  238. Vs =5.14; % M/s
  239. NA = 6.0221415*10^23; % Avegadros number
  240.  
  241.  
  242. dxdt=zeros(5,1); % column vector, creates vector fo DIFFY Qs
  243.  
  244. dxdt(1) = (nc/NA).*(-k1.*x(1).*x(2) + kr1*x(3) + krec*(1-fl)*x(5));
  245. dxdt(2) = -k1*x(1).*x(2)+ kr1*x(3)-ker*x(2)+krec*(1-fr)*x(4)+Vs;
  246. dxdt(3) = k1*x(1).*x(2)-(kr1+kec)*x(3);
  247. dxdt(4) = ker*x(2)+kec*x(3)-(kdegr*fr+krec*(1-fr))*x(4);
  248. dxdt(5) = kec*x(3)-(kdegl*fl+krec*(1-fl))*x(5);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement