Total Julia noob here.
So I would like to ultimately solve an equation f(x,a)=0 for x many times as I vary a and plot the solution as a function of a. Before getting to that though, I am first trying to learn to use NLsolve in a very simple case of the function f(x)=x+1.
I am a bit confused on the usage of NLsolve.
Based on the example in the docs https://github.com/JuliaNLSolvers/NLsolve.jl I try
function f!(F, x)
F=x+1
end
function j!(J,x)
J=1
end
NLsolve(f!, j!, 1)
(I am unsure of what to put in the third argument of NLsolve which I guess is the initial condition but I tried a couple things like 1 and [ 0.1; 1.2] which was in the example).
I get this error: https://paste.gg/p/anonymous/d15bfc129c704142888eebc455d3c82c
I would like this to tell me that x=-1.
Any recommendations on how to fix error?
Thanks!
7 posts - 3 participants