ForwardDiff.jacobian Method error

residual = zeros(length(cvec)) 

creates an array of Float64 which is not Dual type. create the vector as zeros(eltype(cvec), length(cvec))

1 Like