BobDyn/BobLib Use Guide
Use BobDyn/BobLib for the low-level Modelica model layer: VehicleInterfaces contracts, subsystem assemblies, vehicle records, direct OpenModelica checks, OMEdit diagrams, and package-level regression tests.
Starting point
In this guide, the BobDyn/BobLib root means a direct BobLib repository checkout. If you are inside BobSim, the same library lives at _0_Utils/external/BobLib/.
Normal BobLib Loop
- Pick the vehicle entry point, subsystem package, or record you need to work on.
- Edit Modelica models or records in the package that owns that physics.
- Run the BobLib checks.
- Load BobLib in OMEdit or translate it with OpenModelica.
- Hand the model back to BobSim when you need full workflow runs, plots, metrics, or reports.
Main Public Entry Points
| Model or package | Use it for |
|---|---|
BobLib.Experiments.Standards.VehicleSim | Primary full-vehicle simulation entry point |
BobLib.Experiments.Standards.FourPostSim | Four-post and K&C-style simulation entry point |
BobLib.Experiments.Standards.Templates | Explicit redeclare reference models for standard architectures |
BobLib.Records.VehicleDefn | Complete vehicle records assembled from domain-owned records |
BobLib.Records.VehicleRecord | Domain-level record schemas and parameter ownership |
Regression and component fixtures live in the sibling Tests/BobLibTest Modelica package.
Run Checks
From the BobLib root:
make testWith a local virtual environment:
make test PYTHON=.venv/bin/pythonUse these checks before sharing package-structure, records, or public entry point changes. The tests keep class coverage manifests and package expectations aligned.
Work Visually In OMEdit
Load BobLib:
BobLib/package.moThen open:
BobLib.Experiments.Standards.VehicleSim
BobLib.Experiments.Standards.FourPostSimUse OMEdit Workflow for the screenshot-guided path from a clean OMEdit session.
Work From The CLI
Use direct OpenModelica work when you need fast translation checks, headless smoke tests, or repeatable package validation. The CLI Workflow page documents the current command-line path.
For standard simulations, prefer BobSim once the model translates. BobSim owns case execution, cleanup policy, signal extraction, metrics, and reports.
Edit Vehicle Data
Vehicle data should live in Modelica records, not generated Python or YAML. Keep the ownership split clear:
| Record area | Owns |
|---|---|
Records.VehicleRecord | Domain-level schemas and subsystem parameter records |
Records.VehicleDefn | Complete vehicle definitions that aggregate domain-owned records |
| BobSim workflow YAML | Study cases, runtime overrides, and output/report behavior |
Treat records as durable schemas. If a parameter belongs to chassis, aero, power electronics, controls, driveline, energy storage, or another subsystem, place it in that subsystem's record path and aggregate it upward.
When To Switch To BobSim
Switch to BobSim when you need:
- standard maneuver evaluation
- four-post evaluation
- envelopes or design-of-experiments sweeps
- report generation
- metric CSVs
- retained or cleaned per-case run directories
- comparison of multiple workflow cases
Related Pages
- BobDyn/BobLib Overview for package architecture
- Package Map for hierarchy and ownership
- Entry Points for standard models and templates
- BobSim Use Guide for workflow execution
