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