Model Coupling
MADS can be coupled with any internal or external model or simulator.
The model coupling is defined in the MADS problem dictionary.
The expectation is that for a given set of model inputs, the model will produce a model output that will be provided back to MADS.
The keywords in the MADS problem dictionary that can be used to define the model coupling are:
Model
: execute a Julia function defined in an input Julia file. The function that should accept aparameter
dictionary with all the model parameters as an input argument and should return anobservation
dictionary with all the model predicted observations. MADS will execute the first function defined in the file.MADS model
: create a Julia function based on an input Julia file. The input file should contain a function that accepts as an argument the MADS problem dictionary. MADS will execute the first function defined in the file. This function should create a Julia function that will accept aparameter
dictionary with all the model parameters as an input argument and will return anobservation
dictionary with all the model predicted observations.Julia model
: execute an internal Julia function that accepts aparameter
dictionary with all the model parameters as an input argument and will return anobservation
dictionary with all the model predicted observations.Command
: execute an external OS command or script that will execute an external model.Julia command
: execute a Julia script that will execute an external model. The Julia script is defined in an input Julia file. The input file should contain a function that accepts aparameter
dictionary with all the model parameters as an input argument. MADS will execute the first function defined in the file. The Julia script should be capable to (1) execute the model (making a system call of an external model), (2) parse the model outputs, (3) return anobservation
dictionary with model predictions.
Both Command
and Julia command
can use different approaches to pass model parameters to the external model.
Only Command
uses different approaches to get back the model outputs. The script defined under Julia command
parses the model outputs using Julia.
Both Command
and Julia command
can use different approaches to pass model parameters to the external model.
Only Command
uses different approaches to get back the model outputs.
The script defined under Julia command
parses the model outputs using Julia.
The available options for writing model inputs and reading model outputs are as follows.
Options for writing model inputs:
Templates
: template files for writing model input files as defined hereASCIIParameters
: model parameters written in a ASCII fileJLDParameters
: model parameters written in a JLD fileJLD2Parameters
: model parameters written in a JLD2 fileYAMLParameters
: model parameters written in a YAML fileJSONParameters
: model parameters written in a JSON file
Options for reading model outputs:
Instructions
: instruction files for reading model output files as defined hereASCIIPredictions
: model predictions read from a ASCII fileJLDPredictions
: model predictions read from a JLD fileJLD2Predictions
: model predictions read from a JLD2 fileYAMLPredictions
: model predictions read from a YAML fileJSONPredictions
: model predictions read from a JSON file