This function performs local optimization of a MODFLOW model.
rmf_optimize( path, code = "2005", start = NULL, lower = -Inf, upper = Inf, include = NULL, transform = NULL, cost = "ssq", backup = TRUE, restore = FALSE, visualize = interactive(), export = NULL, continue = FALSE, iterate = 50, tolerate = 1e-04, ... )
path | Path to the NAM file. Typically with extension |
---|---|
code | Name of the MODFLOW variant to use, or path to the executable. |
start, lower, upper | Vectors of PVAL file parameter values to start the
optimization, and corresponding lower and upper limits. These should be
named vectors if not all parameters are provided in their order of
occurrence, where the names (can be regular expressions to) match the
parameter names. Parameters that are not mentioned take the starting value
from the PVAL file, and/or have no constraints. If NULL (default), no
values are changed in the original PVAL file, and/or no constraints are
imposed. |
include | Character vector indicating which PVAL file parameters should
be included. Regular expressions can be used to include multiple parameters
at once. Parameters that are not mentioned are not included. If |
transform | Character vector of transformations. This should be a named
vector if not all parameters are transformed, and listed in their order of
occurrence, where the names (can be regular expressions to) match the
parameter names. Parameters that are not mentioned are not transformed. If
|
cost | Character. The performance measure that should be used as the
cost function. Possible values are those supported by |
backup | Logical. Should a backup (with |
restore | Logical. Should the original PVAL file be restored? Defaults
to |
visualize | Logical. Should the results be visualized during the
analysis? Defaults to |
export | Optional file path to export intermediate results to after each iteration. |
continue | To continue from the last parameter set recorded in the export file, or not. Defaults to FALSE. |
iterate | Integer. Maximum number of iterations. |
tolerate | Double. Relative convergence tolerance. |
... | Optional arguments passed to |
Invisible list with optim()
results and the full parameter list.
Only works with models using MODFLOW parameters and having a head
predictions output file as defined in the HOB object The only method
currently available is "Nelder-Mead". See optim
rmf_execute()
for executing a MODFLOW model.
rmf_analyze()
for analyzing a MODFLOW model.