File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,6 @@ macro derivatives(x...)
79
79
esc (_differential_macro (x))
80
80
end
81
81
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]
84
84
end
Original file line number Diff line number Diff line change @@ -62,7 +62,10 @@ function calculate_jacobian(sys::ODESystem)
62
62
isempty (sys. jac[]) || return sys. jac[] # use cached Jacobian, if possible
63
63
rhs = [eq. rhs for eq ∈ sys. eqs]
64
64
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))
66
69
sys. jac[] = jac # cache Jacobian
67
70
return jac
68
71
end
You can’t perform that action at this time.
0 commit comments