Hello all,
This conversation is in continuation with the conversation I had here. I wanted to find the partial double and mixed derivatives of the variables c1,c2 and c3 with respect to the two variables theta and psi. The first order partial derivatives are working fine ForwardDiff.gradient
or ForwardDiff.jacobian
, but when I go for the ForwardDiff.hessian
, I get a method error.
Below are the concerned functions:
function solve_nlprob3(thetapsi)
th,psi = thetapsi
l = 130; br = 35; bh = 18; h1 = 15; h2 = 15; br2 = br+90;
initial_guess = [1.2566177521594696e-17; -0.48551812229559066; 0.485518122295591; -8.31462337379587e-17; -0.48551812229559155; 0.48551812229559127; -7.057740674050417e-17; -8.25000618620076e-18; -0.48551812229559127; 0.48551812229559116; 1.6511444484620922e-16; 2.3617612560724356e-17; 2.4619468236701963e-14; 7.329577692678121e-14; 170.664991614216]
p = [th.value,psi.value,l,br,bh,h1,h2,br2]
prob = NonlinearLeastSquaresProblem(NonlinearFunction(objective2, resid_prototype = zeros(24)), initial_guess,p)
resu = solve(prob,reltol = 1e-12, abstol = 1e-12);
pose2 = posematrix(th.value,psi.value,resu.u[1],resu.u[13],resu.u[14],resu.u[15],bh)
phi,th21,th31,th41,th22,th32,th42,th52,th23,th33,th43,th53,px,py,pz=resu.u;
PX,PY,PZ = pose2[1,4],pose2[2,4],pose2[3,4]
c1length_analytical=(((-1).*PZ+(-1).*br2.*cos(psi).*sin(th)).^2+((-1).*PX+(-1).*br2.*((-1).*cos(th).*sin(phi)+cos(phi).*sin(psi).*sin(th))).^2+(br2+(-1).*PY+(-1).*br2.*(cos(phi).*cos(th)+sin(phi).*sin(psi).*sin(th))).^2).^(1/2)
c2length_analytical = (((-1).*PZ+(-1/2).*3 .^(1/2).*br2.*sin(psi)+(1/2).*br2.*cos(psi).*sin(th)).^2+((-1/2).*3 .^(1/2).*br2+(-1).*PX+(1/2).*3 .^(1/2).*br2.*cos(phi).*cos(psi)+(1/2).*br2.*((-1).*cos(th).*sin(phi)+cos(phi).*sin(psi).*sin(th))).^2+((-1/2).*br2+(-1).*PY+(1/2).*3 .^(1/2).*br2.*cos(psi).*sin(phi)+(1/2).*br2.*(cos(phi).*cos(th)+sin(phi).*sin(psi).*sin(th))).^2).^(1/2)
c3length_analytical = (((-1).*PZ+(1/2).*3 .^(1/2).*br2.*sin(psi)+(1/2).*br2.*cos(psi).*sin(th)).^2+((1/2).*3 .^(1/2).*br2+(-1).*PX+(-1/2).*3 .^(1/2).*br2.*cos(phi).*cos(psi)+(1/2).*br2.*((-1).*cos(th).*sin(phi)+cos(phi).*sin(psi).*sin(th))).^2+((-1/2).*br2+(-1).*PY+(-1/2).*3 .^(1/2).*br2.*cos(psi).*sin(phi)+(1/2).*br2.*(cos(phi).*cos(th)+sin(phi).*sin(psi).*sin(th))).^2).^(1/2)
#return [c1length_analytical, c2length_analytical, c3length_analytical]
return c1length_analytical
end
gradient_result = ForwardDiff.hessian(solve_nlprob3, [0.0, 0.0])
I am not reproducing the ‘objective2’ function here, as it is too large. However, the general structure is:
function objective2(F,params,p)
th,psi,l,br,bh,h1,h2,br2 = p
phi,th21,th31,th41,th22,th32,th42,th52,th23,th33,th43,th53,px,py,pz = params
F[1] = (h1+l.*cos(th21)+h2.*cos(th21+th31)).^(-1).*cos(th41).*(pz+(-1).*bh.*cos(psi).*cos(th)+(-1).*br.*cos(psi).*sin(th))+(-1).*cos(th21+th31).*(h1+l.*cos(th21)+h2.*cos(th21+th31)).^(-1).*(px+(-1).*bh.*(cos(phi).*cos(th).*sin(psi)+sin(phi).*sin(th))+(-1).*br.*((-1).*cos(th).*sin(phi)+cos(phi).*sin(psi).*sin(th))).*sin(th41) - ( (1/2).*3 .^(1/2).*((1/2).*3 .^(1/2).*(cos(th22+th32).*cos(th52)+sin(th22+th32).*sin(th42).*sin(th52))+(1/2).*((-1).*(h1+l.*cos(th22)).^(-1).*cos(th52).*((-1/2).*px+(1/2).*3 .^(1/2).*py+(1/2).*3 .^(1/2).*br.*((-1/2).*cos(phi).*cos(psi)+(1/2).*3 .^(1/2).*cos(psi).*sin(phi))+((-1).*bh+(-1).*h2).*((1/2).*3 .^(1/2).*(cos(th).*sin(phi).*sin(psi)+(-1).*cos(phi).*sin(th))+(1/2).*((-1).*cos(phi).*cos(th).*sin(psi)+(-1).*sin(phi).*sin(th)))+(1/2).*br.*((1/2).*(cos(th).*sin(phi)+(-1).*cos(phi).*sin(psi).*sin(th))+(1/2).*3 .^(1/2).*(cos(phi).*cos(th)+sin(phi).*sin(psi).*sin(th)))).*sin(th22+th32)+((-1).*(h1+l.*cos(th22)).^(-1).*cos(th42).*(pz+((-1).*bh+(-1).*h2).*cos(psi).*cos(th)+(-1/2).*3 .^(1/2).*br.*sin(psi)+(1/2).*br.*cos(psi).*sin(th))+(h1+l.*cos(th22)).^(-1).*cos(th22+th32).*((-1/2).*px+(1/2).*3 .^(1/2).*py+(1/2).*3 .^(1/2).*br.*((-1/2).*cos(phi).*cos(psi)+(1/2).*3 .^(1/2).*cos(psi).*sin(phi))+((-1).*bh+(-1).*h2).*((1/2).*3 .^(1/2).*(cos(th).*sin(phi).*sin(psi)+(-1).*cos(phi).*sin(th))+(1/2).*((-1).*cos(phi).*cos(th).*sin(psi)+(-1).*sin(phi).*sin(th)))+(1/2).*br.*((1/2).*(cos(th).*sin(phi)+(-1).*cos(phi).*sin(psi).*sin(th))+(1/2).*3 .^(1/2).*(cos(phi).*cos(th)+sin(phi).*sin(psi).*sin(th)))).*sin(th42)).*sin(th52)))+(1/2).*((1/2).*3 .^(1/2).*((-1).*cos(th52).*sin(th22+th32).*sin(th42)+cos(th22+th32).*sin(th52))+(1/2).*((h1+l.*cos(th22)).^(-1).*cos(th42).*cos(th52).*(pz+((-1).*bh+(-1).*h2).*cos(psi).*cos(th)+(-1/2).*3 .^(1/2).*br.*sin(psi)+(1/2).*br.*cos(psi).*sin(th))+(-1).*(h1+l.*cos(th22)).^(-1).*((-1/2).*px+(1/2).*3 .^(1/2).*py+(1/2).*3 .^(1/2).*br.*((-1/2).*cos(phi).*cos(psi)+(1/2).*3 .^(1/2).*cos(psi).*sin(phi))+((-1).*bh+(-1).*h2).*((1/2).*3 .^(1/2).*(cos(th).*sin(phi).*sin(psi)+(-1).*cos(phi).*sin(th))+(1/2).*((-1).*cos(phi).*cos(th).*sin(psi)+(-1).*sin(phi).*sin(th)))+(1/2).*br.*((1/2).*(cos(th).*sin(phi)+(-1).*cos(phi).*sin(psi).*sin(th))+(1/2).*3 .^(1/2).*(cos(phi).*cos(th)+sin(phi).*sin(psi).*sin(th)))).*(sin(th22).*((-1).*cos(th52).*sin(th32).*sin(th42)+cos(th32).*sin(th52))+cos(th22).*(cos(th32).*cos(th52).*sin(th42)+sin(th32).*sin(th52))))))
.......
F[24] = ......
return F
end
The error is:
MethodError: no method matching Float64(::ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2})
Closest candidates are:
(::Type{T})(::Real, ::RoundingMode) where T<:AbstractFloat
@ Base rounding.jl:207
(::Type{T})(::T) where T<:Number
@ Core boot.jl:792
(::Type{T})(::AbstractChar) where T<:Union{AbstractChar, Number}
@ Base char.jl:50
...
Stacktrace:
[1] convert(#unused#::Type{Float64}, x::ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2})
@ Base .\number.jl:7
[2] setindex!(A::Vector{Float64}, x::ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}, i1::Int64)
@ Base .\array.jl:969
[3] objective2(F::Vector{Float64}, params::Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, p::Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}})
@ Main .\In[93]:71
[4] (::NonlinearFunction{true, SciMLBase.FullSpecialize, typeof(objective2), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, SymbolicIndexingInterface.SymbolCache{Nothing, Nothing, Nothing}, Vector{Float64}})(::Vector{Float64}, ::Vararg{Any})
@ SciMLBase C:\Users\user\.julia\packages\SciMLBase\2HZ5m\src\scimlfunctions.jl:2356
[5] evaluate_f(prob::NonlinearLeastSquaresProblem{Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, true, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, NonlinearFunction{true, SciMLBase.FullSpecialize, typeof(objective2), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, SymbolicIndexingInterface.SymbolCache{Nothing, Nothing, Nothing}, Vector{Float64}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, u::Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}})
@ NonlinearSolve C:\Users\user\.julia\packages\NonlinearSolve\KlGj2\src\utils.jl:151
[6] __init(::NonlinearLeastSquaresProblem{Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, true, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, NonlinearFunction{true, SciMLBase.FullSpecialize, typeof(objective2), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, SymbolicIndexingInterface.SymbolCache{Nothing, Nothing, Nothing}, Vector{Float64}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, ::GaussNewton{nothing, Nothing, Nothing, typeof(NonlinearSolve.DEFAULT_PRECS), LineSearch{Nothing, Nothing, Bool}, Nothing}; alias_u0::Bool, maxiters::Int64, abstol::Float64, reltol::Float64, termination_condition::Nothing, internalnorm::typeof(DiffEqBase.NONLINEARSOLVE_DEFAULT_NORM), kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol, Symbol}, NamedTuple{(:default_set, :second_time), Tuple{Bool, Bool}}})
@ NonlinearSolve C:\Users\user\.julia\packages\NonlinearSolve\KlGj2\src\gaussnewton.jl:94
[7] init_call(_prob::NonlinearLeastSquaresProblem{Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, true, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, NonlinearFunction{true, SciMLBase.FullSpecialize, typeof(objective2), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, SymbolicIndexingInterface.SymbolCache{Nothing, Nothing, Nothing}, Vector{Float64}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, args::GaussNewton{nothing, Nothing, Nothing, typeof(NonlinearSolve.DEFAULT_PRECS), LineSearch{Nothing, Nothing, Bool}, Nothing}; merge_callbacks::Bool, kwargshandle::Nothing, kwargs::Base.Pairs{Symbol, Real, NTuple{4, Symbol}, NamedTuple{(:default_set, :second_time, :reltol, :abstol), Tuple{Bool, Bool, Float64, Float64}}})
@ DiffEqBase C:\Users\user\.julia\packages\DiffEqBase\eTCPy\src\solve.jl:528
[8] init_up(prob::NonlinearLeastSquaresProblem{Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, true, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, NonlinearFunction{true, SciMLBase.FullSpecialize, typeof(objective2), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, SymbolicIndexingInterface.SymbolCache{Nothing, Nothing, Nothing}, Vector{Float64}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, sensealg::Nothing, u0::Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, p::Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, args::GaussNewton{nothing, Nothing, Nothing, typeof(NonlinearSolve.DEFAULT_PRECS), LineSearch{Nothing, Nothing, Bool}, Nothing}; kwargs::Base.Pairs{Symbol, Real, NTuple{4, Symbol}, NamedTuple{(:default_set, :second_time, :reltol, :abstol), Tuple{Bool, Bool, Float64, Float64}}})
@ DiffEqBase C:\Users\user\.julia\packages\DiffEqBase\eTCPy\src\solve.jl:553
[9] init(prob::NonlinearLeastSquaresProblem{Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, true, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, NonlinearFunction{true, SciMLBase.FullSpecialize, typeof(objective2), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, SymbolicIndexingInterface.SymbolCache{Nothing, Nothing, Nothing}, Vector{Float64}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, args::GaussNewton{nothing, Nothing, Nothing, typeof(NonlinearSolve.DEFAULT_PRECS), LineSearch{Nothing, Nothing, Bool}, Nothing}; sensealg::Nothing, u0::Nothing, p::Nothing, kwargs::Base.Pairs{Symbol, Real, NTuple{4, Symbol}, NamedTuple{(:default_set, :second_time, :reltol, :abstol), Tuple{Bool, Bool, Float64, Float64}}})
@ DiffEqBase C:\Users\user\.julia\packages\DiffEqBase\eTCPy\src\solve.jl:541
[10] __solve(::NonlinearLeastSquaresProblem{Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, true, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, NonlinearFunction{true, SciMLBase.FullSpecialize, typeof(objective2), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, SymbolicIndexingInterface.SymbolCache{Nothing, Nothing, Nothing}, Vector{Float64}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, ::GaussNewton{nothing, Nothing, Nothing, typeof(NonlinearSolve.DEFAULT_PRECS), LineSearch{Nothing, Nothing, Bool}, Nothing}; kwargs::Base.Pairs{Symbol, Real, NTuple{4, Symbol}, NamedTuple{(:default_set, :second_time, :reltol, :abstol), Tuple{Bool, Bool, Float64, Float64}}})
@ NonlinearSolve C:\Users\user\.julia\packages\NonlinearSolve\KlGj2\src\NonlinearSolve.jl:134
[11] macro expansion
@ C:\Users\user\.julia\packages\NonlinearSolve\KlGj2\src\default.jl:123 [inlined]
[12] __solve(::NonlinearLeastSquaresProblem{Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, true, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, NonlinearFunction{true, SciMLBase.FullSpecialize, typeof(objective2), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, SymbolicIndexingInterface.SymbolCache{Nothing, Nothing, Nothing}, Vector{Float64}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, ::NonlinearSolvePolyAlgorithm{:NLLS, 5, Tuple{GaussNewton{nothing, Nothing, Nothing, typeof(NonlinearSolve.DEFAULT_PRECS), LineSearch{Nothing, Nothing, Bool}, Nothing}, TrustRegion{nothing, Nothing, Rational{Int64}, Nothing, typeof(NonlinearSolve.DEFAULT_PRECS), Rational{Int64}, Nothing}, GaussNewton{nothing, Nothing, Nothing, typeof(NonlinearSolve.DEFAULT_PRECS), LineSearch{BackTracking{Float64, Int64}, Nothing, Bool}, Nothing}, TrustRegion{nothing, Nothing, Rational{Int64}, Nothing, typeof(NonlinearSolve.DEFAULT_PRECS), Rational{Int64}, Nothing}, LevenbergMarquardt{true, Nothing, Nothing, typeof(NonlinearSolve.DEFAULT_PRECS), Float64, Float64, Float64, Float64, Float64, Float64, Float64}}}; kwargs::Base.Pairs{Symbol, Real, NTuple{4, Symbol}, NamedTuple{(:default_set, :second_time, :reltol, :abstol), Tuple{Bool, Bool, Float64, Float64}}})
@ NonlinearSolve C:\Users\user\.julia\packages\NonlinearSolve\KlGj2\src\default.jl:115
[13] __solve(::NonlinearLeastSquaresProblem{Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, true, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, NonlinearFunction{true, SciMLBase.FullSpecialize, typeof(objective2), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, SymbolicIndexingInterface.SymbolCache{Nothing, Nothing, Nothing}, Vector{Float64}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, ::Nothing; kwargs::Base.Pairs{Symbol, Real, NTuple{4, Symbol}, NamedTuple{(:default_set, :second_time, :reltol, :abstol), Tuple{Bool, Bool, Float64, Float64}}})
@ NonlinearSolve C:\Users\user\.julia\packages\NonlinearSolve\KlGj2\src\default.jl:398
[14] __solve(::NonlinearLeastSquaresProblem{Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, true, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, NonlinearFunction{true, SciMLBase.FullSpecialize, typeof(objective2), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, SymbolicIndexingInterface.SymbolCache{Nothing, Nothing, Nothing}, Vector{Float64}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}; default_set::Bool, second_time::Bool, kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol, Symbol}, NamedTuple{(:reltol, :abstol), Tuple{Float64, Float64}}})
@ DiffEqBase C:\Users\user\.julia\packages\DiffEqBase\eTCPy\src\solve.jl:1370
[15] solve_call(::NonlinearLeastSquaresProblem{Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, true, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, NonlinearFunction{true, SciMLBase.FullSpecialize, typeof(objective2), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, SymbolicIndexingInterface.SymbolCache{Nothing, Nothing, Nothing}, Vector{Float64}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}; merge_callbacks::Bool, kwargshandle::Nothing, kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol, Symbol}, NamedTuple{(:reltol, :abstol), Tuple{Float64, Float64}}})
@ DiffEqBase C:\Users\user\.julia\packages\DiffEqBase\eTCPy\src\solve.jl:608
[16] solve_up(::NonlinearLeastSquaresProblem{Vector{Float64}, true, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, NonlinearFunction{true, SciMLBase.FullSpecialize, typeof(objective2), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, SymbolicIndexingInterface.SymbolCache{Nothing, Nothing, Nothing}, Vector{Float64}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, ::Nothing, ::Vector{Float64}, ::Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol, Symbol}, NamedTuple{(:reltol, :abstol), Tuple{Float64, Float64}}})
@ DiffEqBase C:\Users\user\.julia\packages\DiffEqBase\eTCPy\src\solve.jl:1049
[17] solve(::NonlinearLeastSquaresProblem{Vector{Float64}, true, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, NonlinearFunction{true, SciMLBase.FullSpecialize, typeof(objective2), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, SymbolicIndexingInterface.SymbolCache{Nothing, Nothing, Nothing}, Vector{Float64}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}; sensealg::Nothing, u0::Nothing, p::Nothing, wrap::Val{true}, kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol, Symbol}, NamedTuple{(:reltol, :abstol), Tuple{Float64, Float64}}})
@ DiffEqBase C:\Users\user\.julia\packages\DiffEqBase\eTCPy\src\solve.jl:980
[18] solve_nlprob3(thetapsi::Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}, 2}})
@ Main .\In[121]:8
[19] vector_mode_dual_eval!
@ C:\Users\user\.julia\packages\ForwardDiff\PcZ48\src\apiutils.jl:24 [inlined]
[20] vector_mode_gradient(f::typeof(solve_nlprob3), x::Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}, cfg::ForwardDiff.GradientConfig{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}, 2, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}, 2}}})
@ ForwardDiff C:\Users\user\.julia\packages\ForwardDiff\PcZ48\src\gradient.jl:89
[21] gradient
@ C:\Users\user\.julia\packages\ForwardDiff\PcZ48\src\gradient.jl:19 [inlined]
[22] #99
@ C:\Users\user\.julia\packages\ForwardDiff\PcZ48\src\hessian.jl:16 [inlined]
[23] vector_mode_dual_eval!
@ C:\Users\user\.julia\packages\ForwardDiff\PcZ48\src\apiutils.jl:24 [inlined]
[24] vector_mode_jacobian(f::ForwardDiff.var"#99#100"{typeof(solve_nlprob3), ForwardDiff.HessianConfig{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}}}, x::Vector{Float64}, cfg::ForwardDiff.JacobianConfig{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}})
@ ForwardDiff C:\Users\user\.julia\packages\ForwardDiff\PcZ48\src\jacobian.jl:125
[25] jacobian(f::Function, x::Vector{Float64}, cfg::ForwardDiff.JacobianConfig{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}}, ::Val{false})
@ ForwardDiff C:\Users\user\.julia\packages\ForwardDiff\PcZ48\src\jacobian.jl:21
[26] hessian(f::Function, x::Vector{Float64}, cfg::ForwardDiff.HessianConfig{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}}, ::Val{true})
@ ForwardDiff C:\Users\user\.julia\packages\ForwardDiff\PcZ48\src\hessian.jl:17
[27] hessian(f::Function, x::Vector{Float64}, cfg::ForwardDiff.HessianConfig{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{typeof(solve_nlprob3), Float64}, Float64, 2}}})
@ ForwardDiff C:\Users\user\.julia\packages\ForwardDiff\PcZ48\src\hessian.jl:15
[28] hessian(f::Function, x::Vector{Float64})
@ ForwardDiff C:\Users\user\.julia\packages\ForwardDiff\PcZ48\src\hessian.jl:15
[29] top-level scope
@ In[127]:1
I would deeply appreciate if any of you can guide me on decoding the error message.