Skip to content

Commit

Permalink
Update pumping test notebooks (#60)
Browse files Browse the repository at this point in the history
* Adding files with completed notebooks for tracking (Testing, some fixes still needs to be done)

* Adding README, first version

* Correcting English and adding extra images to the unconfined notes + rerunning the code in the leaky notes

* Corrected English in notebooks and minor change in aquifer.py to avoid bug in leaky2_hardixveld

* Reruning the outputs and correcting english

* adding pumpingtest folders

* merged change in pumping test notebook (dont know why it dind merge before)

* removing unwanted files

* revert all files in docs directory

* last files to remove

* Update confined1_oude_korendijk.ipynb

Update using import ttim as ttm and change all ttim commands
Fix pandas error for use of append - still gives deprecation warning
Set default figure size and remove setting figure size
Add grid to all graphs
Remove next notebook cell at end

* remove fitm

fitm is part of ttim

* modified confined pumpingtest notebooks according to #58 (comment)

* move updated pumping test noteboks

* update tutorials

* move elements to concepts (from howto section)

* move elements to concepts (from howto section)

* delete old pumping test notebooks

* remove url visited date from bib file

* ruff formatting

* organize examples in docs

* ruff format notebooks

* display inline math in notebooks in docs

---------

Co-authored-by: vcantarella <vcantarella@gmail.com>
Co-authored-by: Mark Bakker <markbak@gmail.com>
  • Loading branch information
3 people authored Feb 13, 2024
1 parent c6e4772 commit e81b27c
Show file tree
Hide file tree
Showing 118 changed files with 40,142 additions and 14,736 deletions.
3 changes: 2 additions & 1 deletion docs/00tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ TTim tutorials.

.. toctree::
:maxdepth: 3
:hidden:
:glob:

models.rst
File renamed without changes.
8 changes: 0 additions & 8 deletions docs/01howto/getting_started/index.rst

This file was deleted.

230 changes: 113 additions & 117 deletions docs/01howto/howto_pumpingtest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import ttim as ttm\n",
"\n",
"#\n",
"plt.rcParams['figure.figsize'] = (4, 3) # set default figure size\n",
"plt.rcParams['font.size'] = 8 # set default font size"
"plt.rcParams[\"figure.figsize\"] = (4, 3) # set default figure size\n",
"plt.rcParams[\"font.size\"] = 8 # set default font size"
]
},
{
Expand Down Expand Up @@ -65,22 +66,26 @@
}
],
"source": [
"data = np.loadtxt('data/oudekorendijk_h30.dat')\n",
"data = np.loadtxt(\"data/oudekorendijk_h30.dat\")\n",
"to1 = data[:, 0] / 60 / 24\n",
"ho1 = -data[:, 1]\n",
"ro1 = 30\n",
"print(f'first measurement time: {np.min(to1):.2e}, last measurement time: {np.max(to1):.2e} d')\n",
"print(\n",
" f\"first measurement time: {np.min(to1):.2e}, last measurement time: {np.max(to1):.2e} d\"\n",
")\n",
"\n",
"drawdown = np.loadtxt('data/oudekorendijk_h90.dat')\n",
"drawdown = np.loadtxt(\"data/oudekorendijk_h90.dat\")\n",
"to2 = drawdown[:, 0] / 60 / 24\n",
"ho2 = -drawdown[:, 1]\n",
"ro2 = 90\n",
"print(f'first measurement time: {np.min(to2):.2e}, last measurement time: {np.max(to2):.2e} d')\n",
"print(\n",
" f\"first measurement time: {np.min(to2):.2e}, last measurement time: {np.max(to2):.2e} d\"\n",
")\n",
"\n",
"plt.plot(to1, ho1, 'C0.', label='r=30 m')\n",
"plt.plot(to2, ho2, 'C1.', label='r=90 m')\n",
"plt.xlabel('time (d)')\n",
"plt.ylabel('head (m)')\n",
"plt.plot(to1, ho1, \"C0.\", label=\"r=30 m\")\n",
"plt.plot(to2, ho2, \"C1.\", label=\"r=90 m\")\n",
"plt.xlabel(\"time (d)\")\n",
"plt.ylabel(\"head (m)\")\n",
"plt.legend()\n",
"plt.grid()"
]
Expand Down Expand Up @@ -121,17 +126,8 @@
}
],
"source": [
"ml = ttm.ModelMaq(kaq=60, \n",
" z=(-18, -25), \n",
" Saq=1e-4, \n",
" tmin=1e-5, \n",
" tmax=1)\n",
"w = ttm.Well(model=ml, \n",
" xw=0, \n",
" yw=0, \n",
" rw=0.1, \n",
" tsandQ=[(0, 788)], \n",
" layers=0)\n",
"ml = ttm.ModelMaq(kaq=60, z=(-18, -25), Saq=1e-4, tmin=1e-5, tmax=1)\n",
"w = ttm.Well(model=ml, xw=0, yw=0, rw=0.1, tsandQ=[(0, 788)], layers=0)\n",
"ml.solve()"
]
},
Expand All @@ -154,12 +150,12 @@
"source": [
"hm1 = ml.head(ro1, 0, to1)\n",
"hm2 = ml.head(ro2, 0, to2)\n",
"plt.plot(to1, ho1, 'C0.', label='r=30 m')\n",
"plt.plot(to1, hm1[0], 'C0')\n",
"plt.plot(to2, ho2, 'C1.', label='r=90 m')\n",
"plt.plot(to2, hm2[0], 'C1')\n",
"plt.xlabel('time (d)')\n",
"plt.ylabel('head (m)')\n",
"plt.plot(to1, ho1, \"C0.\", label=\"r=30 m\")\n",
"plt.plot(to1, hm1[0], \"C0\")\n",
"plt.plot(to2, ho2, \"C1.\", label=\"r=90 m\")\n",
"plt.plot(to2, hm2[0], \"C1\")\n",
"plt.xlabel(\"time (d)\")\n",
"plt.ylabel(\"head (m)\")\n",
"plt.legend()\n",
"plt.grid()"
]
Expand Down Expand Up @@ -191,16 +187,17 @@
}
],
"source": [
"cal = ttm.Calibrate(model=ml) # create Calibration object\n",
"cal.set_parameter(name='kaq0', initial=20) # \n",
"cal.set_parameter(name='Saq0', initial=1e-4)\n",
"cal.series(name='obs1', # user specified name\n",
" x=ro1, # x=location of observation well\n",
" y=0, # y-location of obsevation well\n",
" layer=0, # layer number\n",
" t=to1, # observation times\n",
" h=ho1 # observed heads\n",
" )\n",
"cal = ttm.Calibrate(model=ml) # create Calibration object\n",
"cal.set_parameter(name=\"kaq0\", initial=20) #\n",
"cal.set_parameter(name=\"Saq0\", initial=1e-4)\n",
"cal.series(\n",
" name=\"obs1\", # user specified name\n",
" x=ro1, # x=location of observation well\n",
" y=0, # y-location of obsevation well\n",
" layer=0, # layer number\n",
" t=to1, # observation times\n",
" h=ho1, # observed heads\n",
")\n",
"cal.fit(report=False)"
]
},
Expand Down Expand Up @@ -311,8 +308,8 @@
}
],
"source": [
"print('k of model: ', ml.aq.kaq)\n",
"print('Ss of model: ', ml.aq.Saq)"
"print(\"k of model: \", ml.aq.kaq)\n",
"print(\"Ss of model: \", ml.aq.Saq)"
]
},
{
Expand Down Expand Up @@ -340,10 +337,10 @@
],
"source": [
"hm1 = ml.head(ro1, 0, to1)\n",
"plt.plot(to1, ho1, 'k.', label='r=30 m')\n",
"plt.plot(to1, hm1[0], 'C0', label='fit')\n",
"plt.xlabel('time (d)')\n",
"plt.ylabel('head (m)')\n",
"plt.plot(to1, ho1, \"k.\", label=\"r=30 m\")\n",
"plt.plot(to1, hm1[0], \"C0\", label=\"fit\")\n",
"plt.xlabel(\"time (d)\")\n",
"plt.ylabel(\"head (m)\")\n",
"plt.legend()\n",
"plt.grid()"
]
Expand Down Expand Up @@ -452,33 +449,31 @@
}
],
"source": [
"ml2 = ttm.ModelMaq(kaq=60, \n",
" z=(-17, -18, -25), \n",
" Saq=1e-4, \n",
" c=[1000],\n",
" Sll=0,\n",
" topboundary='semi',\n",
" tmin=1e-5, \n",
" tmax=1)\n",
"w = ttm.Well(model=ml2, \n",
" xw=0, \n",
" yw=0, \n",
" rw=0.1, \n",
" tsandQ=[(0, 788)], \n",
" layers=0)\n",
"ml2 = ttm.ModelMaq(\n",
" kaq=60,\n",
" z=(-17, -18, -25),\n",
" Saq=1e-4,\n",
" c=[1000],\n",
" Sll=0,\n",
" topboundary=\"semi\",\n",
" tmin=1e-5,\n",
" tmax=1,\n",
")\n",
"w = ttm.Well(model=ml2, xw=0, yw=0, rw=0.1, tsandQ=[(0, 788)], layers=0)\n",
"ml2.solve()\n",
"#\n",
"cal2 = ttm.Calibrate(model=ml2) # create Calibration object\n",
"cal2.set_parameter(name='kaq0', initial=20) # \n",
"cal2.set_parameter(name='Saq0', initial=1e-4)\n",
"cal2.set_parameter(name='c0', initial=1000)\n",
"cal2.series(name='obs1', # user specified name\n",
" x=ro1, # x=location of observation well\n",
" y=0, # y-location of obsevation well\n",
" layer=0, # layer number\n",
" t=to1, # observation times\n",
" h=ho1 # observed heads\n",
" )\n",
"cal2 = ttm.Calibrate(model=ml2) # create Calibration object\n",
"cal2.set_parameter(name=\"kaq0\", initial=20) #\n",
"cal2.set_parameter(name=\"Saq0\", initial=1e-4)\n",
"cal2.set_parameter(name=\"c0\", initial=1000)\n",
"cal2.series(\n",
" name=\"obs1\", # user specified name\n",
" x=ro1, # x=location of observation well\n",
" y=0, # y-location of obsevation well\n",
" layer=0, # layer number\n",
" t=to1, # observation times\n",
" h=ho1, # observed heads\n",
")\n",
"cal2.fit(report=False)\n",
"display(cal2.parameters)"
]
Expand Down Expand Up @@ -509,11 +504,11 @@
"source": [
"hm1 = ml.head(ro1, 0, to1)\n",
"hm2 = ml2.head(ro1, 0, to1)\n",
"plt.plot(to1, ho1, 'k.', label='r=30 m')\n",
"plt.plot(to1, hm1[0], label='fit 2 params')\n",
"plt.plot(to1, hm2[0], label='fit 3 params')\n",
"plt.xlabel('time (d)')\n",
"plt.ylabel('head (m)')\n",
"plt.plot(to1, ho1, \"k.\", label=\"r=30 m\")\n",
"plt.plot(to1, hm1[0], label=\"fit 2 params\")\n",
"plt.plot(to1, hm2[0], label=\"fit 3 params\")\n",
"plt.xlabel(\"time (d)\")\n",
"plt.ylabel(\"head (m)\")\n",
"plt.legend()\n",
"plt.grid()"
]
Expand All @@ -540,8 +535,8 @@
}
],
"source": [
"print(f'rmse 2 params: {cal.rmse():.3f} m')\n",
"print(f'rmse 3 params: {cal2.rmse():.3f} m')"
"print(f\"rmse 2 params: {cal.rmse():.3f} m\")\n",
"print(f\"rmse 3 params: {cal2.rmse():.3f} m\")"
]
},
{
Expand Down Expand Up @@ -651,16 +646,16 @@
}
],
"source": [
"cal.series(name='obs2', # user specified name\n",
" x=ro2, # x=location of observation well\n",
" y=0, # y-location of obsevation well\n",
" layer=0, # layer number\n",
" t=to2, # observation times\n",
" h=ho2 # observed heads\n",
" )\n",
"cal.series(\n",
" name=\"obs2\", # user specified name\n",
" x=ro2, # x=location of observation well\n",
" y=0, # y-location of obsevation well\n",
" layer=0, # layer number\n",
" t=to2, # observation times\n",
" h=ho2, # observed heads\n",
")\n",
"cal.fit(report=False)\n",
"display(cal.parameters)\n",
"print"
"display(cal.parameters)"
]
},
{
Expand Down Expand Up @@ -758,13 +753,14 @@
}
],
"source": [
"cal2.series(name='obs2', # user specified name\n",
" x=ro2, # x=location of observation well\n",
" y=0, # y-location of obsevation well\n",
" layer=0, # layer number\n",
" t=to2, # observation times\n",
" h=ho2 # observed heads\n",
" )\n",
"cal2.series(\n",
" name=\"obs2\", # user specified name\n",
" x=ro2, # x=location of observation well\n",
" y=0, # y-location of obsevation well\n",
" layer=0, # layer number\n",
" t=to2, # observation times\n",
" h=ho2, # observed heads\n",
")\n",
"cal2.fit(report=False)\n",
"display(cal2.parameters)"
]
Expand All @@ -784,8 +780,8 @@
}
],
"source": [
"print(f'rmse 2 params: {cal.rmse():.3f} m')\n",
"print(f'rmse 3 params: {cal2.rmse():.3f} m')"
"print(f\"rmse 2 params: {cal.rmse():.3f} m\")\n",
"print(f\"rmse 3 params: {cal2.rmse():.3f} m\")"
]
},
{
Expand All @@ -809,24 +805,24 @@
"plt.subplot(121)\n",
"hm1 = ml.head(ro1, 0, to1)\n",
"hm2 = ml.head(ro2, 0, to2)\n",
"plt.plot(to1, ho1, 'C0.', label='r=30 m')\n",
"plt.plot(to2, ho2, 'C1.', label='r=90 m')\n",
"plt.plot(to1, hm1[0], 'C0', label='fit 2 params')\n",
"plt.plot(to2, hm2[0], 'C1', label='fit 2 params')\n",
"plt.xlabel('time (d)')\n",
"plt.ylabel('head (m)')\n",
"plt.plot(to1, ho1, \"C0.\", label=\"r=30 m\")\n",
"plt.plot(to2, ho2, \"C1.\", label=\"r=90 m\")\n",
"plt.plot(to1, hm1[0], \"C0\", label=\"fit 2 params\")\n",
"plt.plot(to2, hm2[0], \"C1\", label=\"fit 2 params\")\n",
"plt.xlabel(\"time (d)\")\n",
"plt.ylabel(\"head (m)\")\n",
"plt.legend()\n",
"plt.grid()\n",
"#\n",
"plt.subplot(122)\n",
"hm1 = ml2.head(ro1, 0, to1)\n",
"hm2 = ml2.head(ro2, 0, to2)\n",
"plt.plot(to1, ho1, 'C0.', label='r=30 m')\n",
"plt.plot(to2, ho2, 'C1.', label='r=90 m')\n",
"plt.plot(to1, hm1[0], 'C0', label='fit 3 params')\n",
"plt.plot(to2, hm2[0], 'C1', label='fit 3 params')\n",
"plt.xlabel('time (d)')\n",
"plt.ylabel('head (m)')\n",
"plt.plot(to1, ho1, \"C0.\", label=\"r=30 m\")\n",
"plt.plot(to2, ho2, \"C1.\", label=\"r=90 m\")\n",
"plt.plot(to1, hm1[0], \"C0\", label=\"fit 3 params\")\n",
"plt.plot(to2, hm2[0], \"C1\", label=\"fit 3 params\")\n",
"plt.xlabel(\"time (d)\")\n",
"plt.ylabel(\"head (m)\")\n",
"plt.legend()\n",
"plt.grid()"
]
Expand Down Expand Up @@ -859,24 +855,24 @@
"plt.subplot(121)\n",
"hm1 = ml.head(ro1, 0, to1)\n",
"hm2 = ml.head(ro2, 0, to2)\n",
"plt.semilogx(to1, ho1, 'C0.', label='r=30 m')\n",
"plt.semilogx(to2, ho2, 'C1.', label='r=90 m')\n",
"plt.semilogx(to1, hm1[0], 'C0', label='fit 2 params')\n",
"plt.semilogx(to2, hm2[0], 'C1', label='fit 2 params')\n",
"plt.xlabel('time (d)')\n",
"plt.ylabel('head (m)')\n",
"plt.semilogx(to1, ho1, \"C0.\", label=\"r=30 m\")\n",
"plt.semilogx(to2, ho2, \"C1.\", label=\"r=90 m\")\n",
"plt.semilogx(to1, hm1[0], \"C0\", label=\"fit 2 params\")\n",
"plt.semilogx(to2, hm2[0], \"C1\", label=\"fit 2 params\")\n",
"plt.xlabel(\"time (d)\")\n",
"plt.ylabel(\"head (m)\")\n",
"plt.legend()\n",
"plt.grid()\n",
"#\n",
"plt.subplot(122)\n",
"hm1 = ml2.head(ro1, 0, to1)\n",
"hm2 = ml2.head(ro2, 0, to2)\n",
"plt.semilogx(to1, ho1, 'C0.', label='r=30 m')\n",
"plt.semilogx(to2, ho2, 'C1.', label='r=90 m')\n",
"plt.semilogx(to1, hm1[0], 'C0', label='fit 3 params')\n",
"plt.semilogx(to2, hm2[0], 'C1', label='fit 3 params')\n",
"plt.xlabel('time (d)')\n",
"plt.ylabel('head (m)')\n",
"plt.semilogx(to1, ho1, \"C0.\", label=\"r=30 m\")\n",
"plt.semilogx(to2, ho2, \"C1.\", label=\"r=90 m\")\n",
"plt.semilogx(to1, hm1[0], \"C0\", label=\"fit 3 params\")\n",
"plt.semilogx(to2, hm2[0], \"C1\", label=\"fit 3 params\")\n",
"plt.xlabel(\"time (d)\")\n",
"plt.ylabel(\"head (m)\")\n",
"plt.legend()\n",
"plt.grid()"
]
Expand Down
2 changes: 0 additions & 2 deletions docs/01howto/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ This section contains how to guides on building groundwater models with TTim.
.. toctree::
:maxdepth: 1

getting_started/index.rst
elements/index.rst
howto_pumpingtest
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion docs/02concepts/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ This section contains explanations of some basic concepts that are used in TTim.
.. toctree::
:maxdepth: 3


elements/index.rst
pathlines.rst
File renamed without changes.
Loading

0 comments on commit e81b27c

Please sign in to comment.