Axino.net

SciLab oxygen saturation

by Arxleol on Friday 18.09.2009, under Programming, Scilab, tutorial

Here is small program I wrote about oxygen saturation of water in the pool. It is in fact really slow however it points what needs to be done in similar situations.

Though this program executes slowly if one would rewrite while loop in the for loop then program should execute faster however I haven’t tested it.

function [] = kisik(Qo,dt)
//--------------------------
// Setup parameters
//--------------------------
i=1;
V=10;
So(i)=0;
t(i)=0;
Ka=0.1;
Sosat=8;
dSo=0;
//--------------------------
// The main time loop
//--------------------------
while So<Sosat
i=i+1;
dSo=(Ka*Qo*(Sosat-So(i-1))*dt)/V;
So(i)=So(i-1)+dSo;
t(i)=t(i-1)+dt;
end
plot2d(t,So)
endfunction

As you can see function takes two parameters. First one represents volume of water passing trough water pool. While second one dt is change in time interval.

Function will run until saturation level in water is same or larger then maximum saturation of oxygen in water. Formula that is user to calculate change in saturation, is second line in while loop.

Almost to forget after saturation levels are calculated graph is drawn of saturation levels on y-axis while on x-axis is time.

Similar Posts:

:, , ,
5 comments for this entry:
  1. Roberto

    cool blog

  2. dilandinga

    pD19fn I bookmarked this link. Thank you for good job!

  3. Hedriwina

    Great. Now i can say thank you!,

  4. Caerwen

    Excellent site. It was pleasant to me.,

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Archives