Hi, thank you for your help!
After reviewing my work, I realized I made a mistake in the equation for Tf, which includes K. I had written it as:
Tf = - (Log[1/z (k/ww - 1)]/q);
But it should actually be:
Tf = - (Log[1/z (g/ww - 1)]/q);
Where g has a value of 6.87.
According to the paper, the equation looks like this:

But after correcting the equation, I’m still encountering the following error:
FindMaximum::nrnum: The function value -2.5726110^29 + 2.5726110^29 I is not a real number at {d,n} = {985.615,-217184.}.
General::stop: Further output of FindMaximum::nrnum will be suppressed during this calculation.
IPOPTMinimize::badobj: Invalid objective function. The objective function doesn't evaluate to a real-valued numeric result at the initial point.
FindMaximum::nrgnum: The gradient is not a vector of real numbers at {d,n} = {985.5,-217184.}.
FindMaximum::conv: Interior point method fails to converge.
Do you have any suggestions on how I can fix this issue? It seems that the function is still returning non-real values, and the method fails to converge.