0
votes

I have an equation in matlab which is shown below:

2^((2*10^6)/x)-((1.5536*10^(-51)*x)/(2.6243*10^(-15)+((3.9810*10^(-21))*x)))=0

I could solve it with fzero solver with another numbers before. But now when I run it with any types of numbers as a starting value for fzero solver it aborts search because faces with NaN. Any one can help me to find a starting value to solve it with fzero or suggest me another matlab solver to solve it?

1

1 Answers

0
votes

As fsolve uses the gradient to solve the problem and the function goes to infinity when approaching zero from the positive side, you should be very careful about the initial value. To get a result from the fsolve in your case, you can run the following:

x0 = -1e-20; % very small value, close to zero from the neagtive side
x = sym('x');
fsolve('2^((2*10^6)/x)-((1.5536*10^(-51)*x)/(2.6243*10^(-15)+((3.9810*10^(-21))*x)))', x0)

However, by plotting the function and limiting the function, you can find no value to zero the function! And you can approach zero by increasing the power of -1e{x} that x can be any large negative value. For example, for -1e-100 the value of the function will be 5.9201e-137.

On the other hand, as each computing machine has a limiting precision, you can zero for -1e-1000 for the function value in the 64-bit register machine.