/
tutorial.Rmd
84 lines (63 loc) · 2.05 KB
/
tutorial.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
title: "Tutorial"
author: "Michael Rustler"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Tutorial}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
# 1. Install from GitHub
```{r eval = FALSE}
if(!require("remotes")) { install.packages("remotes") }
remotes::install_github(repo = "KWB-R/kwb.hantush", dependencies = TRUE)
```
# 2. Using the package
## 2.1 Loading the package
```{r}
library(kwb.hantush)
```
## 2.2 Model validation
For comparing the implementation of the [Hantush equation, 1967](https://doi.org/10.1029/WR003i001p00227) the results are
compared to the [USGS benchmark example (page 25)](https://pubs.usgs.gov/sir/2010/5102/support/sir2010-5102.pdf#page=35). The results can be visualized with the following code:
```{r}
### Comparision of R results to all
### eight benchmark models in one plot
plotModelComparison()
### Comparision of R results to all
### eight benchmark models in multiple plots (one plot for each model)
plotModelComparison(layout=c(1,1))
```
# 3. How to perform model runs?
## 3.1 Model parameterisation
```{r}
baseProps <- baseProperties( time = 2^(0:6), ## day, for 6 different times !
infiltrationRate = 1, ## meter / day
basinWidth = 10, ## meter
basinLength = 50, ## meter
horizConductivity = 10, ## meter / day
iniHead = 10, ## meter
specificYield = 0.2)
```
## 3.2 Running the model
```{r}
res <- hantushDistancesBaseProps(baseProps = baseProps)
```
## 3.3 Plotting the results
```{r}
cols <- length(unique(res$dat[[res$changedBaseProp.Name]]))
mainTxt <- sprintf("Changed baseProperty: %s", res$changedBaseProp.Name)
xyplot(WLincrease ~ x,
groups=res$dat[[res$changedBaseProp.Name]],
data=res$dat,
type="b",
auto.key=list(columns=cols),
main=mainTxt)
```