Team:Paris/Modeling/simul

From 2008.igem.org

(Difference between revisions)
 
Line 7: Line 7:
-
% simul.m : simulation of the model
+
<html xmlns:v="urn:schemas-microsoft-com:vml"
 +
xmlns:o="urn:schemas-microsoft-com:office:office"
 +
xmlns:w="urn:schemas-microsoft-com:office:word"
 +
xmlns="http://www.w3.org/TR/REC-html40">
-
%%% Commentary: This function is used in the premiermodele.m file that has
+
<head>
 +
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
 +
<meta name=ProgId content=Word.Document>
 +
<meta name=Generator content="Microsoft Word 11">
 +
<meta name=Originator content="Microsoft Word 11">
 +
<link rel=File-List href="simul2_fichiers/filelist.xml">
 +
<title>% simul</title>
 +
<!--[if gte mso 9]><xml>
 +
<o:DocumentProperties>
 +
  <o:Author> </o:Author>
 +
  <o:LastAuthor> </o:LastAuthor>
 +
  <o:Revision>1</o:Revision>
 +
  <o:TotalTime>1</o:TotalTime>
 +
  <o:Created>2008-08-08T15:37:00Z</o:Created>
 +
  <o:LastSaved>2008-08-08T15:38:00Z</o:LastSaved>
 +
  <o:Pages>1</o:Pages>
 +
  <o:Words>76</o:Words>
 +
  <o:Characters>418</o:Characters>
 +
  <o:Company> Supélec</o:Company>
 +
  <o:Lines>3</o:Lines>
 +
  <o:Paragraphs>1</o:Paragraphs>
 +
  <o:CharactersWithSpaces>493</o:CharactersWithSpaces>
 +
  <o:Version>11.6408</o:Version>
 +
</o:DocumentProperties>
 +
</xml><![endif]--><!--[if gte mso 9]><xml>
 +
<w:WordDocument>
 +
  <w:HyphenationZone>21</w:HyphenationZone>
 +
  <w:PunctuationKerning/>
 +
  <w:ValidateAgainstSchemas/>
 +
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
 +
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
 +
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
 +
  <w:Compatibility>
 +
  <w:BreakWrappedTables/>
 +
  <w:SnapToGridInCell/>
 +
  <w:WrapTextWithPunct/>
 +
  <w:UseAsianBreakRules/>
 +
  <w:DontGrowAutofit/>
 +
  </w:Compatibility>
 +
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 +
</w:WordDocument>
 +
</xml><![endif]--><!--[if gte mso 9]><xml>
 +
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 +
</w:LatentStyles>
 +
</xml><![endif]-->
 +
<style>
 +
<!--
 +
/* Style Definitions */
 +
p.MsoNormal, li.MsoNormal, div.MsoNormal
 +
{mso-style-parent:"";
 +
margin:0cm;
 +
margin-bottom:.0001pt;
 +
mso-pagination:widow-orphan;
 +
font-size:12.0pt;
 +
font-family:"Times New Roman";
 +
mso-fareast-font-family:"Times New Roman";}
 +
@page Section1
 +
{size:612.0pt 792.0pt;
 +
margin:70.85pt 70.85pt 70.85pt 70.85pt;
 +
mso-header-margin:36.0pt;
 +
mso-footer-margin:36.0pt;
 +
mso-paper-source:0;}
 +
div.Section1
 +
{page:Section1;}
 +
-->
 +
</style>
 +
<!--[if gte mso 10]>
 +
<style>
 +
/* Style Definitions */
 +
table.MsoNormalTable
 +
{mso-style-name:"Tableau Normal";
 +
mso-tstyle-rowband-size:0;
 +
mso-tstyle-colband-size:0;
 +
mso-style-noshow:yes;
 +
mso-style-parent:"";
 +
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
 +
mso-para-margin:0cm;
 +
mso-para-margin-bottom:.0001pt;
 +
mso-pagination:widow-orphan;
 +
font-size:10.0pt;
 +
font-family:"Times New Roman";
 +
mso-ansi-language:#0400;
 +
mso-fareast-language:#0400;
 +
mso-bidi-language:#0400;}
 +
</style>
 +
<![endif]--><!--[if gte mso 9]><xml>
 +
<o:shapedefaults v:ext="edit" spidmax="2050"/>
 +
</xml><![endif]--><!--[if gte mso 9]><xml>
 +
<o:shapelayout v:ext="edit">
 +
  <o:idmap v:ext="edit" data="1"/>
 +
</o:shapelayout></xml><![endif]-->
 +
</head>
-
%%% to be launched.
+
<body lang=FR style='tab-interval:35.4pt'>
-
+
<div class=Section1>
-
%%% Code:
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:forestgreen;
 +
mso-ansi-language:EN-GB'>% simul.m : simulation of the model</span><span
 +
lang=EN-GB style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
 +
mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:forestgreen;
 +
mso-ansi-language:EN-GB'>%%% Commentary: This function is used in the
 +
premiermodele.m file that has</span><span lang=EN-GB style='font-family:"Courier New";
 +
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
function [y,t]=simul(t,xinit)
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:forestgreen;
 +
mso-ansi-language:EN-GB'>%%% to be launched.</span><span lang=EN-GB
 +
style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
 +
mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
%  [y,t]=simul(t,xinit)
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:forestgreen;
 +
mso-ansi-language:EN-GB'><span style='mso-spacerun:yes'> </span></span><span
 +
lang=EN-GB style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
 +
mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
% t : duration of the simulation
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:forestgreen;
 +
mso-ansi-language:EN-GB'>%%% Code:</span><span lang=EN-GB style='font-family:
 +
"Courier New";mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
%  xinit: initial state
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:forestgreen;
 +
mso-ansi-language:EN-GB'><span style='mso-spacerun:yes'> </span></span><span
 +
lang=EN-GB style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
 +
mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
y: output
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:blue;
 +
mso-ansi-language:EN-GB'>function</span><span lang=EN-GB style='font-size:10.0pt;
 +
font-family:"Courier New";color:black;mso-ansi-language:EN-GB'>
 +
[y,t]=simul(t,xinit)</span><span lang=EN-GB style='font-family:"Courier New";
 +
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
   
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
style='font-size:10.0pt;font-family:"Courier New";color:forestgreen'>%<span
 +
style='mso-spacerun:yes'> </span>[y,t]=simul(t,xinit)</span><span
 +
style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'><o:p></o:p></span></p>
-
global Ncell
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:forestgreen;
 +
mso-ansi-language:EN-GB'>%<span style='mso-spacerun:yes'>  </span>t : duration
 +
of the simulation</span><span lang=EN-GB style='font-family:"Courier New";
 +
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
   
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:forestgreen;
 +
mso-ansi-language:EN-GB'>%<span style='mso-spacerun:yes'> </span>xinit:
 +
initial state</span><span lang=EN-GB style='font-family:"Courier New";
 +
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
% simulation
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:forestgreen;
 +
mso-ansi-language:EN-GB'>%<span style='mso-spacerun:yes'>  </span>y: output</span><span
 +
lang=EN-GB style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
 +
mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:black;
 +
mso-ansi-language:EN-GB'><span style='mso-spacerun:yes'> </span></span><span
 +
lang=EN-GB style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
 +
mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
vectol=zeros(1,8*Ncell+1)+1e-4;
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:blue;
 +
mso-ansi-language:EN-GB'>global</span><span lang=EN-GB style='font-size:10.0pt;
 +
font-family:"Courier New";color:black;mso-ansi-language:EN-GB'> Ncell</span><span
 +
lang=EN-GB style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
 +
mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
options = odeset('RelTol',1e-4,'AbsTol',vectol);
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:black;
 +
mso-ansi-language:EN-GB'><span style='mso-spacerun:yes'> </span></span><span
 +
lang=EN-GB style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
 +
mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:forestgreen;
 +
mso-ansi-language:EN-GB'>% simulation</span><span lang=EN-GB style='font-family:
 +
"Courier New";mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:forestgreen;
 +
mso-ansi-language:EN-GB'><span style='mso-spacerun:yes'> </span></span><span
 +
lang=EN-GB style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
 +
mso-ansi-language:EN-GB'><o:p></o:p></span></p>
-
[t,y] = ode23(@modele,t,xinit,options);% This function computes the output of the ode previously defined.
+
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:black;
 +
mso-ansi-language:EN-GB'>vectol=zeros(1,8*Ncell+1)+1e-4;</span><span
 +
lang=EN-GB style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
 +
mso-ansi-language:EN-GB'><o:p></o:p></span></p>
 +
 
 +
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:black;
 +
mso-ansi-language:EN-GB'>options = odeset(</span><span lang=EN-GB
 +
style='font-size:10.0pt;font-family:"Courier New";color:#A020F0;mso-ansi-language:
 +
EN-GB'>'RelTol'</span><span lang=EN-GB style='font-size:10.0pt;font-family:
 +
"Courier New";color:black;mso-ansi-language:EN-GB'>,1e-4,</span><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:#A020F0;
 +
mso-ansi-language:EN-GB'>'AbsTol'</span><span lang=EN-GB style='font-size:10.0pt;
 +
font-family:"Courier New";color:black;mso-ansi-language:EN-GB'>,vectol);</span><span
 +
lang=EN-GB style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
 +
mso-ansi-language:EN-GB'><o:p></o:p></span></p>
 +
 
 +
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:black;
 +
mso-ansi-language:EN-GB'><span style='mso-spacerun:yes'> </span></span><span
 +
lang=EN-GB style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
 +
mso-ansi-language:EN-GB'><o:p></o:p></span></p>
 +
 
 +
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:black;
 +
mso-ansi-language:EN-GB'><span style='mso-spacerun:yes'> </span></span><span
 +
lang=EN-GB style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman";
 +
mso-ansi-language:EN-GB'><o:p></o:p></span></p>
 +
 
 +
<p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:black;
 +
mso-ansi-language:EN-GB'>[t,y] = ode23(@modele,t,xinit,options);</span><span
 +
lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:forestgreen;
 +
mso-ansi-language:EN-GB'>% This function computes the output of the ode
 +
previously defined.</span><span lang=EN-GB style='font-family:"Courier New";
 +
mso-bidi-font-family:"Times New Roman";mso-ansi-language:EN-GB'><o:p></o:p></span></p>
 +
 
 +
<p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p>&nbsp;</o:p></span></p>
 +
 
 +
</div>
 +
 
 +
</body>
 +
 
 +
</html>
   
   
|}<br style="clear:both" />
|}<br style="clear:both" />

Latest revision as of 15:46, 8 August 2008

To go back to the previous page : Clic here.


% simul

% simul.m : simulation of the model

%%% Commentary: This function is used in the premiermodele.m file that has

%%% to be launched.

%%% Code:

function [y,t]=simul(t,xinit)

% [y,t]=simul(t,xinit)

% t : duration of the simulation

% xinit: initial state

% y: output

global Ncell

% simulation

vectol=zeros(1,8*Ncell+1)+1e-4;

options = odeset('RelTol',1e-4,'AbsTol',vectol);

[t,y] = ode23(@modele,t,xinit,options);% This function computes the output of the ode previously defined.