[Scilab-users] ODE Simulation Problem Initially solved with FORTRAN to be numrically solved using Scilab

Debola Abduljeleel boljeleel at yahoo.com
Thu Aug 8 22:48:20 CEST 2013


Hiall,

I humbly seek kind  assistance in solving a Simulation Problem (GRAVITY
FLOW TANK) that was initially written  with FORTRAN to numerically integrate two ODEs
(to be given below, eqns 1&2).
Gravity-flow tank
data:
Pipe:
Internal Diameter = 3 ft    Area
= 7.06 ft2     Length
= 3000 ft
Tank:
Internal Diameter = 12ft  Area
= 113 ft2          Height
= 7 ft
 
Steady State
values:
F = 35.1 ft3/s (15, 700 gpm)
h = 4.72 ft
υ = 4.97 ft/s
 
dυ/dt
= 0.0107h – 0.00205υ2 …………………eqn(1)

dh/dt
= 0.311 – 0.0624υ………………………eqn(2)

The
following FORTRAN program numerically integrates the two ODEs describing the
system for two different initial conditions of flow and liquid level in the
tank: (1) when the initial flow rate is 50 percent of the design rate, and (2)
when the initial flow rate is 67 percent of the design flow rate. At time equal
zero, the flow rate into the tank is increased to the maximum design flow rate
of 35.1 ft3/s.
Gravity-flow
tank simulation (FORTRAN)
C                             (TIME IN SECONDS)
C TWO CASES ARE RUN. AT TIME EQUAL ZERO THE FEED FLOW
RATE IS
C                INCREASED TO 100% OF THE DESIGN FLOW RATE
(15, 700 GPM)
C                CASE NO.1 STARTS FROM 67% OF DESIGN FLOW
RATE
C                CASE NO.2 STARTS FROM 50% OF DESIGN FLOW
RATE
                DATA
V1,H1/3.40,2.05/
                DATA V2,H2/2.50,1.2/
                DO 200 N=1,2
                IF(N.=EQ.1)THEN
                V=V1
                H=H1
            ELSE
                V=V2
                H=H2
                ENDIF
                TIME=0.
                DELTA=1.
                TPRINT=0.
                WRITE(6,1)V,H
          1
FORMAT(‘INITIAL CONDITIONS: V= ‘,F6.3,’ H=’,F8.3)
                WRITE(6,2)
         2 FORMAT(‘               TIME      V             H’)
C
C EVALUATE DERIVATIVES
C
  100
VDOT=0.0107*H-0.00205*V**2
            HDOT=0.311-0.0624*V
            IF(TIME.LT.TPRINT)GO TO 10
            WRITE(6,3)TIME,V,H
        3 FORMAT(3X,3F8.2)
                TPRINT=TPRINT+20.
C
C INTEGRATE USING EULER
C
    10 V = V+
VDOT+VDELTA
          H=
H+HDOT+DELTA
       TIME=TIME+DELTA
        IF(TIME.LE.200.)GO
TO 100
200 CONTINUE
       STOP 
       END
 
The
explicit first-order Euler algorithm is used. The variables that we are solving
for as functions of time are V and H. the right-hand sides of eqns (1) and (3)
are the derivative functions. These are called VDOT and HDOT in the program. At
the nth step in time
(VDOT)n = 0.0107(H)n – 0.00205[(V)n]2 …………………………….eqn(3)
(HDOT)n = 0.311 – 0.0624(V)n…………………………………….eqn(4)
The
new values of H and V at the (n+1)st step are calculated from the Euler
algorithm with a step size of DELTA.
(H)n+1 = (H)n + DELTA(HDOT)n……………………………eqn(5)
(V)n+1 = (V)n +DELTA(VDOT)n……………………………eqn(6)
A
plot was equally generated to illustrate the relationship between h, ft and
process time, s.

Thanks
as I anticipate various professional inputs.
 
ABDULJELEEL A. OSUNKUNLE
SCIENTIFIC OFFICER
PROJECTS DEVELOPMENT INSTITUTE, P.M.B. 01609, EMENE INDUSTRIAL LAYOUT, ENUGU, NIGERIA.
+2347058408440.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20130808/a301a860/attachment.htm>


More information about the users mailing list