Modification of MODFLOW to calculate a wide range of analytical
derivatives and its use in Sensitivity Analysis

Maged Hussein, Amir Gamliel

Interagency Modeling Center, US Army Corps of Engineers, West Palm Beach, FL, USA

ABSTRACT

Inverse modeling and parameter estimation have become valuable tools for calibration of water resources and environmental models as well as for quantifying uncertainties associated with the use of these models in planning and operation. Due to the nonlinearity of these models, estimates of derivatives are essential for such application. In addition, other applications such as solution of nonlinear systems using Newton-Raphson requires estimate of derivatives. The traditional approach of using numerical derivatives requires running the models repeatedly. For complex problems routinely facing environmental engineers, the cost of obtaining numerical derivatives limits the usefulness of automatic calibration. As an alternative, analytical derivatives can be obtained with limited overhead for complex models. However, considerable effort from the code developer is required to build the derivatives into the modeling code.

In this paper, we introduce automatic differentiation as an approach for building analytical derivatives into MODFLOW for a wide range of applications. A new MODFLOW code is developed where analytical derivatives are calculated as part of the solution for a wide range of parameters. We discus a test problem where the cost saving and the improved accuracy obtained by analytical derivatives are clearly
demonstrated. The analytical derivatives results and run times are compared to numerical derivatives obtained by PEST and the analytical derivatives are used in PEST for uncertainty analysis. The test problem involves a large complex MODFLOW model simulating surface/subsurface interaction between groundwater, wetlands, and canals in South Florida.