SysML v2 Projects
Simulation Settings in the Model
A SysML v2 project keeps its simulation settings in the model, as metadata from the library package HolarchSimulation. Other SysML v2 tools read them as ordinary metadata.
Write them
- Select a step, succession, decision, loop or
ifaction and use the inspector's Simulation section: Duration writes the duration attribute (the mean) and a distribution annotation such as@HolarchSimulation::Triangular { low = 45 [s]; mode = 1 [min]; high = 2 [min]; }; Probability (%) writes@HolarchSimulation::Probability { percent = 70; }; Iterations writes@HolarchSimulation::LoopCount. Each change can be undone with a single Undo. - Or write them in the text: inside the element, or as
metadata HolarchSimulation::Consumes about DriveCycle::drive, DrivenCar::powertrain::battery { amount = 1.5; }. - Other annotations: Resource, Consumes, Produces, Seizes, Utilization, Cost, Transfer, Timeout, NotBefore, History and more. These run with the SysML engine.
Correlate inputs
- Values drawn from distributions are independent unless correlated:
metadata HolarchSimulation::Correlation about findCharger::duration, charge::duration { coefficient = 0.6; }gives the two values a rank (Spearman) correlation of 0.6. Each keeps its own distribution. - On the Simulator, in Monte Carlo mode with the SysML engine, Correlated Inputs lists the pairs. Choose two attributes and a coefficient from -1 to 1 and click + Add Correlation; change or remove a pair in the table. Each change can be undone with a single Undo. After a study, Achieved shows the correlation the runs drew.
- Coefficients that contradict each other (a with b and b with c strongly, a against c) are reported in the Editor, and the study does not run until one is weakened.
Older projects
Settings made before they moved into the model stay next to the model and still win. On the Simulator, click Move Simulation Settings into the Model…, check the preview and click Move into the Model: the runs give the same results, and a single Undo takes it all back.
Simulate a state machine
- With the SysML engine, choose a state definition or a part that exhibits states as Root on the Simulator. Optionally choose a scenario under Run together with, and add Stimuli: a time, a signal and the machine that receives it.
- The States tab shows the states over time and the transitions fired; in Monte Carlo, the time in each state and transition counts. Check Against Requirement… offers time in state and share of the run.
- On a State Transition View, ▶ Simulate steps or runs the machine on the view, lighting the active states.
Full documentation: Simulation Metadata in SysML v2 Projects