Releases: SciML/ModelingToolkit.jl
v10.2.0
ModelingToolkit v10.2.0
Merged pull requests:
- fix: handle non-split systems in initial value promotion (#3690) (@AayushSabharwal)
- Fix docstring of
get_p
(#3691) (@baggepinnen) - [v9] fix: fix major compile time regression due to
concrete_getu
(#3692) (@AayushSabharwal) - fix: fix major compile time regression due to
concrete_getu
(#3693) (@AayushSabharwal) - [v9] fix: remove CSE hack, fix unscalarized variables in initializeprobpmap (#3696) (@AayushSabharwal)
- fix: remove CSE hack, fix unscalarized variables in initializeprobpmap (#3697) (@AayushSabharwal)
- [v9] hotfix: fix new implementation of
concrete_getu
(#3698) (@AayushSabharwal) - ci: add benchmark CI (#3700) (@AayushSabharwal)
- fix: fix
get_mtkparameters_reconstructor
handling of nonnumerics (#3702) (@AayushSabharwal) - fix: fix discrete system simplification (#3703) (@AayushSabharwal)
- fix: properly retain defaults in
generate_initializesystem
(#3705) (@AayushSabharwal)
v9.80.5
ModelingToolkit v9.80.5
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
ModelingToolkit 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.3
ModelingToolkit 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.
v10.1.0
ModelingToolkit v10.1.0
Merged pull requests:
- refactor AP transform into exported API (#3665) (@baggepinnen)
- fix: fix type promotion in
late_binding_update_u0_p
with non-dual types (#3674) (@AayushSabharwal) - fix: fix namespacing of
AffectSystem
(#3679) (@AayushSabharwal) - refactor: BLT sort equations and variables in tearing (#3681) (@AayushSabharwal)
- refactor: add depwarns for old system and problem constructors (#3682) (@AayushSabharwal)
- refactor: remove old
==
andhash
implementation forSystem
(#3683) (@AayushSabharwal) - fix: fix linearization, move tests to InterfaceII (#3684) (@AayushSabharwal)
- feat: allow specifying
problem_type
using system metadata (#3685) (@AayushSabharwal) - test: mark appropriate tests as broken (#3688) (@AayushSabharwal)
- chore: bump minor version (#3689) (@AayushSabharwal)
Closed issues:
- Better error message for using old Problem creation notatio (#3680)
v10.0.1
ModelingToolkit v10.0.1
Merged pull requests:
- [backport-v9] fix: fix infinite recursion in
full_equations
(#3672) (@AayushSabharwal) - [backport-v9] fix: fix type promotion in
late_binding_update_u0_p
with non-dual types (#3673) (@AayushSabharwal) - refactor: remove outdated exports (#3677) (@AayushSabharwal)
Closed issues:
- Boundary Value Problem (#924)
v9.80.2
ModelingToolkit 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.0.0
ModelingToolkit v10.0.0
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 affectA ~ A + 1
should now be written asA ~ 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 thediscrete_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 systemJumpSystem(jumps, ...)
to define a system with jumps. Note that normal equations can
also be passed tojumps
.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:
- BREAKING: v10 release (#3563) (@AayushSabharwal)
- refactor: change problem constructors to
XProblem(sys, op[, tspan])
(#3648) (@AayushSabharwal) - refactor: remove dead code (#3651) (@AayushSabharwal)
- refactor: change
metadata
field to be likeBasicSymbolic
(#3652) (@AayushSabharwal) - refactor: remove
FunctionalAffect
(#3653) (@AayushSabharwal) - refactor: remove deprecated
getproperty
behavior, disablesetproperty!
on systems (#3655) (@AayushSabharwal) - refactor: rename
@mtkbuild
to@mtkcompile
andstructural_simplify
tomtkcompile
(#3656) (@AayushSabharwal) - docs: overhaul documentation for v10 (#3658) (@AayushSabharwal)
- refactor: remove
parameter_dependencies
kwarg (#3666) (@AayushSabharwal) - docs: add changelog, update docs (#3670) (@AayushSabharwal)
Closed issues:
v9.80.1
ModelingToolkit v9.80.1
Merged pull requests:
- fix: fix solving out-of-place
split = false
ODEs (#3647) (@AayushSabharwal)
Closed issues:
v9.80.0
ModelingToolkit v9.80.0
Merged pull requests:
- feat: reduce reliance on metadata in
structural_simplify
(#3540) (@AayushSabharwal) - fix: allow specifying type of buffers inside
MTKParameters
(#3585) (@AayushSabharwal) - refactor: make
@constants
createtunable = false
parameters (#3641) (@AayushSabharwal)