11.07.2015 Views

Modeling Tools for Environmental Engineers and Scientists

Modeling Tools for Environmental Engineers and Scientists

Modeling Tools for Environmental Engineers and Scientists

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Figure 7.8 Lake example modeled in MATLAB ® <strong>for</strong> various exponentially decaying loads.supplied in the following lines. A For loop is set up to solve the governingODE <strong>for</strong> µ ranging from 0 to 0.5, in steps of 0.1. A built-in function, ode45,is used here to solve that ODE. The custom function Lake defined in theM-File is used as one of the arguments <strong>for</strong> ode45, which identifies the ODEto be solved. The range of the independent variable over which the solutionis sought <strong>and</strong> the initial value of the dependent variable are also specified bythe other two arguments of this call. The result from ode45 is returned in the<strong>for</strong>m of a matrix [t, C], which is then fed to the built-in plot function to generatethe graph of C vs. t. The text comm<strong>and</strong> is used to add annotations tothe plot by specifying the locations <strong>and</strong> the text to be inserted. The hold on© 2002 by CRC Press LLC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!