@ChrisRackauckas You are right, if I remove the tag in here it fails. If I leave it, it fails.
I modified a bit the previous example to make AD fails
using PiecewiseDeterministicMarkovProcesses, Random, DifferentialEquations
const PDMP = PiecewiseDeterministicMarkovProcesses
function F_tcp!(ẋ, xc, xd, parms, t)
if mod(xd[1],2)==0
ẋ[1] = 1.0
ẋ[2] = -1.0 * xc[2]
else
ẋ[1] = -1.0 * xc[1]
ẋ[2] = 1.0
end
nothing
end
R(x) = x
function R_tcp!(rate, xc, xd, parms, t, issum::Bool)
rate[1] = R(xc[1]) + R(xc[2])
rate[2] = parms[1] * xd[1] * xc[1]
if issum == false
return 0.
else
return sum(rate)
end
end
xc0 = [0.05, 0.075]
xd0 = [0, 1]
nu_tcp = [1 0;0 -1]
parms = [0.1]
tf = 10000.0
nj = 1000
Without the tag, it errors as:
julia> result4 = @time PDMP.solve(problem, CHV(Rodas5()))
ERROR: MethodError: no method matching Float64(::ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3})
Closest candidates are:
Float64(::Real, ::RoundingMode) where T<:AbstractFloat at rounding.jl:194
Float64(::T<:Number) where T<:Number at boot.jl:718
Float64(::Int8) at float.jl:60
...
Stacktrace:
[1] convert(::Type{Float64}, ::ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3}) at ./number.jl:7
[2] convert(::Type{ForwardDiff.Dual{nothing,Float64,2}}, ::ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3}) at /Users/rveltz/.julia/packages/ForwardDiff/N0wMF/src/dual.jl:357
[3] setindex!(::Array{ForwardDiff.Dual{nothing,Float64,2},1}, ::ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3}, ::Int64) at ./array.jl:766
[4] R_tcp!(::Array{ForwardDiff.Dual{nothing,Float64,2},1}, ::Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3},1}, ::Array{Int64,1}, ::Array{Float64,1}, ::ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3}, ::Bool) at /Users/rveltz/work/prog_gd/julia/dev/PiecewiseDeterministicMarkovProcesses.jl/examples/tcp2d.jl:18
[5] (::VariableRate{typeof(R_tcp!)})(::Array{ForwardDiff.Dual{nothing,Float64,2},1}, ::Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3},1}, ::Array{Int64,1}, ::Array{Float64,1}, ::ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3}, ::Bool) at /Users/rveltz/work/prog_gd/julia/dev/PiecewiseDeterministicMarkovProcesses.jl/src/rate.jl:13
[6] (::CHV{Rodas5{0,true,DefaultLinSolve,DataType}})(::Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3},1}, ::Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3},1}, ::PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}, ::Float64) at /Users/rveltz/work/prog_gd/julia/dev/PiecewiseDeterministicMarkovProcesses.jl/src/chvdiffeq.jl:16
[7] (::getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}})(::Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3},1}, ::Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3},1}, ::DiffEqBase.NullParameters, ::Float64) at /Users/rveltz/work/prog_gd/julia/dev/PiecewiseDeterministicMarkovProcesses.jl/src/chvdiffeq.jl:118
[8] (::ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing})(::Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3},1}, ::Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3},1}, ::Vararg{Any,N} where N) at /Users/rveltz/.julia/packages/DiffEqBase/V40QH/src/diffeqfunction.jl:230
[9] (::DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters})(::Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3},1}, ::Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3},1}) at /Users/rveltz/.julia/packages/DiffEqDiffTools/qCskj/src/function_wrappers.jl:15
and with the (wrong) tag, it errors like:
julia> result4 = @time PDMP.solve(problem, CHV(Rodas5()))
ERROR: ArgumentError: cannot reinterpret an `ForwardDiff.Dual{nothing,Float64,2}` array to `ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3}` whose first dimension has size `2`.
The resulting array would have non-integral first dimension.
Stacktrace:
[1] (::getfield(Base, Symbol("#thrownonint#204")){ForwardDiff.Dual{nothing,Float64,2},ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3}})(::Type{ForwardDiff.Dual{nothing,Float64,2}}, ::Type{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3}}, ::Int64) at ./reinterpretarray.jl:24
[2] reinterpret at ./reinterpretarray.jl:39 [inlined]
[3] get_rate at /Users/rveltz/work/prog_gd/julia/dev/PiecewiseDeterministicMarkovProcesses.jl/src/utilsforwarddiff.jl:17 [inlined]
[4] (::CHV{Rodas5{0,true,DefaultLinSolve,DataType}})(::Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3},1}, ::Array{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqDiffTools.UJacobianWrapper{ODEFunction{true,getfield(PiecewiseDeterministicMarkovProcesses, Symbol("##34#37")){CHV{Rodas5{0,true,DefaultLinSolve,DataType}},PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}},LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing},Float64,DiffEqBase.NullParameters},Float64},Float64,3},1}, ::PiecewiseDeterministicMarkovProcesses.PDMPCaracteristics{typeof(F_tcp!),VariableRate{typeof(R_tcp!)},PiecewiseDeterministicMarkovProcesses.Jump{Int64,Array{Int64,2},typeof(PiecewiseDeterministicMarkovProcesses.Delta_dummy)},Array{Float64,1},Array{Int64,1},PiecewiseDeterministicMarkovProcesses.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,2},1}},Array{Float64,1}}, ::Float64) at /Users/rveltz/work/prog_gd/julia/dev/PiecewiseDeterministicMarkovProcesses.jl/src/chvdiffeq.jl:15
[5] #34 at /Users/rveltz/work/prog_gd/julia/dev/PiecewiseDeterministicMarkovProcesses.jl/src/chvdiffeq.jl:118 [inlined]
[6] ODEFunction at /Users/rveltz/.julia/packages/DiffEqBase/V40QH/src/diffeqfunction.jl:230 [inlined]
[7] UJacobianWrapper at /Users/rveltz/.julia/packages/DiffEqDiffTools/qCskj/src/function_wrappers.jl:15 [inlined]
I thought I had solved this issue but it seems I did not. If anyone knows how to make this work with ForwardDiff
, it would be very helpful to me.
Thank you