I have the following equation that I want to solve with respect to a
:
x = (a-b-c+d)/log((a-b)/(c-d))
where x
, b
, c
, and d
are known. I used Wolfram Alpha to solve the equation, and the result is:
a = b-x*W(-((c-d)*exp(d/x-c/x))/x)
where W
is the is the product log function (Lambert W function). It might be easier to see it at the Wolfram Alpha page.
I used the Matlab's built-in lambertW
function to solve the equation. This is rather slow, and is the bottleneck in my script. Is there another, quicker, way to do this? It doesn't have to be accurate down to the 10th decimal place.
EDIT:
I had no idea that this equation is so hard to solve. Here is a picture illustrating my problem. The temperatures b-d plus LMTD varies in each time step, but are known. Heat is transferred from red line (CO2) to blue line (water). I need to find temperature "a". I didn't know that this was so hard to calculate! :P