Learn R Programming

Certara.RDarwin (version 1.2.0)

specify_SimParams: Specify Engine Parameters for Model Simulation

Description

Use to define engine parameters for model simulation. Generates a single character string containing space-separated name=value pairs.

Usage

specify_SimParams(
  numReplicates = 100L,
  seed = 1234L,
  sort = FALSE,
  ODE = c("MatrixExponent", "DVERK", "DOPRI5", "AutoDetect", "Stiff"),
  rtolODE = 1e-06,
  atolODE = 1e-06,
  maxStepsODE = 50000L
)

Value

A single character string containing space-separated name=value

pairs, ordered according to the function signature. Includes numReplicates, seed, sort always, and other parameters if specified with non-default, applicable values.

Arguments

numReplicates

Integer; Number of replicates (simulations) to generate. Must be positive. Always included in output.

seed

Integer; Seed for the random number generator used during simulation. Always included in output.

sort

Logical; Specifies whether to sort the input data by subject and time before simulation. Default: FALSE. Always included in output.

ODE

Character; Specifies the ODE solver. Options: "MatrixExponent", "DVERK", "DOPRI5", "AutoDetect", "Stiff". Default: "MatrixExponent".

rtolODE

Numeric; Relative tolerance for the ODE solver. Default: 1e-6. (Not applicable if ODE = "MatrixExponent").

atolODE

Numeric; Absolute tolerance for the ODE solver. Default: 1e-6. (Not applicable if ODE = "MatrixExponent").

maxStepsODE

Integer; Maximum number of steps for the ODE solver. Default: 50000L. (Not applicable if ODE = "MatrixExponent").

Details

This function allows customization of the NLME engine settings specific to simulation runs. Parameters are validated based on type and range.

The parameters numReplicates, seed, and sort are always included in the output string. Other parameters (ODE, rtolODE, atolODE, maxStepsODE) are included only if their specified value differs from the function's default value and they are applicable (ODE tolerances are ignored if ODE="MatrixExponent").

Values are returned as character strings. The order of parameters in the output string matches the order in the function definition.

See Also

write_ModelTemplateTokens(), specify_EngineParams(), Table()

Examples

Run this code
# Default settings (includes numReplicates, seed, sort)
SimArgs1 <- specify_SimParams()
print(SimArgs1)

# Custom settings
SimArgs2 <-
  specify_SimParams(
    numReplicates = 50,
    seed = 9876,
    sort = TRUE, # Non-default
    ODE = "DVERK", # Non-default
    rtolODE = 1e-5 # Non-default and applicable
  )
print(SimArgs2)

# Custom settings where ODE tolerances are ignored
SimArgs3 <-
  specify_SimParams(
    numReplicates = 20,
    ODE = "MatrixExponent", # Default, but tolerances are now inapplicable
    rtolODE = 1e-4 # Non-default, but ignored
   )
print(SimArgs3)

Run the code above in your browser using DataLab