k <- 10
top <- 10
base <- 0
n <- 0.2
TR <- k * (top - base)
w <- well(xw = 50, yw = 0, Q = 200)
rf <- constant(xc = -500, yc = 0, h = 20)
uf <- uniformflow(gradient = 0.002, angle = -45, TR = TR)
hdw <- headwell(xw = 0, yw = 100, rw = 0.3, hc = 8)
ls <- linesink(x0 = -200, y0 = -150, x1 = 200, y1 = 150, sigma = 1)
# Creating aem ----
m <- aem(k, top, base, n, w, rf, uf, hdw, ls)
# or with elements in named list
m <- aem(k, top, base, n,
list('well' = w, 'constant' = rf, 'flow' = uf, 'headwell' = hdw, 'river' = ls),
type = 'confined')
# Solving ----
m <- solve(m)
# solving requires a reference point (constant) element if head-specified elements are supplied
try(
m <- aem(k = k, top = top, base = base, n = n, w, uf, hdw)
)
# Plotting ----
plot(ls)
plot(w, add = TRUE)
plot(uf) # empty
plot(m, xlim = c(-500, 500), ylim = c(-250, 250))
xg <- seq(-500, 500, length = 200)
yg <- seq(-250, 250, length = 100)
contours(m, x = xg, y = yg, col = 'dodgerblue', nlevels = 20)
plot(m, add = TRUE)
Run the code above in your browser using DataLab