Skip to content

10.31.1 has issues with variable and equation counts #4048

@mx-p9a

Description

@mx-p9a

Describe the bug 🐞

I am seeing errors on 10.31.1 (but not on 10.31.0) like ExtraEquationsSystemException: The system is unbalanced. There are 85 highest order derivative variables and 91 equations..

I can't share that code, so instead I ran on the Standard library and am also seeing errors there:

Expected behavior

Standard library's test to pass.

Minimal Reproducible Example 👇

@v1.12) pkg> test ModelingToolkitStandardLibrary

Error & Stacktrace ⚠️

Test Summary:                                | Pass  Fail  Error  Broken  Total      Time
Core                                         |  524     2      9       1    536  12m11.9s
  Blocks: utils                              |   12            1             13     19.7s
    Array Guesses                            |    2                           2      1.9s
    Scalarized Guesses                       |    4                           4      0.6s
    SISO Check                               |                 1              1     13.7s
  Blocks: math                               |   93                          93   1m16.3s
  Blocks: nonlinear                          |   15                          15     11.1s
  Blocks: continuous                         |   76                          76   1m03.9s
  Blocks: sources                            |   63                    1     64   2m44.7s
  Blocks: analysis points                    |   60                          60   2m00.6s
  Analog Circuits                            |   99                          99   1m48.1s
  Digital Circuits                           |   34                          34      0.9s
  Chua Circuit Demo                          |    1                           1      5.2s
  Thermal Circuits                           |   12     2      1             15     17.8s
    Heat systems                             |    6                           6      4.4s
    Heat flow system                         |                 1              1      0.8s
    Radiator system                          |    3                           3      2.3s
    Thermal Collector                        |    3                           3      1.7s
    FixedHeatFlow with alpha=0.0 test        |          2                     2      8.7s
  Thermal Demo                               |   10                          10     18.2s
  Magnetic                                   |    3                           3      3.8s
  Mechanical Rotation                        |   19            1             20     36.2s
    two inertias                             |    6                           6     12.6s
    two inertias with driving torque         |    6                           6      9.3s
    first example                            |    1                           1      6.2s
    Stick-Slip                               |    2                           2      4.4s
    sensors                                  |                 1              1      0.2s
    Position                                 |    4                           4      3.2s
  Mechanical Translation                     |   15            1             16     29.4s
    Free                                     |    2                           2      2.5s
    Spring, Damper, Mass, Fixed              |    4                           4     14.0s
    driven spring damper mass                |    4                           4      5.9s
    sources & sensors                        |    5            1              6      7.0s
      Translational                          |    3                           3      4.4s
      TranslationalPosition                  |    2            1              3      2.6s
        PositionSensor & ForceSensor         |    2                           2      2.3s
        AccelerationSensor                   |                 1              1      0.3s
  Mechanical Translation Modelica            |    7                           7      9.1s
  Multi-Domain                               |    2            2              4      4.8s
    DC motor                                 |                 1              1      0.3s
    DC motor with speed sensor               |                 1              1      0.1s
    Electrical Heating Circuit               |    2                           2      4.4s
  Hydraulic IsothermalCompressible           |    3            3              6     42.1s
    Fluid Domain and Tube                    |    2                           2     34.8s
    Valve                                    |    1                           1      4.7s
    DynamicVolume and minimum_volume feature |                 1              1      0.5s
    Actuator System                          |                 1              1      1.4s
    Prevent Negative Pressure                |                 1              1      0.3s

one of the errors:

Got exception outside of a @test
  ExtraVariablesSystemException: The system is unbalanced. There are 104 highest order derivative variables and 103 equations.
  More variables than equations, here are the potential extra variable(s):
  In particular, the unset input(s) are:
   pos₊s₊u(t)
  The rest of potentially unset variable(s) are:
   piston₊mass₊v(t)
   valve₊vSA₊x(t)
   valve₊vBR₊x(t)
   valve₊mass₊s(t)
   valve₊mass₊v(t)
   piston₊x(t)
   piston₊vol_a₊x(t)
   piston₊vol_a₊moving_volume₊x(t)
   piston₊vol_a₊moving_volume₊m(t)
   piston₊vol_b₊x(t)
   piston₊vol_b₊moving_volume₊x(t)
   piston₊vol_b₊moving_volume₊m(t)
   piston₊mass₊s(t)
   pos₊s₊u(t)
   pos₊flange₊f(t)
   snk₊port₊dm(t)
  Note that the process of determining extra variables is a best-effort heuristic. The true extra variables are dependent on the model and may not be in this list.
  Stacktrace:

(Interestingly only ExtraVariablesSystemException, not ExtraEquationsSystemException.

Environment (please complete the following information):

  • Output of versioninfo()
Julia Version 1.12.2
Commit ca9b6662be4 (2025-11-20 16:25 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: macOS (arm64-apple-darwin24.0.0)
  CPU: 12 × Apple M2 Max
  WORD_SIZE: 64
  LLVM: libLLVM-18.1.7 (ORCJIT, apple-m2)
  GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 8 virtual cores)
Environment:
  JULIA_PKG_USE_CLI_GIT = true

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions