Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to treat with logarithm numerically when it becomes negative?

I have a term log(f(x)) in my equations which I am trying to solve them numerically. But the solver does not solve, perhaps when the argument of the logarithm becomes negative. What should I write in the program when f(x)<0 in the loop in order not to loose the iteration?