|
|
Line 7: |
Line 7: |
| | | |
| | | |
- | <html xmlns:v="urn:schemas-microsoft-com:vml"
| + | % simul.m : simulation of the model |
- | xmlns:o="urn:schemas-microsoft-com:office:office"
| + | |
- | xmlns:w="urn:schemas-microsoft-com:office:word"
| + | |
- | xmlns="http://www.w3.org/TR/REC-html40">
| + | |
| | | |
- | <head>
| + | %%% Commentary: This function is used in the premiermodele.m file that has |
- | <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="simul_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>0</o:TotalTime>
| + | |
- | <o:Created>2008-08-06T17:08:00Z</o:Created>
| + | |
- | <o:LastSaved>2008-08-06T17:08:00Z</o:LastSaved>
| + | |
- | <o:Pages>1</o:Pages>
| + | |
- | <o:Words>74</o:Words>
| + | |
- | <o:Characters>409</o:Characters>
| + | |
- | <o:Company> Supélec</o:Company>
| + | |
- | <o:Lines>3</o:Lines>
| + | |
- | <o:Paragraphs>1</o:Paragraphs>
| + | |
- | <o:CharactersWithSpaces>482</o:CharactersWithSpaces>
| + | |
- | <o:Version>11.6408</o:Version>
| + | |
- | </o:DocumentProperties>
| + | |
- | </xml><![endif]--><!--[if gte mso 9]><xml>
| + | |
- | <w:WordDocument>
| + | |
- | <w:GrammarState>Clean</w:GrammarState>
| + | |
- | <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";}
| + | |
- | span.GramE
| + | |
- | {mso-style-name:"";
| + | |
- | mso-gram-e:yes;}
| + | |
- | @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>
| + | |
| | | |
- | <body lang=FR style='tab-interval:35.4pt'>
| + | %%% to be launched. |
| | | |
- | <div class=Section1>
| + | |
| | | |
- | <p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
| + | %%% Code: |
- | lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";color:forestgreen;
| + | |
- | mso-ansi-language:EN-GB'>% <span class=GramE>simul.m :</span> 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>
| + | |
| | | |
- | <p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
| + | function [y,t]=simul(t,xinit) |
- | class=GramE><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><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
| + | % [y,t]=simul(t,xinit) |
- | 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>
| + | |
| | | |
- | <p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
| + | % t : duration of the simulation |
- | 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>
| + | |
| | | |
- | <p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
| + | % xinit: initial state |
- | 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>
| + | |
| | | |
- | <p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
| + | % y: output |
- | class=GramE><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
| + | |
- | color:blue;mso-ansi-language:EN-GB'>function</span></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<span class=GramE>,t</span>]=simul(t,xinit)</span><span
| + | |
- | style='font-family:"Courier New";mso-bidi-font-family:"Times New Roman"'><o:p></o:p></span></p>
| + | |
| | | |
- | <p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
| + | global Ncell |
- | class=GramE><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</span></span><span lang=EN-GB style='font-size:10.0pt;font-family:
| + | |
- | "Courier New";color:forestgreen;mso-ansi-language:EN-GB'> : 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
| + | |
- | class=GramE><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</span></span><span lang=EN-GB style='font-size:10.0pt;font-family:
| + | |
- | "Courier New";color:forestgreen;mso-ansi-language:EN-GB'>: 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>
| + | |
| | | |
- | <p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
| + | % simulation |
- | class=GramE><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</span></span><span lang=EN-GB style='font-size:10.0pt;font-family:
| + | |
- | "Courier New";color:forestgreen;mso-ansi-language:EN-GB'>: 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>
| + | |
| | | |
- | <p class=MsoNormal style='mso-layout-grid-align:none;text-autospace:none'><span
| + | vectol=zeros(1,8*Ncell+1)+1e-4; |
- | 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
| + | options = odeset('RelTol',1e-4,'AbsTol',vectol); |
- | 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
| + | |
- | class=GramE><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";
| + | |
- | color:black;mso-ansi-language:EN-GB'>options</span></span><span lang=EN-GB
| + | |
- | style='font-size:10.0pt;font-family:"Courier New";color:black;mso-ansi-language:
| + | |
- | EN-GB'> = 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'>,[1e-4 1e-4 1e-4 1e-4 1e-4 1e-4 1e-4 1e-4 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'>[<span class=GramE>t,</span>y] = <span class=GramE>ode23(</span>@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> </o:p></span></p>
| + | [t,y] = ode23(@modele,t,xinit,options);% This function computes the output of the ode previously defined. |
| | | |
- | </div>
| + | |
- | | + | |
- | </body>
| + | |
- | | + | |
- | </html>
| + | |
| | | |
| |}<br style="clear:both" /> | | |}<br style="clear:both" /> |