Skip to content

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

  1. Pick the vehicle entry point, subsystem package, or record you need to work on.
  2. Edit Modelica models or records in the package that owns that physics.
  3. Run the BobLib checks.
  4. Load BobLib in OMEdit or translate it with OpenModelica.
  5. Hand the model back to BobSim when you need full workflow runs, plots, metrics, or reports.

Main Public Entry Points

Model or packageUse it for
BobLib.Experiments.Standards.VehicleSimPrimary full-vehicle simulation entry point
BobLib.Experiments.Standards.FourPostSimFour-post and K&C-style simulation entry point
BobLib.Experiments.Standards.TemplatesExplicit redeclare reference models for standard architectures
BobLib.Records.VehicleDefnComplete vehicle records assembled from domain-owned records
BobLib.Records.VehicleRecordDomain-level record schemas and parameter ownership

Regression and component fixtures live in the sibling Tests/BobLibTest Modelica package.

Run Checks

From the BobLib root:

bash
make test

With a local virtual environment:

bash
make test PYTHON=.venv/bin/python

Use 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:

text
BobLib/package.mo

Then open:

text
BobLib.Experiments.Standards.VehicleSim
BobLib.Experiments.Standards.FourPostSim

Use 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 areaOwns
Records.VehicleRecordDomain-level schemas and subsystem parameter records
Records.VehicleDefnComplete vehicle definitions that aggregate domain-owned records
BobSim workflow YAMLStudy 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

Released as open-source vehicle simulation tooling.