Wednesday, March 7, 2018

Water viscosity

“Viscosity is a property of the fluid which opposes the relative motion between the two surfaces of the fluid that are moving at different velocities. In simple terms, viscosity means friction between the molecules of fluid. When the fluid is forced through a tube, the particles which compose the fluid generally move more quickly near the tube's axis and more slowly near its walls; therefore some stress (such as a pressure difference between the two ends of the tube) is needed to overcome the friction between particle layers to keep the fluid moving.” (Source Wikipedia)


One relevant point for us is that water viscosity changes with temperature in a non neglibile way between -10 and 40 centigrades, temperature that many soils can across easily in different seasons: this table shows how much. A model for water viscosity in a large range of temperatures is given by Kestin et al. [1978], which can be used in models.
Viscosity is actually so important that an entire website is dedicated to its experimental values of viscosity: viscopedia. Same information can also be read from this other informative website about water as a substance.
Viscosity variation is usually forgotten in hydrological modelling and the fact that water travels two times faster (at least) in summer than in winter is usually forgotten in any model of runoff production. It is probably time that we incorporate such effects in our modelling of infiltration, and for what regards me, in our numerical integrator of Richards equation.
When dealing with infiltration, in hydrologically realistic contexts, papers by Constanz and coworker are a standard reference, starting from Constantz [1981], Ronan et al, 1998, and Costantz and Murphy [1991]. Papers citing them are also interesting (here the Scopus list) and cover quite recent works too. We can identify two issues (the usual ones): first it is necessary to understand how viscosity variation affects equations of flow, secondly how these affect a heterogeneous landscape.
Grifoll et al (2005), in analysing the problem of water vapor transport, independently if you like or not their solutions, contains the right equations, and can be an help to write yours.
A related question is if temperature alters also the soil water retention curves. This problem is faced by a recent paper by Roshani and Sedano [2016] but it is still clearly an open problem.

I did not start really reading these papers. However, here it is their list below.

Monday, March 5, 2018

Probability and Statistics basics: a very short simple overview of concepts for my students

These lectures cover both the class of Hydrology and Hydraulic Constructions that share the necessity to talk a little of statistics. In four steps I talk about simple concepts about statistics and probability. Very basic stuff to remind to my students what they should already know. Probably in the second series of slides I performed better.

Samples, Population, empirical distributions



Same topic as above but different class


Introduction to visual statistics, location and scale parameters.



Same topic as above but different class


Probability axioms and some derived concepts  visualised



Same topic as above, different class


Acting with Real numbers


Almost the same as above bur with a couple of slides more





Sunday, March 4, 2018

Random sampling (is it defined in probability theory ?)


Really random numbers are not easily obtainable (if they exists). The short story: I perceive that in probability theory the concept of random sampling is not contemplated. Randomness is used by probability theory but is not implied by its axioms.

Randomly literally means that there is no law (expressed in equations) or algorithm (expressed in actions or some programing code) that connects one pick in the sequence to another.  The elements in the sequence can depend on others (as described by their correlation) while this dependence does not imply causation (in the sense that one implies the other): "correlation does not imply causation".
Taking the problem from a different perspective, Judea Pearl stresses that probability is about  "association'' not "causality'' (which is, in a sense, the reverse of randomness): "An associational concept is any relationship that can be defined in terms of a joint distribution of observed variables, and a causal concept is any relationship that cannot be defined from the distribution alone. Examples of associational concepts are: correlation, regression, dependence, conditional independence, like-lihood, collapsibility, propensity score, risk ratio, odds ratio, marginalization, conditionalization, ``controlling for,'' and so on.
Examples of causal concepts are:randomization, influence, effect, confounding, "holding constant,'' disturbance, spurious correlation, faithfulness/stability, instrumental variables, intervention, explanation, attribution, and so on. The former can, while the latter cannot be defined in term of distribution functions." He also writes: "Every claim invoking causal concepts must rely onsome premises that invoke such concepts; it cannot be inferred from, or even defined in terms statistical associations alone.''
Therefore Pearl, at least, in the sense that random elements in a random sequence are not causally related, supports the idea that if probability is not about causality, it is not either about ranmdomness.

Wikipedia also supports my arguments: "Axiomatic probability theory deliberately avoids a definition of a random sequence [2]. Traditional probability theory does not state if a specific sequence is random, but generally proceeds to discuss the properties of random variables and stochastic sequences assuming some definition of randomness. The Bourbaki school considered the statement ``let us consider a random sequence" abuse of language [3] "
The same Wikipedia explains very clearly which is the state of art of randomness concept but, for a more interested reader, the educational review paper by Volchan [4], is certainly informative.

I report from Wikipedia the current state of art for the extractions of random sequences:
"Three basic paradigms for dealing with random sequences have now emerged [5]:
  •   The frequency / measure-theoretic approach. This approach started with the work of Richard von Mises and Alonzo Church. In the 1960s Per Martin-Loef noticed that the sets coding such frequency-based stochastic properties are a special kind measure zero sets, and that a more general and smooth definition can be obtained by considering all effectively measure zero sets.
  •   The complexity / compressibility approach. This paradigm was championed by A. N. Kolmogorov along with contributions Levin and Gregory Chaitin. For finite random sequences, Kolmogorov defined the ``randomness'' as the entropy, Kolmogorov complexity, of a string of length K of zeros and ones as the closeness of its entropy to K, i.e. if the complexity of the string is close to K it is very random and if the complexity is far below K, it is not so random.
  •   The predictability approach. This paradigm was due Claus P. Schnorr and uses a slightly different definition of constructive martingales than martingales used in traditional probability theory. Schnorr showed how the existence of a selective betting strategy implied the existence of a selection rule for a biased sub-sequence. If one only requires a recursive martingale to succeed on a sequence instead of constructively succeeds on a sequence, then one gets the recursively randomness concepts. Yongge Wang that recursively randomness concept is different from Schnorr's randomness concepts. "
"In most cases, theorems relating the three paradigms (often equivalence) have been proven.
I do not pretend to have fully understood the previous statements. However, in summary, we have to grow quite complicate if we want to understand what randomness is.
Once clarified what it is, we can have the problem to assess what can be a random arrangement for an arbitrary set of objects, say  $\Omega$. Taking example of the algorithms used to get a given random sequence of  numbers from a give distribution, we can observe that probability itself can be used to infer the random sequence of a set from a random sequence in [0,1] by inverting the probability $P$.

Random sampling is significant when the set of the domain is subdivided into disjoint parts: a partition. Therefore:

Definition: Given a set (having the structure of a~\(\sigma\)-algebra)~\(\Omega\) let a partition of
~\(\Omega\), denoted as:
${\mathcal P }(\Omega):=\{ x | \cup_{x \in \mathcal P} x = \Omega\, {\rm{and}}\ \forall y,z \in \Omega,\, y\cap z = \emptyset \}$
Through probability \(P\) defined over ${\mathcal P} (\Omega)$ each element $x$ of the set is mapped into the closed interval [0,1] and it is guaranteed that $P[\cup_{x \in \mathcal P} x] = 1$

There is not necessarily an ordering in the partition of $\Omega$ but we can arbitrarily arrange the set and associate each of its element with a subset of [0,1] of Lesbesgue measure (a.k.a. length) corresponding to its probability. By using the arbitrary order  of the partition, we can at the same time build the (cumulative) probability. By arranging or re-arranging the numbers in [0,1], we thus imply (since $P$ is bijective) a re-arrangement of the set ${\mathcal P} (\Omega)$.

Definition: we call sequence of elements in ${\mathcal P} (\Omega)$, denoted as $\mathcal S$ a numerable set of elements in ${\mathcal P} (\Omega)$:
$${\mathcal S} := \{ x_1 \cdot \cdot \cdot\}$$
Definition: we call a sequence a random sequence~~if it ha no
description shorter that itself via a universal Turing machine (orequivalently we can adopt one of the other two definition proposed above
Theorem: A random sequence of integers, through inverting the probability P, defines a random sequence on the set ${\mathcal P} (\Omega)$.
The prof is trivial. If there is a law that connects elements in ${\mathcal P} (\Omega)$ then through the probability $P$ a describing law is obtained also for the random sequence in [0,1], which is, therefore no more random.

So randomness of any set on which is defined a probability can be derived by getting a random sequence in [0,1].

References

[1] - Pearl, J. (2009). Causal inference in statistics: An overview. Statistics Surveys, 30, 96--146.
http://doi.org/10.1214/09-SS057
[2] Inevitable Randomness in Discrete Mathematics by József Beck 2009 ISBN 0-8218-4756-2 page 44
[3] Algorithms: main ideas and applications by Vladimir Andreevich Uspenskiĭ, Alekseĭ, Lʹvovich Semenov 1993 Springer ISBN 0-7923-2210-X page 166
[4] Sergio B. Volchan, What is a random sequences, The American Mathematical Monthly, Vol. 109, 2002, pp. 46–63[5] R. Downey, Some Recent Progress in Algorithmic Randomness, in Mathematical foundations of computer science 2004: by Jiří Fiala, Václav Koubek 2004 ISBN 3-540-22823-3 page 44

Monday, February 26, 2018

Python general resources (for Hydrologists) to start with

There are a lot of resources to start with python, but for hydrologists, but here I tried, at least at the beginning, a list of readings to be quickly operative.
Igor Bobriakov gives in his blog a nice review of the main libraries used nowadays. Useful to have a bird view on them.

Other resources can be:
For who loves more traditional approaches than Notebooks and require a ”books like” approach, maybe because it happens that they never programmed before, the first information is the Python site itself. Its Italian counterpart is here.

  • They suggests Dive into Python (EN, IT) as a good starting book, and I think it is
  • Python Crash course is also a traditional type of book that covers all the traditional element of programming. It is certainly a good book but I would say that its approach does not cope exactly with the modern ‘hip’ approach that a scientist has when using python with more high level infrastructures as Pandas (and partially Numpy and Scipy are) which, for instance often do not require to explicit iterations with “for” loops. 
  • Think Python (EN, IT) is also an alternative to previous books
  • A little different is Thinking in Python, because it is oriented to introduce topics of object oriented (OO) programming which are not usually covered in elementary programming books. Even if OO at its core is to get used to design patterns.
Specifically for hydrologists, but maybe a little obsolete, are:

with a preference for the first one.


Tuesday, February 20, 2018

Costruzioni Idrauliche 2018

This is the material for the 2018 class in Hydraulic constructions at University of Trento. The material, is being revised during the class and is similar to the last year class. A first difference is that slides will be loaded into an Open Science Framework (OSF) repository. More information in the Introductory class below. The name is hydraulic construction. Actually it covers the hydraulic design of a storm water management system and the hydraulic design of an Aqueduct.  With hydraulic design, I mean that the class teach how to calculate the hydraulics of  infrastructure. It will not teach anything else and neither will cover how to really draw them to produce a final executive project. These knowledges are communicated in the class called "Progetto di Costruzioni Idrauliche".

Foreseen Schedule

T - Is a classrom lecture
L - Is a laboratory lecture

Storm water management systems


February



March


April


Instruction for the project of the storm water management system.


Aqueducts


As a general, simple and descriptive reference, the first six chapters of Maurizio Leopardi's book can be useful :
The state of the water supply in Italy is summarised here (Corriere della Sera, 2018-05-16)

May
June
Tools

During the class I will introduce sever tools for calculations.

  • Open Science Framework (OSF): It is a tool for sharing a workflow, especially design for scientific purposes. It allows storage of files and documents and their selective publication on the web.
  • Python - Python is a modern programming languages. It will be used for data treatment, estimation of the idf curves of precipitation, some hydraulic calculation and data visualisation. I will use Python mostly as a scripting language to bind and using existing tools. 
  • SWMM - Is an acronym for Storm Water Management System. Essentially it is a model for the estimation of runoff adjusted to Urban environment. I do not endorse very much its hydrology. However, it is the most used tools by colleagues who cares about storm water management, and I adopt it. It is not a tool for designing storm water networks, and therefore, some more work should be done with Python to fill the gaps.
  • EPANET Is the tool developed by EPA to estimate water distribution networks. 
  • GISWATER: http://growworkinghard.altervista.org/giswater-11-install-windows/
  • QGIS: http://growworkinghard.altervista.org/qgis-2-18-how-to-install-step-by-step-on-windows/
Notes collected by Students:


Some Examples of presentations on the projects of this class:


Questions for the midterm exam
 
Domande della prova intermedia 2017.
 Grades (voti) of the intermediate exam.

Sunday, February 18, 2018

Conoscere, comunicare, gestire il rischio idrogeologico in ambiente montano: 3/3

On February 15, 2018, we had the second day of the workshop: "Know, communicate and manage the hydrological and geological risk in mountain environment", originally intended for journalists, technicians, as politicians. It was held at the Department of Civil, Environmental and Mechanical Engineering Department of the University of Trento. This page reports the second day.
The first part of the workshop can be found in two previous post:
  • Introduction
  • About Italian legislation on hazards by Eugenio Caliceti


  • Planning Emergencies after natural hazards by Marta Martinengo

  • The hazard map of Trentino Province by Mauro Zambotto

  • Discussion after dott. Zambotto presentation

  • Comments on work groups simulations by Rocco Scolozzi