Skip to content

Commit 1c9e4d8

Browse files
authored
refactor: move get_Jacobian function to HarmonicBalance (#15)
1 parent 02f4c70 commit 1c9e4d8

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

src/utils.jl

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,6 @@ function show_fields(object)
1212
end
1313
end
1414

15-
" Get the Jacobian of a set of equations `eqs` with respect to the variables `vars`. "
16-
function get_Jacobian(eqs::Vector{Num}, vars::Vector{Num})::Matrix{Num}
17-
length(eqs) == length(vars) || error("Jacobians are only defined for square systems!")
18-
M = Matrix{Num}(undef, length(vars), length(vars))
19-
20-
for idx in CartesianIndices(M)
21-
M[idx] = expand_derivatives(d(eqs[idx[1]], vars[idx[2]]))
22-
end
23-
return M
24-
end # should replace with Symbolics.jacobian
25-
26-
function get_Jacobian(eqs::Vector{Equation}, vars::Vector{Num})::Matrix{Num}
27-
expr = Num[getfield(eq, :lhs) - getfield(eq, :rhs) for eq in eqs]
28-
return get_Jacobian(expr, vars)
29-
end
30-
3115
macro eqtest(expr)
3216
@assert expr.head == :call && expr.args[1] in [:(==), :(!=)]
3317
return esc(

0 commit comments

Comments
 (0)