Description Usage Arguments Details Value Examples
Simulates a model using it's default scenario merged
with the given scenario. A wrapper around the
ode solver.
1 2 3 4 |
model |
A |
scenario |
A If the |
from |
If not missing, overwrites the starting value of the time sequence. Of length 1. |
to |
If not missing, overwrites the end (maximal) value of the time sequence. Of length 1. |
by |
If not missing, overwrites the increment of the time sequence. A number of length 1. |
method |
If not missing, overwrites the integration method. The integrator to be used in the simulation, a string ("lsoda", "lsode", "lsodes","lsodar","vode", "daspk", "euler", "rk4", "ode23", "ode45", "radau", "bdf", "bdf_d", "adams", "impAdams" or "impAdams_d"). Default value is "lsoda". When running with support to events the given method must
be one of the following routines, which have root-finding capability:
See the |
events |
logical: if |
maxroots |
When events = TRUE and events are triggered by a root, the maximal number of times at with a root is found and that are kept; defaults to 100. If the number of roots > maxroot, then only the first maxroot will be outputted. |
terminalroot |
When events = TRUE and events are triggered by a root, the default is that the simulation continues after the event is executed. In terminalroot, we can specify which roots should terminate the simulation. |
ties |
When events = TRUE and events are specified by a data.frame and are "ordered", set to "ordered". The default is "notordered". This will save some computational time. |
storeAuxTrajectory |
logical: if |
storeTimeSeriesTrajectory |
logical: if |
verbose |
Logical: If |
If performance is crucial remember to garantee that the model is already verified and the following logical parameters are set to FALSE: storeAuxTrajectory, storeTimeSeriesTrajectory, verbose.
A sdOutput object initialized with the simulation
trajectories.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # Load the Bouncing Ball model from the sdsim repository
bb <- sdLoadModel(file = "BouncingBall", repository = TRUE)
# simulate the model with validation and plot the results
outbb <- sdSimulate(model = bb, verbose = TRUE)
outbb$plot("height speed", multipleYAxis = TRUE, units = TRUE)
# simualte the Bouncing Ball model in a different scenario with the
# coeficient of restitution equals 0.5 and a shorter time sequence
hardBallScen <- sdScenario(scenarioId = "hardBall",
times = list(to = 5),
input = list(k = 0.5))
outbbHard <- sdSimulate(model = bb, scenario = hardBallScen)
plot(outbbHard)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.