@@ -8,7 +8,6 @@ function SciMLBase.__solve(prob::FODEProblem, alg::FdeSolverPECE; dt = 0.0, abst
8
8
(; f, order, tspan, u0, p) = prob
9
9
10
10
iip = isinplace (prob)
11
-
12
11
tSpan = [first (tspan), last (tspan)]
13
12
# FdeSolver only supports out-of-place computing
14
13
newf = if iip
@@ -22,9 +21,26 @@ function SciMLBase.__solve(prob::FODEProblem, alg::FdeSolverPECE; dt = 0.0, abst
22
21
return f .(y, par, t)
23
22
end
24
23
end
24
+
25
+ jacob_f = if ! isnothing (prob. f. jac)
26
+ if iip
27
+ function (t, y, par)
28
+ J = similar (y, length (y), length (y))
29
+ prob. f. jac (J, u, par, t)
30
+ return J
31
+ end
32
+ else
33
+ function (t, y, par)
34
+ prob. f. jac (y, par, t)
35
+ end
36
+ end
37
+ else
38
+ nothing
39
+ end
40
+
25
41
par = p isa SciMLBase. NullParameters ? nothing : p
26
42
length (u0) == 1 && (u0 = first (u0))
27
- t, y = FDEsolver (newf, tSpan, u0, order, par, JF = prob . f . jac , h = dt, tol = abstol)
43
+ t, y = FDEsolver (newf, tSpan, u0, order, par, JF = jacob_f , h = dt, tol = abstol)
28
44
u = collect (Vector{eltype (y)}, eachrow (y))
29
45
30
46
return DiffEqBase. build_solution (prob, alg, t, u)
0 commit comments