Soil Water Modeling in Python and Excel


Buy the book

Publisher's site - cheaper and recommended



Book: RM40

About the author

Christopher Teh is a lecturer in agriculture at the Dept. of Land Management, Uni. Putra Malaysia. His field of specialty is in soil and water conservation. He has several publications in books, journals, conference proceedings, and newspapers. He is also a regular contributor for the Dear Plant Doctor monthly column in The Star newspaper for promoting and helping urban gardeners. He has also won several teaching innovations awarded by his university for teaching excellence.

Download a preview

Chapter 4 - download (PDF)

Book Synopsis

Build a complete and working soil water model in either Python or Microsoft Excel. With this book, you will: 1) understand how and why water flows in the soil and what factors affect its flow; 2) how the soil water flow can be described as a set of mathematical equations; and 3) how these equations can be implemented into a computer program in Python language and in Excel to simulate the vertical soil water flow. Fair knowledge in either Python or Excel is required to build the model (but knowledge in Visual Basic for Applications is not needed). Several scenarios are presented to describe how the model can be applied, and the simulation results for each scenario are discussed.

Book Details

ISBN-13: 9789673447626
Publisher: Uni. Putra Malaysia Press, Serdang, Selangor, Malaysia
Year: 2017
No. of pages: 154
Type: Paperback
Dimensions: 6.5 by 9.5 inches (paperback)


1. Python code - download (24 kb)
This archive contains the soil water model in python. See Appendix A in the book for the installation instructions.
1. Excel workbook - download (88 kb)
This archive contains the soil water model as an Excel workbook. IMPORTANT: Requires BuildIt add-in to work (see below).
1. BuildIt add-in - download (4.79 Mb)
This archive contains the Excel add-in, called BuildIt, to build mathematical models in Excel, some examples, and installation instructions. See Appendix B in the book for the installation instructions.

Source code

The Python code of PyWaterBal soil water flow model lives on Github.

  1. TEH, C.B.S. 2018. Development and validation of an unsaturated soil water flow model for oil palm. Pertanika Journal of Tropical Agriculture, 41: 773-786.

  2. TEH, C.B.S. & CHEAH, S.S. 2018. Modelling crop growth and yield in palm oil cultivation. In: Rival, A. (Ed.) Achieving sustainable cultivation of oil palm. Vol. 1. Burleigh Dodds Science Publishing: Cambridge, UK. pp. 183-227.

Contact the book author

Homepage | ResearchGate | Google Scholar | Tel: +60-3-8947 4858