# Team:Paris/Modeling/More f1 Algo

(Difference between revisions)
 Revision as of 03:43, 30 October 2008 (view source)Hugo (Talk | contribs) (→find_ƒ1)← Older edit Revision as of 03:43, 30 October 2008 (view source)Hugo (Talk | contribs) (→Inv_ƒ1)Newer edit → Line 30: Line 30: == Inv_ƒ1 == == Inv_ƒ1 == - +
+                                                                                                  function quant_aTc = Inv_f1(inducer_quantity)
+                                                                                                  % gives the quantity of [aTc]i needed to get inducer_quantity of a protein
+                                                                                                  % throught a gene behind pTet
+
+                                                                                                  global gamma, f0;
+                                                                                                  % parameters
+
+                                                                                                  function equa = F(x)
+                                                                                                  equa = f1( (f0/gamma) , x ) - inducer_quantity;
+                                                                                                  end
+
+                                                                                                  options=optimset('LevenbergMarquardt','on','TolX',1e-10,'MaxFunEvals',1e10,'TolFun',1e-10,'MaxIter',1e4);
+
+                                                                                                  quant_aTc = fsolve(F,1,options);
+
+                                                                                                  end
+

## find_ƒ1

```function act_pTet = f1(TetR, aTc)
% activity of pTet in function of TetR and aTc

global beta16 K13 n13 K12 n12;
% parameters

act_pTet = beta16 * ( 1 - hill( TetR*(1 - hill( aTc, K13, n13 )), K12, n12 ) );

end
```

## Inv_ƒ1

```function quant_aTc = Inv_f1(inducer_quantity)
% gives the quantity of [aTc]i needed to get inducer_quantity of a protein
% throught a gene behind pTet

global gamma, f0;
% parameters

function equa = F(x)
equa = f1( (f0/gamma) , x ) - inducer_quantity;
end

options=optimset('LevenbergMarquardt','on','TolX',1e-10,'MaxFunEvals',1e10,'TolFun',1e-10,'MaxIter',1e4);

quant_aTc = fsolve(F,1,options);

end
```