Julia · ModelingToolkit · SciML

Julia modeling & simulation,
from scripts to canvas

CoModel puts ModelingToolkit.jl equation-based physics modeling on a graphical canvas and solves it in the cloud with the OrdinaryDiffEq solver library: drag from 146+ standard components, connect to form equations, and co-simulate in one click — all of Julia's performance, none of the environment setup.

mtkcompileautomatic symbolic simplification
150+stiff & non-stiff solvers
Zero installruns in your browser

Why Julia for engineering simulation

Traditional simulation tools each have their pain: commercial suites are expensive and hard to extend; general-purpose scripting languages (Python/MATLAB) leave you building your own plumbing for acausal multi-physics modeling — connection, initialization, structural simplification. The Julia ecosystem took a different path: ModelingToolkit.jl (MTK) implements acausal equation-based modeling in pure Julia. You describe physical topology ("voltage = resistance × current", "spring force = stiffness × displacement difference"), the symbolic engine reduces the equation system to solvable form, and OrdinaryDiffEq.jl from SciML integrates it — one language from modeling to solving, no glue, no IPC, no export-import.

That translates into three practical benefits:

  • C-performance solve loops — Julia JIT-compiles the solver loop with no interpreter overhead; MTK's mtkcompile eliminates algebraic loops and redundant variables before compilation, which is effectively a free round of model-order reduction.
  • Composable and introspectable — a component is a System object returned by an ordinary Julia function; its ports, parameters and equations are readable via reflection. That is exactly why CoModel can take an uploaded .jl file and auto-detect its ports and parameters.
  • AI and physics in one language — SciML stands for scientific machine learning: neural networks (Lux/Flux), ONNX inference and physics equations can be solved jointly inside a single System, instead of "export CSV from the simulator, read it back in the training script".
Analogy: ModelingToolkit is to Julia what Modelica is to industrial simulation — the same acausal equation-based paradigm, but MTK shares a language with its solvers, is programmable and embeddable, and the entire toolchain is open source.

What separates a Julia script from a team platform

Scripting ModelingToolkit directly is perfectly viable — until the model needs review, the parameters need sweeping, and the results need reporting. That's the checklist you'd eventually build yourself; CoModel ships it as the product:

Roll your ownBuilt into CoModel
Hand-drawn Plots.jl figures, exported one by oneInteractive time-domain plots and curve-family comparison; one-click CSV / PNG / SVG export
Change one parameter → rerun the whole script (recompiles)Resident solver workers reuse compiled results — parameter iteration returns in seconds
Sweeps via for loops and hand-collected resultsParameter sweeps and sensitivity analysis configured in the UI, results tabulated automatically
Models are .jl files synced by Git and verbal agreementCloud model library with version history and link sharing — reproduction is one URL
FMU support means adapting FMI.jl yourselfDrop an FMU onto the canvas; ports and parameters parsed automatically (FMI 2.0 / 3.0, CS / ME)
Teammates install Julia, configure environments, pull dependenciesRuns in the browser; the local deployment installer bundles every runtime

In short: the Julia engine makes it compute fast; CoModel makes the full loop — model, validate, solve, analyze, collaborate — a no-glue-code daily workflow.

What a component looks like: runnable MTK code

CoModel components are standard ModelingToolkit v11 code defined with @component function, returning a System object. Here is a complete spring-mass-damper — you can write this in the platform's built-in editor or upload it as a .jl file:

using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
using ModelingToolkitStandardLibrary.Mechanical.Translational:
    Mass, Spring, Damper, Fixed, MechanicalPort

@component function MySpringMassDamper(; name, m = 10.0, k = 1500.0, d = 50.0)
    @named mass   = Mass(m = m)
    @named spring = Spring(k = k)
    @named damper = Damper(d = d)
    @named fixed  = Fixed()
    @named flange = MechanicalPort()
    pars = @parameters begin
        m = m, [description = "mass"]
        k = k, [description = "stiffness"]
        d = d, [description = "damping"]
    end
    eqs = [
        connect(flange, mass.flange, spring.flange_a, damper.flange_a)
        connect(spring.flange_b, damper.flange_b, fixed.flange)
    ]
    return System(eqs, t, [], pars; name, systems=[flange, mass, spring, damper, fixed])
end

After upload, the platform's two-stage parsing — an AST scan followed by MTK reflection in a real Julia process — extracts the port (flange) and parameters (m / k / d), generates the parameter panel and icon anchors, and the component becomes draggable and connectable like any standard one. More patterns (electrical OnePort + extend, components with thermal ports) in Julia Component Code Conventions.

The stack: what MTK does under the hood

One simulation request in CoModel runs through a pure Julia scientific-computing pipeline:

01Modeling layer

The canvas / text editor produces MTK Systems: standard-library components, custom @components, FMU black boxes and ONNX networks unified into one homogeneous equation system.

02Simplification layer

mtkcompile performs structural simplification: eliminating algebraic loops, selecting state variables, generating efficient ODE/DAE expressions.

03Solver layer

OrdinaryDiffEq picks stiff or non-stiff automatically (Rodas5P, QNDF, FBDF…); resident worker processes reuse compiled artifacts so parameter iterations return in seconds.

On top of that, the platform adds the engineering layer: model validation with IDE-grade diagnostics, initialization failure root-cause hints (e.g. overdetermined InitialFailure systems), graphics↔code two-way sync, and FMI 2.0/3.0 black-box scheduling.

Multi-domain component library

146+ built-in components across electrical, mechanical (translational/rotational), thermal, hydraulic and magnetic domains, based on ModelingToolkitStandardLibrary — freely coupled across domains.

ElectricalMechanicalThermalHydraulicMagnetic

FMU / FMI co-simulation

FMUs exported from mainstream tools (Simulink, Amesim, Dymola…) drop straight onto the canvas; ports and parameters are extracted automatically and solved alongside native MTK components.

FMI 2.0 / 3.0CS / ME

ONNX AI hybrid modeling

Upload trained networks as ONNX and they become connectable components; black-box derivatives fall back to finite differences automatically and co-solve with physics equations on the same canvas.

ONNXSurrogate modelsResidual learning

Graphics ↔ code sync

The canvas and Julia code convert in real time: drag a component and connect statements appear; edit the code and the canvas updates. Syntax diagnostics inline.

Two-way syncIDE diagnostics

ModelingToolkit and Modelica — how do they relate?

Both are acausal, equation-based modeling paradigms: you write physical constraint relations instead of assignment flow, and the compiler determines computation direction during simplification — which is what makes bidirectional physical ports natural. They differ in ecosystem: Modelica is the industrial standard language with mostly commercial tooling (Dymola, SimulationX…); ModelingToolkit.jl is Julia-native, integrates seamlessly with DifferentialEquations.jl / SciML solvers, and the whole toolchain is open source, programmable and embeddable in your own services. CoModel's role is to add the "last mile" on top of MTK: graphical modeling, cloud solving, component reuse and collaboration.

If you're evaluating Julia-based simulation, the fastest test is your real model — sign up free for a 90-day license, or grab the all-in-one installer (every Julia runtime bundled, works offline) from the download page.

Julia's performance, minus the modeling busywork

Sign up for a 90-day free license and run your first model within ten minutes.