Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Oscar Corvi
LEAVE_II
Commits
c66dc0a2
Commit
c66dc0a2
authored
Jul 16, 2021
by
Oscar Corvi
Browse files
lambdify debug in simpler_model.ipynb
parent
6ef29e2d
Pipeline
#230911
passed with stage
in 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
notebooks/Finished_project/simpler_model/simpler_model.ipynb
View file @
c66dc0a2
...
...
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "
stable-fields
",
"id": "
generic-navigation
",
"metadata": {},
"source": [
"# **Location of the stress factor in potential evapo-transpiration models**"
...
...
@@ -10,7 +10,7 @@
},
{
"cell_type": "markdown",
"id": "
respective-above
",
"id": "
adjacent-solid
",
"metadata": {
"slideshow": {
"slide_type": "slide"
...
...
@@ -62,7 +62,7 @@
},
{
"cell_type": "markdown",
"id": "
thousand-account
",
"id": "
rotary-preparation
",
"metadata": {},
"source": [
"# Part II - Functions set up"
...
...
@@ -70,7 +70,7 @@
},
{
"cell_type": "markdown",
"id": "
female-rapid
",
"id": "
golden-aircraft
",
"metadata": {},
"source": [
"## Importing relevant packages"
...
...
@@ -79,7 +79,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "
pointed-planning
",
"id": "
spread-volleyball
",
"metadata": {},
"outputs": [
{
...
...
@@ -145,7 +145,7 @@
},
{
"cell_type": "markdown",
"id": "
relative-material
",
"id": "
enormous-cleanup
",
"metadata": {},
"source": [
"## Path of the different files (pre-defined python functions, sympy equations, sympy variables)"
...
...
@@ -154,7 +154,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "a
lpine-musical
",
"id": "a
rctic-fraction
",
"metadata": {
"tags": [
"parameters"
...
...
@@ -185,7 +185,7 @@
},
{
"cell_type": "markdown",
"id": "d
edicated-bookmark
",
"id": "d
ying-notion
",
"metadata": {},
"source": [
"## Importing the sympy variables and equations defined in the theory.ipynb notebook"
...
...
@@ -194,7 +194,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "
growing-subject
",
"id": "
adverse-campus
",
"metadata": {},
"outputs": [
{
...
...
@@ -291,7 +291,7 @@
},
{
"cell_type": "markdown",
"id": "
arranged-personal
",
"id": "
editorial-looking
",
"metadata": {},
"source": [
"## Importing the performance assessment functions defined in the analysis_function.py file"
...
...
@@ -300,7 +300,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "
powerful-encounter
",
"id": "
attended-broad
",
"metadata": {},
"outputs": [
{
...
...
@@ -350,7 +350,7 @@
},
{
"cell_type": "markdown",
"id": "
funky-tribute
",
"id": "
photographic-desktop
",
"metadata": {},
"source": [
"## Data import, preprocess and shape for the computations"
...
...
@@ -358,7 +358,7 @@
},
{
"cell_type": "markdown",
"id": "
disabled-month
",
"id": "
successful-portugal
",
"metadata": {},
"source": [
"### Get the different files where data are stored\n",
...
...
@@ -369,7 +369,7 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "
orange-quilt
",
"id": "
trying-answer
",
"metadata": {},
"outputs": [
{
...
...
@@ -399,7 +399,7 @@
},
{
"cell_type": "markdown",
"id": "
owned-chose
n",
"id": "
fundamental-collectio
n",
"metadata": {},
"source": [
"### Define and test a function that process the fPAR data\n",
...
...
@@ -409,7 +409,7 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "
blind-worth
",
"id": "
union-cheese
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -448,7 +448,7 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "
swedish-burden
",
"id": "
hired-gather
",
"metadata": {},
"outputs": [
{
...
...
@@ -574,7 +574,7 @@
},
{
"cell_type": "markdown",
"id": "
familiar-shannon
",
"id": "
perfect-copper
",
"metadata": {},
"source": [
"### fPARSet function\n",
...
...
@@ -584,7 +584,7 @@
{
"cell_type": "code",
"execution_count": 8,
"id": "
rotary-cand
y",
"id": "
worse-agenc
y",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -615,7 +615,7 @@
},
{
"cell_type": "markdown",
"id": "
analyzed-festival
",
"id": "
interstate-noise
",
"metadata": {},
"source": [
"### DataChose function\n",
...
...
@@ -636,7 +636,7 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "
approved-belgium
",
"id": "
parallel-hygiene
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -729,7 +729,7 @@
},
{
"cell_type": "markdown",
"id": "
interested-cliff
",
"id": "
distant-payday
",
"metadata": {},
"source": [
"## Compile the different functions defined in the symbolic domain\n",
...
...
@@ -738,7 +738,7 @@
},
{
"cell_type": "markdown",
"id": "
governmental-spine
",
"id": "
loose-benefit
",
"metadata": {},
"source": [
"### Water stress functions"
...
...
@@ -747,7 +747,7 @@
{
"cell_type": "code",
"execution_count": 10,
"id": "
comprehensive-asse
t",
"id": "
invisible-merchan
t",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -768,7 +768,7 @@
},
{
"cell_type": "markdown",
"id": "
loving-sherman
",
"id": "
ready-aurora
",
"metadata": {},
"source": [
"### Soil water potential"
...
...
@@ -777,7 +777,7 @@
{
"cell_type": "code",
"execution_count": 11,
"id": "
comic-barre
l",
"id": "
impossible-potentia
l",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -793,7 +793,7 @@
{
"cell_type": "code",
"execution_count": 12,
"id": "c
apital-processing
",
"id": "c
hoice-instrument
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -810,7 +810,7 @@
},
{
"cell_type": "markdown",
"id": "
lucky-adelaide
",
"id": "
specific-awareness
",
"metadata": {},
"source": [
"### Penman-Monteith"
...
...
@@ -819,7 +819,7 @@
{
"cell_type": "code",
"execution_count": 13,
"id": "
funded-mount
",
"id": "
direct-chess
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -838,7 +838,7 @@
{
"cell_type": "code",
"execution_count": 14,
"id": "
whole-velvet
",
"id": "
emotional-aquarium
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -866,7 +866,7 @@
{
"cell_type": "code",
"execution_count": 15,
"id": "
attempted-theme
",
"id": "
eleven-experiment
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -888,7 +888,7 @@
{
"cell_type": "code",
"execution_count": 16,
"id": "
metropolitan-iraqi
",
"id": "
responsible-williams
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -910,7 +910,7 @@
{
"cell_type": "code",
"execution_count": 17,
"id": "
binding-oakland
",
"id": "
chemical-reform
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -932,7 +932,7 @@
{
"cell_type": "code",
"execution_count": 18,
"id": "
fleet-saint
",
"id": "
piano-lesbian
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -960,7 +960,7 @@
{
"cell_type": "code",
"execution_count": 19,
"id": "
breathing-gateway
",
"id": "
stunning-bullet
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -991,7 +991,7 @@
{
"cell_type": "code",
"execution_count": 20,
"id": "
extra-celebr
ation",
"id": "
functioning-rel
ation",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1020,7 +1020,7 @@
{
"cell_type": "code",
"execution_count": 21,
"id": "
outdoor-oliv
er",
"id": "
fuzzy-nurs
er
y
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1054,7 +1054,7 @@
{
"cell_type": "code",
"execution_count": 22,
"id": "
advised-partner
",
"id": "
eleven-approval
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1077,7 +1077,7 @@
{
"cell_type": "code",
"execution_count": 23,
"id": "
lesser-century
",
"id": "
hispanic-romance
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1095,7 +1095,7 @@
},
{
"cell_type": "markdown",
"id": "
assisted-furniture
",
"id": "
thorough-compact
",
"metadata": {},
"source": [
"### Assign the different compiled functions to variables functions (create the functions in python)"
...
...
@@ -1104,7 +1104,7 @@
{
"cell_type": "code",
"execution_count": 24,
"id": "
respected-ballot
",
"id": "
exempt-measure
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1132,7 +1132,7 @@
{
"cell_type": "code",
"execution_count": 25,
"id": "
dramatic-integral
",
"id": "
wooden-indianapolis
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1161,7 +1161,7 @@
},
{
"cell_type": "markdown",
"id": "
progressive-child
",
"id": "
outer-modem
",
"metadata": {},
"source": [
"## Functions to run the different models\n",
...
...
@@ -1170,7 +1170,7 @@
},
{
"cell_type": "markdown",
"id": "
imperial-midwest
",
"id": "
theoretical-lunch
",
"metadata": {},
"source": [
"### Varying surface resistance model"
...
...
@@ -1179,7 +1179,7 @@
{
"cell_type": "code",
"execution_count": 26,
"id": "
visible-silicon
",
"id": "
fitted-capitol
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1242,7 +1242,7 @@
},
{
"cell_type": "markdown",
"id": "
still-colonial
",
"id": "
enormous-delicious
",
"metadata": {},
"source": [
"### Constant surface conductance model"
...
...
@@ -1251,7 +1251,7 @@
{
"cell_type": "code",
"execution_count": 27,
"id": "
macro-energ
y",
"id": "
afraid-securit
y",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1315,7 +1315,7 @@
},
{
"cell_type": "markdown",
"id": "
tight-comedy
",
"id": "
short-roberts
",
"metadata": {},
"source": [
"### Benchmark Penman-Monteith model"
...
...
@@ -1324,7 +1324,7 @@
{
"cell_type": "code",
"execution_count": 28,
"id": "
cubic-naples
",
"id": "
simple-bermuda
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1384,7 +1384,7 @@
{
"cell_type": "code",
"execution_count": 29,
"id": "
attached-confidence
",
"id": "
cognitive-queens
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1443,7 +1443,7 @@
},
{
"cell_type": "markdown",
"id": "
worth-fossil
",
"id": "
incoming-unknown
",
"metadata": {},
"source": [
"### Modified version of the PM equation\n",
...
...
@@ -1459,7 +1459,7 @@
{
"cell_type": "code",
"execution_count": 30,
"id": "
regulation-performanc
e",
"id": "
conservative-pledg
e",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1523,7 +1523,7 @@
{
"cell_type": "code",
"execution_count": 31,
"id": "
engaged-chick
",
"id": "
characteristic-virtue
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1587,7 +1587,7 @@
},
{
"cell_type": "markdown",
"id": "
third-growth
",
"id": "
incorrect-world
",
"metadata": {},
"source": [
"### Priestley and Taylor model"
...
...
@@ -1596,7 +1596,7 @@
{
"cell_type": "code",
"execution_count": 32,
"id": "
conventional-spid
er",
"id": "
forced-design
er",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1652,7 +1652,7 @@
{
"cell_type": "code",
"execution_count": 33,
"id": "
raised-theater
",
"id": "
understood-worship
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1707,7 +1707,7 @@
},
{
"cell_type": "markdown",
"id": "
affiliated-am
in
o
",
"id": "
featured-land
in
g
",
"metadata": {},
"source": [
"### Inverse modelling\n",
...
...
@@ -1717,7 +1717,7 @@
{
"cell_type": "code",
"execution_count": 34,
"id": "
spare-height
",
"id": "
included-nurse
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1771,7 +1771,7 @@
},
{
"cell_type": "markdown",
"id": "
centered-writing
",
"id": "
fitting-tract
",
"metadata": {},
"source": [
"## Calibration algorithm"
...
...
@@ -1780,7 +1780,7 @@
{
"cell_type": "code",
"execution_count": 35,
"id": "
modern-faith
",
"id": "
swedish-fellow
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1802,7 +1802,7 @@
{
"cell_type": "code",
"execution_count": 36,
"id": "
another-moisture
",
"id": "
compatible-target
",
"metadata": {
"jupyter": {
"source_hidden": true
...
...
@@ -1937,7 +1937,7 @@
},
{
"cell_type": "markdown",
"id": "
vocal-renaissanc
e",
"id": "
private-eagl
e",
"metadata": {},
"source": [
"Use the global optimizer from the `scipy.optimize` package. Minimize the squared residual :\n",
...
...
@@ -1949,7 +1949,7 @@
{
"cell_type": "code",
"execution_count": 37,
"id": "
wanted-tyler
",
"id": "
regulated-interaction
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -1968,7 +1968,7 @@
},
{
"cell_type": "markdown",
"id": "
accepted-breath
",
"id": "
valued-vision
",
"metadata": {},
"source": [
"# Part III - Experiments"
...
...
@@ -1976,7 +1976,7 @@
},
{
"cell_type": "markdown",
"id": "
needed-denial
",
"id": "
intelligent-luther
",
"metadata": {},
"source": [
"## One site, one year\n",
...
...
@@ -1986,7 +1986,7 @@
{
"cell_type": "code",
"execution_count": 38,
"id": "
chicken-lyric
",
"id": "
organizational-chrome
",
"metadata": {},
"outputs": [
{
...
...
@@ -10673,7 +10673,7 @@
{
"cell_type": "code",
"execution_count": 39,
"id": "
greater-better
",
"id": "
aboriginal-analyst
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -10683,7 +10683,7 @@
},
{
"cell_type": "markdown",
"id": "
developmental-posting
",
"id": "
political-thriller
",
"metadata": {},
"source": [
"### Calibrate all the models using the optimized function defined above"
...
...
@@ -10692,7 +10692,7 @@
{
"cell_type": "code",
"execution_count": 40,
"id": "
electronic-bundle
",
"id": "
charming-newark
",
"metadata": {},
"outputs": [
{
...
...
@@ -10714,7 +10714,7 @@
},
{
"cell_type": "markdown",
"id": "
intermediate-mobile
",
"id": "
reliable-likelihood
",
"metadata": {},
"source": [
"### Compute the model results with the optimimum parameters"
...
...
@@ -10723,7 +10723,7 @@
{
"cell_type": "code",
"execution_count": 41,
"id": "
great-biography
",
"id": "
instant-malta
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -10739,7 +10739,7 @@
},
{
"cell_type": "markdown",
"id": "p
ortable-andrews
",
"id": "p
acific-district
",
"metadata": {},
"source": [
"### Aggregate the results in a single matrix"
...
...
@@ -10748,7 +10748,7 @@
{
"cell_type": "code",
"execution_count": 42,
"id": "
assumed-finnish
",
"id": "
suited-numbers
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -10791,7 +10791,7 @@
},
{
"cell_type": "markdown",
"id": "
distributed-accused
",
"id": "
static-feature
",
"metadata": {},
"source": [
"### Plot the time serie"
...
...
@@ -10800,7 +10800,7 @@
{
"cell_type": "code",
"execution_count": 43,
"id": "
republican-tripl
e",
"id": "
divine-rebat
e",
"metadata": {
"slideshow": {
"slide_type": "slide"
...
...
@@ -10898,7 +10898,7 @@
},
{
"cell_type": "markdown",
"id": "
guilty-bathroom
",
"id": "
compliant-community
",
"metadata": {},
"source": [
"### Compute the model performance \n",
...
...
@@ -10908,7 +10908,7 @@
{
"cell_type": "code",
"execution_count": 44,
"id": "re
presentative-brighton
",
"id": "re
sponsible-burns
",
"metadata": {},