Closed qorimaputri closed 4 years ago
*f! = function (x,dx) dx[1] = x[1] + x[2](x[2](5-x[2])-2)-13 dx[2] = x[1] + x[2](x[2]*(1+x[2])-14)-29 end
solve = nlsolve(f!,[15;-2]) ** InexactError: Int64(NaN)
Stacktrace: [1] Int64(::Float64) at .\float.jl:710 [2] alloc_DF(::Array{Int64,1}, ::Array{Int64,1}) at C:\Users\WIN10.julia\packages\NLSolversBase\QPnui\src\objective_types\abstract.jl:19 [3] nlsolve(::Function, ::Array{Int64,1}; method::Symbol, autodiff::Symbol, inplace::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\WIN10.julia\packages\NLsolve\04rfI\src\nlsolve\nlsolve.jl:49 [4] nlsolve(::Function, ::Array{Int64,1}) at C:\Users\WIN10.julia\packages\NLsolve\04rfI\src\nlsolve\nlsolve.jl:46
how can solve these??
Your input is in Ints, should be in floats:
solve = nlsolve(f!,[15.0;-2.0])
This should probably be made more user-friendly...
thanks a lot
*f! = function (x,dx) dx[1] = x[1] + x[2](x[2](5-x[2])-2)-13 dx[2] = x[1] + x[2](x[2]*(1+x[2])-14)-29 end
solve = nlsolve(f!,[15;-2]) ** InexactError: Int64(NaN)
Stacktrace: [1] Int64(::Float64) at .\float.jl:710 [2] alloc_DF(::Array{Int64,1}, ::Array{Int64,1}) at C:\Users\WIN10.julia\packages\NLSolversBase\QPnui\src\objective_types\abstract.jl:19 [3] nlsolve(::Function, ::Array{Int64,1}; method::Symbol, autodiff::Symbol, inplace::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\WIN10.julia\packages\NLsolve\04rfI\src\nlsolve\nlsolve.jl:49 [4] nlsolve(::Function, ::Array{Int64,1}) at C:\Users\WIN10.julia\packages\NLsolve\04rfI\src\nlsolve\nlsolve.jl:46
how can solve these??