I need help creating a method for a program I'm making. I've worked on this countless hours and I can not seem to figure it out. what I need: A method that returns $x$. My variables ( initialized to a given number ):
double initial, initial2, initial3,
Kab, coefficient1, coefficient2, coefficient3
Equation:
kab = ((initial2+coefficient2*X)^coefficient2 *
(initial3+coefficient3*X)^coefficient3) /
(initial-coefficient1*X)^coefficient1
I have tried binary search in order to solve it and that didn't work.
Please be patient with me. I am a high school student and I haven't had much advanced math in order to solve these kinds of problems.
Thank you so much!
Knowing nothing about your parameters, except that they are real numbers I would suggest to use $$ F(x) =\frac{(i_2 + c_2 x)^{c_2}(i_3 + c_3 x)^{c_3}}{(i - c_1 x)^{c_1}} $$ and solve numerically for zeros of $$ f(x) = F(x) - k_{ab} $$ This is possible e.g. by bisection, or by using Newton-Raphson iteration.