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