I’m new in Julia. I have to solve a non-linear equation, and I have found the NLsolve package.
1 ./sqrt(fric_fact[:]) + 2*log10(epsilon./. (3.7.*DD) + 2.51./(sqrt(fric_fact[:]).*max(Re, 1e-10)))
sol = nlsolve(coolebrok, ff[:]./10)
this is what i have writtend in my code. Consider that fric_fact has to be a vector of 703x1 elements. This code is not working. Where is the mistake? Consider that this equation is solvable with fsolve in Matlab.
Hello and welcome to the community consider formatting your code as code using triple back ticks ``` and include a running example that produces the error you are seeing. This makes it easier for people to help you.
From just looking at the code, you’re trying to compute sqrt(array) which does not work in Julia. To compute the element-wise sqare root, use broadcasting: sqrt.(array).
You might also want to let fric_fact be a Vector rather than a 703 x 1 Matrix so that you don’t have to write [:] everywhere.