-
Notifications
You must be signed in to change notification settings - Fork 67
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
How to solve equations given in a vector form? #218
Comments
mutate: |
@ChrisRackauckas Thanks, the syntax keeps surprising me. An opposite question: can the package solve scalar equations like function g!(G, x)
G = 4.0 - x*2
end
nlsolve(g!, 1.0, autodiff=:forward) I get
|
NLsolve.jl doesn't do scalar equations. Though Roots.jl is all about scalar rootfinding. |
Thanks, Chris! |
You can put your scalar equation in a length-1 vector and solve though. |
Yeah, but that's not really using scalars well though. It's a bit more expensive and it's not using methods that are tailored towards 1D, which is a much simpler problem. If someone is actually doing a bunch of 1D rootfinding problems, it's probably better to point them in another direction. If what they're doing is just a 1D test case and then straight to ND, then sure length-1 vector is fine. |
Let's have a simple example which can be coded directly:
is as expected:
If my vector
x
has dimension, say, 100, I don't want to code the function elementwise. If I don't miss anything in Julia syntax, it would bewhich is incorrect:
How do I define the equation in vector form and get a valid result?
The text was updated successfully, but these errors were encountered: