Skip to content

update / rethink AbstractSystem API and definitions #3133

@isaacsas

Description

@isaacsas

Current version:

https://docs.sciml.ai/ModelingToolkit/stable/basics/AbstractSystem/

I think it might be helpful to MTK contributors, and downstream libraries building on MTK, to have an official, updated, minimal API for what functions AbstractSystems should support/dispatch, what fields they must have, and if there are type requirements on these fields (hopefully in a non-breaking manner from what was implicitly assumed in the past). https://docs.sciml.ai/ModelingToolkit/stable/basics/AbstractSystem/ is old, and not very comprehensive in what it lists, and really ignores a lot of internal assumptions about which functions should work for all system types.

Without such an official listing, there can sometimes be an implicit assumption that one can write code for AbstractSystems that really only makes sense for ODESystems (and/or a few other system types) via making implicit assumptions about the types of equations(sys) or via calling functions that are really only defined for ODE type systems. We've had several cases recently, for example, where equations(sys) was implicitly assumed to return Equations, which has never been true for either JumpSystems or ReactionSystems (but which both, I think, are consistent with the stated API as it makes no requirements on the types of equations).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions