# Flows out of compartments

Hi there,

I have a compartment "comp1" with an initial value of 10,
i have a flow going out of the compartment with the eq.

if time(1)-init_time(1) >1 and time(1)-init_time(1)

the flow is connected to another compartment "cd1"

i am expecting that at age 1 the value of 5 will appear in cd1.
it doesnt. its a number more like 3.67...

im not sure why.

also my time step is 0.1

can you help me..

cheers
LS

Forums:

### Hi, For every time step

Hi,

For every time step between time 1.0 and 2.0 a flow of half the contents of comp1 per unit time flows out of comp1. cd1 is incremented by 0.1 of the flow because each of these time steps is in units of substance per unit time and each time step is only 0.1 unit time.

I set the display interval to 0.1 to match the time step to show what was going on each time step.

Time cd1 flow1 comp1
0.9 0.0000 0.0000 10.0000
1.0 0.0000 0.0000 10.0000
1.1 0.0000 5.0000 10.0000
1.2 0.5000 4.7500 9.5000
1.3 0.9750 4.5125 9.0250
1.4 1.4263 4.2869 8.5738
1.5 1.8549 4.0725 8.1451
1.6 2.2622 3.8689 7.7378
1.7 2.6491 3.6755 7.3509
1.8 3.0166 3.4917 6.9834
1.9 3.3658 3.3171 6.6342
2.0 3.6975 0.0000 6.3025
2.1 3.6975 0.0000 6.3025
2.2 3.6975 0.0000 6.3025

To get a step change so that 0.5 of comp1 flows to cd1 use:

`if time(1)-init_time(1) ==1 then comp1*.5/dt(1) else 0`

The step flow occurs at time = 1.0 and appears in cd1 at the next time step, time=1.1. The expression comp1*.5 is divided by dt(1) (the time step) so that the whole amount of substance of the flow for one time unit occurs on one time step