Skip to contents

This function restarts a simulation using the state at the end of a previous simulation (GRiwrmOutputsModel object x). It allows redefining the boundary conditions Qinf, Qrelease, and Qmin for the new period.

Usage

# S3 method for class 'GRiwrmOutputsModel'
RunModel(
  x,
  InputsModel,
  RunOptions,
  IndPeriod_Run = which(InputsModel[[1]]$DatesR %in% DatesR),
  DatesR = getNextTimeSteps(x),
  Qinf = NULL,
  Qrelease = NULL,
  Qmin = NULL,
  merge_outputs = TRUE,
  ...
)

Arguments

x

GRiwrmOutputsModel object resulting from a previous run.

InputsModel

GRiwrmInputsModel object (see CreateInputsModel.GRiwrm) or Supervisor object (see CreateSupervisor).

RunOptions

List of run options created with CreateRunOptions.

IndPeriod_Run

Integer vector indicating the indices of the time steps to run. Must start at the index immediately following the previous run.

DatesR

(optional) POSIXt vector of dates for the simulation period. See details.

Qinf

(optional) matrix or data.frame of numeric observed flows for nodes of type "Direct injection" and "Diversion" (m³ per time step). Column names correspond to node IDs. Negative flows are abstracted from the model and positive flows are injected to the model. See details.

Qrelease

(optional) matrix or data.frame of numeric release flows by nodes using the model RunModel_Reservoir (m³ per time step). See details.

Qmin

(optional) matrix or data.frame of numeric minimum flows for downstream of a Diversion node (m³ per time step). Default is zero. Column names correspond to node IDs. See details.

merge_outputs

logical Merge simulation outputs with the one provided in argument x.

...

Further arguments for compatibility with S3 methods.

Value

An object of class GRiwrmOutputsModel (see RunModel.GRiwrmInputsModel for details).

Details

IndPeriod_Run or DatesR must be continuous periods starting the time step after the last simulation time step of the GRiwrmOutputsModel object provided through the argument x.

Qinf, Qmin, and Qrelease are used to overwrite the corresponding arguments provided to CreateInputsModel.GRiwrm for the period to be simulated. Therefore, the number of rows of these arguments must correspond to IndPeriod_Run or DatesR lengths.

See also

CreateGRiwrm(), CreateInputsModel.GRiwrm(), CreateRunOptions()

Vignette "V07_Combine_tactical_operational_management" in package airGRiwrm