OpenTwin Hub
Powered by OpenModelica
Vision / Roadmap · OpenTwin Hub illustrates the digital-twin direction for clAImate. It is not wired to live production data — the sealed evidence → hash → engine → VC path lives in the main platform.
Interoperability & Integration
Standards-based, scriptable, portable
OpenTwin Hub is a thin interface layer over OpenModelica. Talk to it via FMI, OMSimulator or your scripting language of choice.
FMI 2.0 / 3.0
Package any Modelica model as a Functional Mock-up Unit for co-simulation or model-exchange in Simulink, Amesim, Adams, and dSPACE.
OMSimulator + SSP
Assemble multi-FMU systems declaratively with SSP. OMSimulator drives the co-simulation master algorithm.
Scripting APIs
OMPython, OMJulia, and OMMatlab expose the OpenModelica compiler and runtime to your CI, notebooks, and pipelines.
OMPython — Python
# OMPython — load, simulate, and read results
from OMPython import OMCSessionZMQ
omc = OMCSessionZMQ()
omc.sendExpression('loadModel(Modelica)')
omc.sendExpression('loadFile("BouncingBall.mo")')
omc.sendExpression(
'simulate(BouncingBall, stopTime=5.0, method="dassl")'
)
res = omc.sendExpression(
'readSimulationResult("BouncingBall_res.mat", {time, h, v})'
)
print(res)
OMJulia — Julia
# OMJulia — parameter sweep example
using OMJulia
omc = OMJulia.OMCSession()
sendExpression(omc, "loadModel(Modelica)")
sendExpression(omc, "loadFile(\"HeatingSystem.mo\")")
for T in 20:2:26
sendExpression(omc,
"setParameterValue(HeatingSystem, T_set, $(T))")
sendExpression(omc,
"simulate(HeatingSystem, stopTime=3600)")
end
OMMatlab — MATLAB
% OMMatlab — script a simulation from MATLAB
om = OMMatlab();
om.ModelicaSystem('DCMotor.mo', 'DCMotor');
om.setParameters({'R=0.5','L=1e-3'});
om.simulate();
data = om.getSolutions({'time','w','i'});
plot(data{1}, data{2});
xlabel('time [s]'); ylabel('\omega [rad/s]');
FMI 2.0 · Co-Simulation (C)
// FMI 2.0 Co-Simulation (C API)
fmi2Component c = fmi2Instantiate(
"engine", fmi2CoSimulation, guid, "", &funcs, fmi2False, fmi2True);
fmi2SetupExperiment(c, fmi2False, 0.0, 0.0, fmi2True, 10.0);
fmi2EnterInitializationMode(c);
fmi2ExitInitializationMode(c);
for (double t = 0.0; t < 10.0; t += 0.01) {
fmi2SetReal(c, &vrInput, 1, &u);
fmi2DoStep(c, t, 0.01, fmi2True);
fmi2GetReal(c, &vrOutput, 1, &y);
}
fmi2Terminate(c);
fmi2FreeInstance(c);
SSP · SystemStructureDescription.ssd
<!-- SSP System Structure & Parameterization -->
<ssd:SystemStructureDescription version="1.0" name="Vehicle">
<ssd:System name="Powertrain">
<ssd:Elements>
<ssd:Component type="application/x-fmu-sharedlibrary"
source="Motor.fmu" name="motor"/>
<ssd:Component type="application/x-fmu-sharedlibrary"
source="Battery.fmu" name="battery"/>
</ssd:Elements>
<ssd:Connections>
<ssd:Connection startElement="battery" startConnector="v_out"
endElement="motor" endConnector="v_in"/>
</ssd:Connections>
</ssd:System>
</ssd:SystemStructureDescription>
OpenModelica
Community