Learn R Programming

respirometry (version 2.0.0)

flush_water: Find percent of water exchanged after a flush

Description

Calculate the proportion of water in a respirometer that is new after a flush. Useful for intermittent respirometry. Given 3 of the first 4 parameters, the 4th parameter is calculated.

Usage

flush_water(vol, flow_rate, duration, perc_fresh, plot = FALSE)

Arguments

vol

volume of the respirometer (liter).

flow_rate

rate of water flow into the respirometer (liters / minute).

duration

duration of the flush (minutes).

perc_fresh

percent of the respirometer volume that is new flushed water.

plot

logical. Plot the percent exchanged as a function of flow rate and duration to see what effect would result if the rate or duration are changed. All parameters must only have a single value.

Author

Matthew A. Birk, matthewabirk@gmail.com

References

Steffensen JF. 1989. Some errors in respirometry of aquatic breathers: How to avoid and correct for them. Fish Physiol Biochem. 6:49–59. Equation 5.

See Also

flush_carb, min_flow

Examples

Run this code
# What proportion of a 90 L respirometer is exchanged after 20 minutes of flow at 2 LPM?
flush_water(vol = 90, flow_rate = 2, duration = 20)

# Would it be worth it to extend the flush another five minutes? How much would that
# improve the exchange?
flush_water(vol = 90, flow_rate = 2, duration = 20, plot = TRUE)
# Another five minutes would increase exchange by nearly 10%.
# Perhaps that's worth the extra time...

# Visualize flushing
vol = 150
flow_rate = seq(0, 10, by = 0.5)
duration = 0:60
perc_fresh = outer(flow_rate, duration, function(flow_rate, duration){
	flush_water(vol = vol, flow_rate = flow_rate, duration = duration)
})
persp(flow_rate, duration, perc_fresh, xlab = 'Flow rate (LPM)', ylab = 'Duration (min)',
zlab = '% exchange', theta = 45, phi = 15, expand = 0.5, ticktype = 'detailed', nticks = 10)

Run the code above in your browser using DataLab