Skip to content

Commit b87bb66

Browse files
Fix calculate_jacobian
1 parent 3a4a11e commit b87bb66

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/differentials.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ macro derivatives(x...)
7979
esc(_differential_macro(x))
8080
end
8181

82-
function calculate_jacobian(eqs, dvs, iv)
83-
Expression[Differential(dv(iv()))(eq) for eq eqs, dv dvs]
82+
function calculate_jacobian(eqs, dvs)
83+
Expression[Differential(dv)(eq) for eq eqs, dv dvs]
8484
end

src/systems/diffeqs/diffeqsystem.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ function calculate_jacobian(sys::ODESystem)
6262
isempty(sys.jac[]) || return sys.jac[] # use cached Jacobian, if possible
6363
rhs = [eq.rhs for eq sys.eqs]
6464

65-
jac = expand_derivatives.(calculate_jacobian(rhs, sys.dvs, sys.iv))
65+
iv = sys.iv()
66+
dvs = [dv(iv) for dv sys.dvs]
67+
68+
jac = expand_derivatives.(calculate_jacobian(rhs, dvs))
6669
sys.jac[] = jac # cache Jacobian
6770
return jac
6871
end

0 commit comments

Comments
 (0)