Difference between revisions of "DNA Melting: Simulating DNA Melting - Intermediate Topics"

From Course Wiki
Jump to: navigation, search
(New page: ==Write a function to compute f== Begin by writing a function that will compute <math>\left . f \right .</math> from the equation derived in class. This func...)
 
Line 1: Line 1:
 
==Write a function to compute f==
 
==Write a function to compute f==
 
Begin by writing a function that will compute <math>\left . f \right .</math> from the equation derived [[DNA Melting Thermodynamics|in class]]. This function must be in its own file called DnaFraction.m.
 
Begin by writing a function that will compute <math>\left . f \right .</math> from the equation derived [[DNA Melting Thermodynamics|in class]]. This function must be in its own file called DnaFraction.m.
 +
 +
<include src="http://web.mit.edu/~20.309/www/Matlab/DnaFraction.m" />
  
 
<pre style="background:#DDDDFF">
 
<pre style="background:#DDDDFF">

Revision as of 19:19, 10 April 2008

Write a function to compute f

Begin by writing a function that will compute $ \left . f \right . $ from the equation derived in class. This function must be in its own file called DnaFraction.m.

<include src="http://web.mit.edu/~20.309/www/Matlab/DnaFraction.m" />

%Returns the fraction of dsDNA given total DNA concentration, temperature, Delta S, and Delta H
%Usage: f = DnaFraction(Ct, T, DeltaS, DeltaH)
function f = DnaFraction(Ct, T, DeltaS, DeltaH)

%Constants
R=8.3;

%first compute Ct * Keq
CtKeq = Ct * exp(DeltaS / R - DeltaH / (R * T));

%now compute f
f = (1 + CtKeq + sqrt(1 + 2 * CtKeq))/CtKeq;

Test the function

First, create a temperature vector. Then call DnaFraction with some reasonable parameters and plot the result. Units are calorie, mole.

t = [20:90] + 273;
f = DnaFraction(.1E-6, t, 304E3, 786);
plot(t,f)