Skip to main content

modsim

The modsim repository contains reusable physics and numerical code for simulation and analysis. It supplies algorithms used by Sedaro model components and can also be called directly from custom model behavior, workflow preprocessing, or post-simulation analysis.

See the Content Repositories overview for how ModSim works with Kits and the Sedaro framework.

What's in the repository​

Source locationLibraryPurpose
modsim/Rust crate modsimDomain algorithms and numerical types, independent of Python.
modsim_py/modsim/Python package modsimPython algorithms, numerical and data-processing utilities, estimation, file readers, and reference-data access.
modsim_py/src/Rust binding crate rustThe PyO3 extension exposed as modsim.rust, plus native state managers for the simulator.
modsim_py/modsim/data/Runtime dataEphemeris kernels, time data, environmental grids, and other data used by the calculations.

The Python package combines Python implementations with a subset of Rust functionality exposed through bindings. An algorithm's presence in the Rust crate does not imply an identical Python API. Inspect the relevant exports and calling code for the interface you need.

Capabilities you can reuse​

The current source includes these broad areas:

AreaExamples
Orbits and trajectoriesOrbital elements, initial conditions, propagation, gravity models, ephemerides, relative motion, and targeting calculations.
Coordinates, attitude, and geometryTime and reference-frame conversions, rotations, attitude dynamics and control, fields of view, range, and line-of-sight geometry.
Environments and electromagnetic effectsAtmospheric and geomagnetic models, environmental reference data, and electromagnetic calculations.
Subsystems and networksActuators, power-system calculations, thermal models, and network-routing algorithms.
Estimation and numericsKalman and unscented filtering, process-noise models, interpolation, probability/randomness utilities, and supporting mathematics.
Data exchange and analysisEphemeris, antenna, and visibility file utilities, alongside surrogate-modeling and other analysis helpers.

These are building blocks with specific conventions and assumptions. When selecting one, check its units, reference frames, time convention, input/output shapes, valid data range, and numerical tolerances in the implementation and tests. For example, two position arrays are interchangeable only when their frames, units, and epochs agree.

Use ModSim in a model or workflow​

There are three common integration paths:

  1. Use it through a Kits component. A supplied satellite, attitude controller, or other model component already connects its configuration and state to the relevant algorithms. This is usually the shortest route to a simulation using existing behavior.
  2. Call an algorithm from your own code. Reuse a Python function or Rust library operation in a custom model, input transformation, or result analysis. You provide the surrounding model structure or workflow and handle the resulting data.
  3. Use native model behavior. The binding crate includes Rust state managers that participate in simulator execution. Their wiring, consumed/produced data, and runtime requirements matter in addition to the underlying calculation.

Runtime and data considerations​

The Python distribution includes the compiled modsim.rust extension. Changes to its Rust sources require rebuilding the extension; Python source changes alone do not rebuild native code.

The Rust library gates some functionality behind the environment, em, and ephemeris Cargo features; all enables those three. Check the selected features when integrating the Rust crate directly. Ephemeris calculations also depend on the appropriate kernel data, and the checkout includes both full and time-limited subset kernels. Choose data whose coverage includes your scenario dates.

The repository supplies domain algorithms and native model operators; simulator and ABI packages remain external dependencies. Workflows need compatible package versions, runtime data, and native execution support for the operators their models use. A local testing interpreter does not necessarily support every native operator.