Skip to content

Commit 6db9402

Browse files
authored
Merge pull request #2158 from SciML/myb/dep
Fix the deprecation warning
2 parents 2b6ddd0 + 8228c1f commit 6db9402

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/src/basics/Linearization.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ The operating point to linearize around can be specified with the keyword argume
5050
If linearization is to be performed around multiple operating points, the simplification of the system has to be carried out a single time only. To facilitate this, the lower-level function [`ModelingToolkit.linearization_function`](@ref) is available. This function further allows you to obtain separate Jacobians for the differential and algebraic parts of the model. For ODE models without algebraic equations, the statespace representation above is available from the output of `linearization_function` as `A, B, C, D = f_x, f_u, h_x, h_u`.
5151

5252
## Symbolic linearization
53+
5354
The function [`ModelingToolkit.linearize_symbolic`](@ref) works simiar to [`ModelingToolkit.linearize`](@ref) but returns symbolic rather than numeric Jacobians. Symbolic linearization have several limitations and no all systems that can be linearized numerically can be linearized symbolically.
5455

5556
## Input derivatives

src/systems/connectors.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,15 @@ end
169169

170170
"Return true if the system is a 3D multibody frame, otherwise return false."
171171
function isframe(sys)
172-
sys.metadata isa Dict || return false
173-
get(sys.metadata, :frame, false)
172+
(has_metadata(sys) && (md = get_metadata(sys)) isa Dict) || return false
173+
get(md, :frame, false)
174174
end
175175

176176
"Return orienation object of a multibody frame."
177177
function ori(sys)
178-
if sys.metadata isa Dict && (O = get(sys.metadata, :orientation, nothing)) !== nothing
178+
@assert has_metadata(sys)
179+
md = get_metadata(sys)
180+
if md isa Dict && (O = get(md, :orientation, nothing)) !== nothing
179181
return O
180182
else
181183
error("System $(sys.name) does not have an orientation object.")

0 commit comments

Comments
 (0)