We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, l'd like to pass parameters to the function to minimize. Something like
using NLsolve function f!(F, x, params) a, b = params F[1] = (x[1] + a)*(x[2]^3 - b) + 18 F[2] = sin(x[2] * exp(x[1]) - 1) end
I also don't have a Jacobian for this function. What is the syntax to pass a vector into nlsolve so that this is passed into my function? I've tried
p = [1.0 1.0] nlsolve(f!, [0.1, 1.0]; params=p)
but never got this working.
The text was updated successfully, but these errors were encountered:
What is the syntax to pass a vector into nlsolve so that this is passed into my function?
Typically you create a new function that only takes F and x as arguments and encloses p, e.g.
F
x
p
julia> g!(F, x) = f!(F, x, p); julia> nlsolve(g!, [0.1, 1.0])
or with an anonymous function
nlsolve((F, x) -> f!(F, x, p), [0.1, 1.0])
Sorry, something went wrong.
Thanks, got it.
Yes, that is the suggested way.
No branches or pull requests
Hi,
l'd like to pass parameters to the function to minimize. Something like
I also don't have a Jacobian for this function. What is the syntax to pass a vector into nlsolve so that this is passed into my function? I've tried
but never got this working.
The text was updated successfully, but these errors were encountered: