|
1 |
| -# ModelingToolkit v8 Release Notes |
| 1 | +# ModelingToolkit v9 Release Notes |
2 | 2 |
|
3 | 3 | ### Upgrade guide
|
4 | 4 |
|
5 |
| - - `connect` should not be overloaded by users anymore. `[connect = Flow]` |
6 |
| - informs ModelingToolkit that particular variable in a connector ought to sum |
7 |
| - to zero, and by default, variables are equal in a connection. Please check out |
8 |
| - [acausal components tutorial](https://docs.sciml.ai/ModelingToolkit/stable/tutorials/acausal_components/) |
9 |
| - for examples. |
| 5 | +- The function `states` is renamed to `unknowns`. In a similar vein: |
| 6 | + - `unknown_states` is now `solved_unknowns`. |
| 7 | + - `get_states` is `get_unknowns`. |
| 8 | + - `get_unknown_states` is now `get_solved_unknowns`. |
| 9 | +- The default backend for using units in models is now `DynamicQuantities.jl` instead of |
| 10 | + `Unitful.jl`. |
| 11 | +- ModelingToolkit.jl now exports common definitions of `t` (time independent variable) |
| 12 | + and `D` (the first derivative with respect to `t`). Any models made using ModelingToolkit.jl |
| 13 | + should leverage these common definitions. There are three variants: |
| 14 | + - `t` and `D` use DynamicQuantities.jl units. This is the default for standard library |
| 15 | + components. |
| 16 | + - `t_unitful` and `D_unitful` use Unitful.jl units. |
| 17 | + - `t_nounits` and `D_nounits` are unitless. |
| 18 | +- `ODAEProblem` is deprecated in favor of `ODEProblem`. |
| 19 | +- Specifying the independent variable for an `ODESystem` is now mandatory. The `ODESystem(eqs)` |
| 20 | + constructor is removed. |
| 21 | +- Systems must be marked as `complete` before creating `*Function`/`*FunctionExpr`/`*Problem`/ |
| 22 | + `*ProblemExpr`. Typically this involved using `@mtkbuild` to create the system or calling |
| 23 | + `structural_simplify` on an existing system. |
| 24 | +- All systems will perform parameter splitting by default. Problems created using ModelingToolkit.jl |
| 25 | + systems will have a custom struct instead of a `Vector` of parameters. The internals of this |
| 26 | + type are undocumented and subject to change without notice or a breaking release. Parameter values |
| 27 | + can be queried, updated or manipulated using SciMLStructures.jl or SymbolicIndexingInterface.jl. |
| 28 | + This also requires that the symbolic type of a parameter match its assigned value. For example, |
| 29 | + `@parameters p` will always use a `Float64` value for `p`. To use `Int` instead, use |
| 30 | + `@parameters p::Int`. Array-valued parameters must be array symbolics; `@parameters p = [1.0, 2.0]` |
| 31 | + is now invalid and must be changed to `@parameters p[1:2] = [1.0, 2.0]`. The index of a parameter |
| 32 | + in the system is also not guaranteed to be an `Int`, and will instead be a custom undocumented type. |
| 33 | + To restore the old behavior: |
| 34 | + - Pass the `split = false` keyword to `structural_simplify`. E.g. `ss = structural_simplify(sys; split = false)`. |
| 35 | + - Pass `split = false` to `@mtkbuild`. E.g. `@mtkbuild sys = ODESystem(...) split = false`. |
| 36 | +- Discrete-time system using `Difference` are unsupported. Instead, use the new `Clock`-based syntax. |
| 37 | +- Automatic scalarization has been removed, meaning that vector variables need to be treated with proper vector |
| 38 | + equations. For example, `[p[1] => 1.0, p[2] => 2.0]` is no longer allowed in default equations, use |
| 39 | + `[p => [1.0, 2.0]]` instead. Also, array equations like for `@variables u[1:2]` have `D(u) ~ A*u` as an |
| 40 | + array equation. If the scalarized version is desired, use `scalarize(u)`. |
0 commit comments