Commit 69794411 authored by Oscar Corvi's avatar Oscar Corvi

"investigating the weir behavior of the PM equation to wind speed"

parent ca10fddc
Pipeline #235931 passed with stage
in 35 seconds
\begin{tabular}{lrrrrrrrr}
\toprule
{} & Varying\_gS & Mod\_var\_gS & Constant\_gS & Mod\_cst\_gS & PT\_model & Bench\_PT & fPAR\_PM & Bench\_PM \\
{} & Varying\_gS & Mod\_var\_gS & Constant\_gS & Mod\_cst\_gS & PT\_model & Bench\_PT & fPAR\_PM & Bench\_PM \\
\midrule
RMSE & 0.613282 & 0.626179 & 0.728898 & 0.750989 & 0.635991 & 2.001012 & 2.367712 & 5.080072 \\
RMedSE & 0.438843 & 0.364637 & 0.482288 & 0.520776 & 0.384338 & 1.306227 & 1.949292 & 4.380618 \\
NS & 0.746747 & 0.735983 & 0.642259 & 0.620246 & 0.727644 & -1.696088 & -2.774787 & -16.376981 \\
RVE & -0.045086 & -0.004417 & -0.039894 & 0.069212 & -0.058347 & -0.613086 & -0.735152 & -1.652722 \\
MAE & 0.482613 & 0.478669 & 0.573307 & 0.598198 & 0.496328 & 1.702450 & 2.084216 & 4.570540 \\
bias & -0.124684 & -0.012215 & -0.110326 & 0.191402 & -0.161357 & -1.695466 & -2.033035 & -4.570540 \\
RMSE & 0.931820 & 0.893647 & 2.796542 & 1.308901 & 0.635991 & 2.001012 & 4.892235 & 9.123506 \\
RMedSE & 0.407479 & 0.461836 & 2.378363 & 0.990405 & 0.384338 & 1.306227 & 4.206196 & 7.780005 \\
NS & 0.415347 & 0.462268 & -4.265958 & -0.153581 & 0.727644 & -1.696088 & -15.115697 & -55.047735 \\
RVE & -0.046600 & 0.068944 & 0.406716 & 0.336310 & -0.058347 & -0.613086 & -1.601375 & -2.999871 \\
MAE & 0.621935 & 0.649353 & 2.500643 & 1.043889 & 0.496328 & 1.702450 & 4.428542 & 8.296030 \\
bias & -0.128870 & 0.190662 & 1.124757 & 0.930052 & -0.161357 & -1.695466 & -4.428542 & -8.296030 \\
\bottomrule
\end{tabular}
\begin{tabular}{lrrrrrrrr}
\toprule
{} & Varying\_gS & Mod\_var\_gS & Constant\_gS & Mod\_cst\_gS & PT\_model & Bench\_PT & fPAR\_PM & Bench\_PM \\
{} & Varying\_gS & Mod\_var\_gS & Constant\_gS & Mod\_cst\_gS & PT\_model & Bench\_PT & fPAR\_PM & Bench\_PM \\
\midrule
RMSE & 0.770018 & 0.808084 & 0.801993 & 0.918294 & 0.831119 & 1.797729 & 1.936702 & 4.116962 \\
RMedSE & 0.461744 & 0.448924 & 0.505759 & 0.609993 & 0.413534 & 1.265567 & 1.278348 & 2.545557 \\
NS & 0.800861 & 0.780686 & 0.783979 & 0.716784 & 0.768005 & -0.085430 & -0.259735 & -4.692554 \\
RVE & 0.009411 & 0.007280 & -0.009784 & 0.022225 & 0.003059 & -0.373457 & -0.344705 & -0.896827 \\
MAE & 0.563843 & 0.597555 & 0.628617 & 0.720772 & 0.585899 & 1.541070 & 1.553741 & 3.389369 \\
bias & 0.034944 & 0.027033 & -0.036332 & 0.082527 & 0.011358 & -1.386752 & -1.279987 & -3.330175 \\
RMSE & 1.159471 & 1.144177 & 2.855625 & 1.691557 & 0.831119 & 1.797729 & 4.221179 & 7.730995 \\
RMedSE & 0.610701 & 0.656019 & 2.378363 & 1.358722 & 0.413534 & 1.265567 & 3.322006 & 5.591585 \\
NS & 0.548484 & 0.560317 & -1.738771 & 0.038993 & 0.768005 & -0.085430 & -4.984405 & -19.073555 \\
RVE & -0.131226 & -0.062211 & -0.036571 & 0.360602 & 0.003059 & -0.373457 & -0.986124 & -1.817859 \\
MAE & 0.856273 & 0.882958 & 2.519780 & 1.411916 & 0.585899 & 1.541070 & 3.672916 & 6.750230 \\
bias & -0.487281 & -0.231006 & -0.135799 & 1.339018 & 0.011358 & -1.386752 & -3.661761 & -6.750230 \\
\bottomrule
\end{tabular}
\begin{tabular}{lrrrrrrrr}
\toprule
{} & Varying\_gS & Mod\_var\_gS & Constant\_gS & Mod\_cst\_gS & PT\_model & Bench\_PT & fPAR\_PM & Bench\_PM \\
{} & Varying\_gS & Mod\_var\_gS & Constant\_gS & Mod\_cst\_gS & PT\_model & Bench\_PT & fPAR\_PM & Bench\_PM \\
\midrule
RMSE & 0.867409 & 0.931554 & 0.924532 & 1.038747 & 0.899593 & 1.845079 & 1.789343 & 3.849381 \\
RMedSE & 0.471161 & 0.514767 & 0.540893 & 0.648825 & 0.439765 & 1.392651 & 1.189700 & 2.635833 \\
NS & 0.709874 & 0.665378 & 0.670403 & 0.583937 & 0.687945 & -0.312710 & -0.234599 & -4.713745 \\
RVE & 0.024020 & 0.013361 & -0.002139 & 0.024325 & 0.021555 & -0.364515 & -0.270482 & -0.801912 \\
MAE & 0.614918 & 0.676997 & 0.692477 & 0.799959 & 0.619385 & 1.600261 & 1.406583 & 3.199727 \\
bias & 0.092765 & 0.051602 & -0.008259 & 0.093944 & 0.083244 & -1.407761 & -1.044603 & -3.096990 \\
RMSE & 1.283445 & 1.273254 & 2.945861 & 1.762784 & 0.899593 & 1.845079 & 3.956166 & 7.332395 \\
RMedSE & 0.678966 & 0.767610 & 2.438221 & 1.470380 & 0.439765 & 1.392651 & 3.034375 & 5.581212 \\
NS & 0.364825 & 0.374872 & -2.346290 & -0.198222 & 0.687945 & -0.312710 & -5.035150 & -19.731502 \\
RVE & -0.153913 & -0.086192 & -0.130060 & 0.369599 & 0.021555 & -0.364515 & -0.869089 & -1.660680 \\
MAE & 0.957122 & 0.988365 & 2.571213 & 1.505232 & 0.619385 & 1.600261 & 3.390706 & 6.414795 \\
bias & -0.594413 & -0.332875 & -0.502292 & 1.427393 & 0.083244 & -1.407761 & -3.356427 & -6.413556 \\
\bottomrule
\end{tabular}
# -*- coding: utf-8 -*-
#
# This file is for use with essm.
# Copyright (C) 2021 ETH Zurich, Swiss Data Science Center.
#
# essm is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# essm is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with essm; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
"""Equations defined in notebooks/theory/theory.ipynb and dependencies."""
from __future__ import division
from __main__ import (
T0, VPD, Delta, E, G, L, Mw, Pvs, R, Rn, S, S_mvg, T, alpha, alpha_PT, c1,
c_p, e_a, e_s, g_a, g_s, gamma, h, m, n, r_a, r_s, rho_a, theta, theta_1,
theta_2, theta_3, theta_4, theta_res, theta_sat
)
from essm import Eq
from essm.equations import Equation
from sympy import Abs, Eq, Piecewise, exp, log
class eq_m_n(Equation):
"""Relation between n and m parameters in MVG model"""
expr = Eq(m, 1 - 1 / n)
class eq_MVG_neg_case(Equation):
"""Mualem-Van Genuchtem model if h < 0"""
expr = Eq(
theta,
theta_res + ((-theta_res + theta_sat) / (Abs(alpha * h) ** n + 1)) ** m
)
class eq_MVG(Equation):
"""Complet Van Genuchtem model"""
expr = Eq(
theta,
Piecewise((theta_sat, h > 0), (
theta_res + ((-theta_res + theta_sat) /
(Abs(alpha * h) ** n + 1)) ** m, True
))
)
class eq_sat_degree(Equation):
"""Relative Saturation degree equation"""
expr = Eq(S_mvg, (theta - theta_res) / (-theta_res + theta_sat))
class eq_MVG_h(Equation):
"""Mualem Van Genuchten model, h as function of theta"""
expr = Eq(h, (-1 + S_mvg ** (-1 / m)) ** (1 / n) / alpha)
class eq_h_FC(Equation):
"""Compute the field capacity out of the soil properties"""
expr = Eq(h, ((n - 1) / n) ** ((1 - 2 * n) / n) / alpha)
class eq_theta_4_3(Equation):
"""Equation valide between theta_4 and theta_3"""
expr = Eq(
theta, theta / (theta_3 - theta_4) + theta_4 / (-theta_3 + theta_4)
)
class eq_theta_2_1(Equation):
"""Equation valide between theta_2 and theta_1"""
expr = Eq(
theta, theta / (-theta_1 + theta_2) + theta_1 / (theta_1 - theta_2)
)
class eq_water_stress_simple(Equation):
"""Simple water stress factor function (h_3 independant of T_0)"""
expr = Eq(
S,
Piecewise((0, theta < theta_4), (
theta / (theta_3 - theta_4) + theta_4 /
(-theta_3 + theta_4), theta < theta_3
), (1, theta < theta_2), (
theta / (-theta_1 + theta_2) + theta_1 /
(theta_1 - theta_2), theta < theta_1
), (0, True))
)
class eq_Pvs_T(Equation):
"""Saturation vapour pressure, Slide 8"""
expr = Eq(Pvs, c1 * exp(L * Mw * (1 / T0 - 1 / T) / R))
class eq_Delta(Equation):
"""Slope of d.Pvas(T)/d.T """
expr = Eq(
Delta,
L * Mw * c1 * exp(L * Mw * (1 / T0 - 1 / T) / R) / (R * T ** 2)
)
class eq_PT(Equation):
"""Priestley-Taylor equation for evaporation flux"""
expr = Eq(E, Delta * alpha_PT * (-G + Rn) / (L * (Delta + gamma)))
class eq_PM(Equation):
"""Penman-Monteith equation"""
expr = Eq(
E, (Delta * (-G + Rn) + c_p * rho_a * (-e_a + e_s) / r_a) /
(L * (Delta + gamma * (1 + r_s / r_a)))
)
class eq_PM_VPD(Equation):
"""Penman-Monteith equation using VPD"""
expr = Eq(
E, (Delta * (-G + Rn) + VPD * c_p * rho_a / r_a) /
(L * (Delta + gamma * (1 + r_s / r_a)))
)
class eq_PM_g(Equation):
"""Penman-Monteith equation using stomatal conductance"""
expr = Eq(
E, (Delta * (-G + Rn) + VPD * c_p * g_a * rho_a) /
(L * (Delta + gamma * (g_a / g_s + 1)))
)
class eq_PM_inv(Equation):
"""Inverse PM equation for inverse modelling of surface resistance"""
expr = Eq(
r_s, (
-Delta * E * L * r_a - Delta * G * r_a + Delta * Rn * r_a -
E * L * gamma * r_a + VPD * c_p * rho_a
) / (E * L * gamma)
)
__all__ = (
'eq_m_n',
'eq_MVG_neg_case',
'eq_MVG',
'eq_sat_degree',
'eq_MVG_h',
'eq_h_FC',
'eq_theta_4_3',
'eq_theta_2_1',
'eq_water_stress_simple',
'eq_Pvs_T',
'eq_Delta',
'eq_PT',
'eq_PM',
'eq_PM_VPD',
'eq_PM_g',
'eq_PM_inv',
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment