Skip to content

i have tried to solve this in jullia 1.4.2, but got error #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
qorimaputri opened this issue Oct 7, 2020 · 2 comments
Closed

i have tried to solve this in jullia 1.4.2, but got error #251

qorimaputri opened this issue Oct 7, 2020 · 2 comments

Comments

@qorimaputri
Copy link

qorimaputri commented Oct 7, 2020

image

**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
[5] top-level scope at In[16]:5

how can solve these??

@qorimaputri qorimaputri changed the title ![image](https://user-images.githubusercontent.com/71642456/95331618-1c9e8c00-085f-11eb-84b7-9682d48fb972.png) i have tried to solve this in jullia 1.4.2, but got error i have tried to solve this in jullia 1.4.2, but got error Oct 7, 2020
@antoine-levitt
Copy link
Contributor

Your input is in Ints, should be in floats:

solve = nlsolve(f!,[15.0;-2.0])

This should probably be made more user-friendly...

@qorimaputri
Copy link
Author

thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants