Skip to content

Releases: SciML/ModelingToolkit.jl

v10.2.0

07 Jun 18:57
fdbf149
Compare
Choose a tag to compare

ModelingToolkit v10.2.0

Diff since v10.1.0

Merged pull requests:

v9.80.5

06 Jun 11:24
897524e
Compare
Choose a tag to compare

ModelingToolkit v9.80.5

Diff since v9.80.4

This release has been identified as a backport.
Automated changelogs for backports tend to be wildly incorrect.
Therefore, the list of issues and pull requests is hidden.

v9.80.4

05 Jun 13:37
263c870
Compare
Choose a tag to compare

ModelingToolkit v9.80.4

Diff since v9.80.3

This release has been identified as a backport.
Automated changelogs for backports tend to be wildly incorrect.
Therefore, the list of issues and pull requests is hidden.

v9.80.3

05 Jun 06:37
7fc7a41
Compare
Choose a tag to compare

ModelingToolkit v9.80.3

Diff since v9.80.2

This release has been identified as a backport.
Automated changelogs for backports tend to be wildly incorrect.
Therefore, the list of issues and pull requests is hidden.

v10.1.0

04 Jun 06:23
847c41f
Compare
Choose a tag to compare

ModelingToolkit v10.1.0

Diff since v10.0.1

Merged pull requests:

Closed issues:

  • Better error message for using old Problem creation notatio (#3680)

v10.0.1

30 May 08:16
77f85ea
Compare
Choose a tag to compare

ModelingToolkit v10.0.1

Diff since v10.0.0

Merged pull requests:

Closed issues:

  • Boundary Value Problem (#924)

v9.80.2

30 May 08:10
62b0b66
Compare
Choose a tag to compare

ModelingToolkit v9.80.2

Diff since v9.80.1

This release has been identified as a backport.
Automated changelogs for backports tend to be wildly incorrect.
Therefore, the list of issues and pull requests is hidden.

v10.0.0

29 May 11:32
2035e73
Compare
Choose a tag to compare

ModelingToolkit v10.0.0

Diff since v9.80.1

There are several breaking changes with this release.

Callbacks

Callback semantics have changed.

  • There is a new Pre operator that is used to specify which values are before the callback.
    For example, the affect A ~ A + 1 should now be written as A ~ Pre(A) + 1. This is
    required to be specified - A ~ A + 1 will now be interpreted as an equation to be
    satisfied after the callback (and will thus error since it is unsatisfiable).

  • All parameters that are changed by a callback must be declared as discrete parameters to
    the callback constructor, using the discrete_parameters keyword argument.

event = SymbolicDiscreteCallback(
    [t == 1] => [p ~ Pre(p) + 1], discrete_parameters = [p])

New mtkcompile and @mtkcompile

structural_simplify is now renamed to mtkcompile. @mtkbuild is renamed to
@mtkcompile. Their functionality remains the same. However, instead of a second
positional argument structural_simplify(sys, (inputs, outputs)) the inputs and outputs
should be specified via keyword arguments as mtkcompile(sys; inputs, outputs, disturbance_inputs).

Reduce reliance on metadata in mtkcompile

Previously, mtkcompile (formerly structural_simplify) used to rely on the metadata of
symbolic variables to identify variables/parameters/brownians. This was regardless of
what the system expected the variable to be. Now, it respects the information in the system.

Unified System type

There is now a single common System type for all types of models except PDEs, for which
PDESystem still exists. It follows the same syntax as ODESystem and NonlinearSystem
did. System(equations, t[, vars, pars]) will construct a time-dependent system.
System(equations[, vars, pars]) will construct a time-independent system. Refer to the
docstring for System for further information.

Utility constructors are defined for:

  • NonlinearSystem(sys) to convert a time-dependent system to a time-independent one for
    its steady state.
  • SDESystem(sys, noise_eqs) to add noise to a system
  • JumpSystem(jumps, ...) to define a system with jumps. Note that normal equations can
    also be passed to jumps.
  • OptimizationSystem(cost, ...) to define a system for optimization.

All problem constructors validate that the system matches the expected structure for
that problem.

No more parameter_dependencies

The parameter_dependencies keyword is deprecated. All equations previously passed here
should now be provided as part of the standard equations of the system. If passing parameters
explicitly to the System constructor, the dependent parameters (on the left hand side of
parameter dependencies) should also be provided. These will be separated out when calling
complete or mtkcompile. Calling parameter_dependencies or dependent_parameters now
requires that the system is completed. The new SDESystem constructor still retains the
parameter_dependencies keyword argument since the number of equations has to match the
number of columns in noise_eqs.

ModelingToolkit now has discretion of what parameters are eliminated using the parameter
equations during complete or mtkcompile.

New problem and constructors

Instead of XProblem(sys, u0map, tspan, pmap) for time-dependent problems and
XProblem(sys, u0map, pmap) for time-independent problems, the syntax has changed to
XProblem(sys, op, tspan) and XProblem(sys, op) respectively. op refers to the
operating point, and is a variable-value mapping containing both unknowns and parameters.

XFunction constructors also no longer accept the list of unknowns and parameters as
positional arguments.

Removed DelayParentScope

The outdated DelayParentScope has been removed.

Removed XProblemExpr and XFunctionExpr

The old XProblemExpr and XFunctionExpr constructors used to build an Expr that
constructs XProblem and XFunction respectively are now removed. This functionality
is now available by passing expression = Val{true} to any problem or function constructor.

Renaming of generate_* and calculate_* methods

Several generate_* methods have been renamed, along with some calculate_* methods.
The generate_* methods also no longer accept a list of unknowns and/or parameters. Refer
to the documentation for more information.

New behavior of getproperty and setproperty!

Using getproperty to access fields of a system has been deprecated for a long time, and
this functionality is now removed. setproperty! previously used to update the default
of the accessed symbolic variable. This is not supported anymore. Defaults can be updated by
mutating ModelingToolkit.get_defaults(sys).

New behavior of @constants

@constants now creates parameters with the tunable = false metadata by default.

Removed FunctionalAffect

FunctionalAffect is now removed in favor of the new ImperativeAffect. Refer to the
documentation for more information.

Improved system metadata

Instead of an empty field that can contain arbitrary data, the System type stores metadata
identically to SymbolicUtils.BasicSymbolic. Metadata is stored in an immutable dictionary
keyed by a user-provided DataType and containing arbitrary values. System supports the
same SymbolicUtils.getmetadata and SymbolicUtils.setmetadata API as symbolic variables.
Refer to the documentation of System and the aforementioned functions for more information.

Moved connect and Connector to ModelingToolkit

Previously ModelingToolkit used the connect function and Connector type defined in
Symbolics.jl. These have now been moved to ModelingToolkit along with the experimental
state machine API. If you imported them from Symbolics.jl, it is recommended to import from
ModelingToolkit instead.

Always wrap with ParentScope in @named

When creating a system using @named, any symbolic quantities passed as keyword arguments
to the subsystem are wrapped in ParentScope. Previously, this would only happen if the
variable wasn't already wrapped in a ParentScope. However, the old behavior had issues
when passing symbolic quantities down multiple levels of the hierarchy. The @named macro
now always performs this wrapping.

Merged pull requests:

Closed issues:

  • BVProblem Interface Summary (#3378)
  • LinearAlgebra.norm {sum?} fails after 9.72.0 with vectors (#3662)

v9.80.1

21 May 13:05
250e7be
Compare
Choose a tag to compare

ModelingToolkit v9.80.1

Diff since v9.80.0

Merged pull requests:

Closed issues:

  • Passing Initials as parameters does not work consistently (#3645)
  • Out of place split=false with static arrays regression on solve (#3646)

v9.80.0

21 May 10:38
a6fa1cc
Compare
Choose a tag to compare

ModelingToolkit v9.80.0

Diff since v9.79.1

Merged pull requests: