Team:Northwestern/Project/Modeling
From 2010.igem.org
(Difference between revisions)
(→MATLAB m-file) |
(→MATLAB m-file) |
||
Line 328: | Line 328: | ||
<html> | <html> | ||
%IPTG PREDETERMINATION</br> | %IPTG PREDETERMINATION</br> | ||
- | %finite difference method | + | %finite difference method</br> |
- | %diffusion equation (Fick's 2nd Law) | + | %diffusion equation (Fick's 2nd Law)</br> |
- | %c=c0*(erfc*x/sqrt(2*D*t)) | + | %c=c0*(erfc*x/sqrt(2*D*t))</br> |
- | %D*(Ci+1-2C+Ci-1)/dx^2 = Ci/dt | + | %D*(Ci+1-2C+Ci-1)/dx^2 = Ci/dt</br> |
- | %x goes from 0 (top) to 100 micrometers | + | %x goes from 0 (top) to 100 micrometers</br> |
- | + | </br> | |
- | %D=IPTG is a modified monosaccharide, so we can estimate from Table 1 that | + | %D=IPTG is a modified monosaccharide, so we can estimate from Table 1 that</br> |
- | %its diffusion coefficient in water at 25°C will be ca. 6.5 × 10?6 cm2 s?1. | + | %its diffusion coefficient in water at 25°C will be ca. 6.5 × 10?6 cm2 s?1.</br> |
- | %Scaling to 37°C and taking De/Daq to be 0.25, De is found to be 2.2 × 10?6 cm2 s?1 | + | %Scaling to 37°C and taking De/Daq to be 0.25, De is found to be 2.2 × 10?6 cm2 s?1</br> |
- | %http://www.ncbi.nlm.nih.gov/pmc/articles/PMC148055/ | + | %http://www.ncbi.nlm.nih.gov/pmc/articles/PMC148055/</br> |
- | + | </br> | |
- | %% | + | %%</br> |
- | clear | + | clear</br> |
- | clc | + | clc</br> |
- | %INITIALIZE | + | %INITIALIZE</br> |
- | D=220; %um^2/s | + | D=220; %um^2/s</br> |
- | c0=14.298; %mg so 3ml spray of 20mM iptg | + | c0=14.298; %mg so 3ml spray of 20mM iptg</br> |
- | %in comparison 23.83mg of iptg is in 5ml 20mM | + | %in comparison 23.83mg of iptg is in 5ml 20mM</br> |
- | dx=1; %um | + | dx=1; %um</br> |
- | xmax=100; %um; 100um total | + | xmax=100; %um; 100um total</br> |
- | dt=.002; %s | + | dt=.002; %s</br> |
- | tmax=10; %s; 1 hour total | + | tmax=10; %s; 1 hour total</br> |
- | C=zeros(xmax/dx,tmax/dt); %rows = same time %also, (x,t) x is row, t is column | + | C=zeros(xmax/dx,tmax/dt); %rows = same time %also, (x,t) x is row, t is column</br> |
- | C_Rate=zeros(xmax/dt,1); | + | C_Rate=zeros(xmax/dt,1);</br> |
- | C(1,1)=c0; | + | C(1,1)=c0;</br> |
- | %Time Step | + | %Time Step</br> |
- | for t=1:1:tmax/dt-1; %s | + | for t=1:1:tmax/dt-1; %s</br> |
- | for x=1:1:(xmax/dx) %um | + | for x=1:1:(xmax/dx) %um</br> |
- | if x==1%account for x=1 boundary condition | + | if x==1%account for x=1 boundary condition</br> |
- | C_Rate(x)=D*(C(x+1,t)-C(x,t))/(dx^2); | + | C_Rate(x)=D*(C(x+1,t)-C(x,t))/(dx^2);</br> |
- | elseif x==xmax/dx %account for x=xmax boundary condition | + | elseif x==xmax/dx %account for x=xmax boundary condition</br> |
- | C_Rate(x)=D*(C(x-1,t)-C(x,t))/(dx^2); | + | C_Rate(x)=D*(C(x-1,t)-C(x,t))/(dx^2);</br> |
- | else%BULK | + | else%BULK</br> |
- | C_Rate(x)=D*(C(x-1,t)+C(x+1,t)-2*C(x,t))/(dx^2); | + | C_Rate(x)=D*(C(x-1,t)+C(x+1,t)-2*C(x,t))/(dx^2);</br> |
- | end | + | end</br> |
- | C(x,t+1)=C(x,t)+C_Rate(x)*dt; | + | C(x,t+1)=C(x,t)+C_Rate(x)*dt;</br> |
- | end | + | end</br> |
- | t*.002 | + | t*.002</br> |
- | end | + | end</br> |
- | %% | + | %%</br> |
- | %Compile into 1s parts | + | %Compile into 1s parts</br> |
- | %newC=zeros(100,tmax/dt/500); | + | %newC=zeros(100,tmax/dt/500);</br> |
- | counts=1; | + | counts=1;</br> |
- | for t=1:500:tmax/dt-1 %.002*x=1; | + | for t=1:500:tmax/dt-1 %.002*x=1;</br> |
- | newC(:,counts)=C(:,t); | + | newC(:,counts)=C(:,t);</br> |
- | counts=counts+1; | + | counts=counts+1;</br> |
- | end | + | end</br> |
- | %% | + | %%</br> |
- | %visualize newC | + | %visualize newC</br> |
- | for t=1:1:tmax/dt/500 | + | for t=1:1:tmax/dt/500</br> |
- | XX=0:dx:xmax-dx; | + | XX=0:dx:xmax-dx;</br> |
- | YY=newC(:,t); | + | YY=newC(:,t);</br> |
- | plot(XX,YY,'k.'); | + | plot(XX,YY,'k.');</br> |
- | axis([0 100 0 2]) | + | axis([0 100 0 2])</br> |
- | text(50,1.8,sprintf('Time is: %g s', t*dt)); | + | text(50,1.8,sprintf('Time is: %g s', t*dt));</br> |
- | text(50,1.7,sprintf('IPTG Mass balance is: %g mg', sum(C(:,t)))); | + | text(50,1.7,sprintf('IPTG Mass balance is: %g mg', sum(C(:,t))));</br> |
- | xlabel('Distance from surface (um)') | + | xlabel('Distance from surface (um)')</br> |
- | ylabel('IPTG (mg)') | + | ylabel('IPTG (mg)')</br> |
- | Mov(t)=getframe(); | + | Mov(t)=getframe();</br> |
- | %pause(1); | + | %pause(1);</br> |
- | end | + | end</br> |
- | %% | + | %%</br> |
- | + | </br> | |
- | %VISUALIZE | + | %VISUALIZE</br> |
- | blah=1; | + | blah=1;</br> |
- | for t=1:7:tmax/dt | + | for t=1:7:tmax/dt</br> |
- | XX=xmax-dx-100:-dx:0-100; | + | XX=xmax-dx-100:-dx:0-100;</br> |
- | YY=C(:,t); | + | YY=C(:,t);</br> |
- | plot(YY,XX,'k.'); | + | plot(YY,XX,'k.');</br> |
- | axis([0 2 -100 0]) | + | axis([0 2 -100 0])</br> |
- | text(1.2,-30,sprintf('Time: %g s', t*dt)); | + | text(1.2,-30,sprintf('Time: %g s', t*dt));</br> |
- | %text(50,1.7,sprintf('IPTG Mass balance is: %g mg', sum(C(:,t)))); | + | %text(50,1.7,sprintf('IPTG Mass balance is: %g mg', sum(C(:,t))));</br> |
- | ylabel('Distance from surface (um)') | + | ylabel('Distance from surface (um)')</br> |
- | xlabel('IPTG (mg)') | + | xlabel('IPTG (mg)')</br> |
- | VID(blah)=getframe(gcf); | + | VID(blah)=getframe(gcf);</br> |
- | blah=blah+1; | + | blah=blah+1;</br> |
- | end | + | end</br> |
- | + | </br> | |
</html> | </html> | ||
|} | |} |
Revision as of 04:40, 27 October 2010
Home | Brainstorm | Team | Acknowledgements | Project | Human Practices | Parts | Notebook | Calendar | Protocol | Safety | Links | References | Media | Contact |
---|