Iteration of an Equation

unhandled

(McEnz) #1

Hello everyone,

I need to program an iteration in grasshopper and I wanted to use Hoopsnake.

λ=〖(-2lg⁡(2,51/Re*√λ+k/3,71d)〗^(-2)

I need to solve this Equation for λ. I wanted to use the Expression designer but I am not able to use so many variables in it,

For the variable Re, k, and d I wanted to use just sliders, because these are known.

How can I start an iteration to solve for λ?

Thank you already

best regards


#2

Try zooming in on the expression component, you’ll see a little plus show up on the inputs. Those allow you to add inputs.


(McEnz) #3

oh damn, thanks a lot. Just started today with the program, now i try it again


(David Rutten) #4

What are the weird outlined brackets about?

And lambda seems to be both the result of the equation and one of its constituents. That doesn’t look legal…

ps. Did you know discourse supports \LaTeX formatting? I have no idea if the following is correct, as I don’t understand the order of operations as written, but it may help in the future.

$\lambda = (-2lg(\frac{2.51}{Re}\sqrt{\lambda} + \frac{k}{3.71d})^{-2}$

results in:

\lambda = (-2lg(\frac{2.51}{Re}\sqrt{\lambda} + \frac{k}{3.71d})^{-2}


(McEnz) #5

yes i know lambda is on both sides. It’s the prandt colebrook equation and has to be solved with an iteration. next time i try to use latex and thanks for the help.

i try a lot but i can not find a solution. The Variables Re, k and d are known.

This is what i try but i always get an expression generated an error for…


(qythium) #6

You have to use a period for the decimal separator: k/(3.71*D)
Upload the gh file if it’s still not working.


(Laurent Delrieu) #7

And as you work in a 3d program, it is also possible to solve the equation using its 2d representation with the first dimension (x) being Lambda, the second (y or z) being
\lambda- (-2log10(\frac{2.51}{Re}\sqrt{\lambda} + \frac{k}{3.71d})^{-2}
so you will have a curve and you could use the component curve intersections with an infinite line.
Here the file


with coefficients like there
https://www.engineeringtoolbox.com/colebrook-equation-d_1031.html

equation Prandld.gh (14.2 KB)


(IVELIN PEYCHEV) #8

Try Greenshot to capture your screen :wink: http://getgreenshot.org/