lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Apr 30, 2018 at 1:11 PM, Gavin Wraith <gavin@wra1th.plus.com> wrote:

f = function (x)
>  local a = ((2.51/R)*x + k/(3.72*d))
>  return -2*math.log(a)
>  end

This can be simplified further, to z = A - 2 log (z + B), to be solved for z.

There is actually a closed form solution using the Lambert W function [1], but I am afraid computing the value of the function is equivalent to solving the equation numerically.

Cheers,
V.

[1] https://en.wikipedia.org/wiki/Lambert_W_function