1
$\begingroup$

I assume this is something to do with limits on numerical precision, but can someone explain the difference in output between these two Solve problems:

Solve[PrimeZetaP[s] == 1.434, s]

{{s -> 1.222683551}}

and

Solve[PrimeZetaP[s] == 1.435, s]

Solve was unable to solve the system with inexact coefficients or the system obtained by direct rationalization of inexact numbers present in the system. Since many of the methods used by Solve require exact input, providing Solve with an exact version of the system may help.

Solve[PrimeZetaP[s] == 1.434, s]

Obviously, I've hit some kind of threshold - but what and why?

UPDATE:

Following @Artes's suggestion below, I tried

FindRoot[PrimeZetaP[s] == 1.435, {s, 2}]

{s -> 1.222402031}

Clearly, this works. But now this...

FindRoot[PrimeZetaP[s] == 1.445, {s, 2}]

{s -> 2.}

...doesn't.

There seems to be a threshold (call it t) somewhere in the region 1.434 < t < 1.44 where it becomes impossible to obtain a result, as this table shows:

TableForm[Table[
 {n, Solve[PrimeZetaP[s] == n, s], 
  FindRoot[PrimeZetaP[s] == n, {s, 2}]}, 
 {n, 1.43, 1.44, 0.001}]]

Further thoughts, anyone? The error messages suggest I should use Reduce - but I'm not sure how to apply it in this instance; If I use Reduce[PrimeZetaP[s] == n, s] in the table above, I get nothing.

$\endgroup$
  • $\begingroup$ Solve works with exact numbers, however for transcendental functions it should be used with appropriate bounds on variables. See e.g. more detailed discussion. Nevertheless Solve cannot solve all equations involving transcendental functions. Try FindRoot[PrimeZetaP[s] == 1.435, {s, 2}] $\endgroup$ – Artes Feb 12 at 14:19
  • $\begingroup$ Thanks @Artes. I've updated the question above. There still seems to be some limit beyond which Mathematica simply cannot tackle the problem. $\endgroup$ – Richard Burke-Ward Feb 12 at 15:20
  • $\begingroup$ There will always be some limits beyond which Mathematica simply cannot tackle many problems. The issues with Solve and Reduce are discussed here. Read it carefully. There are some limits where Solve can call NSolve, it doesn't matter here since FindRoot is the way to go, FindRoot[PrimeZetaP[s] == 4.45, {s, 1.2}]. $\endgroup$ – Artes Feb 12 at 15:49
  • $\begingroup$ Thanks @Artes. Do you want to turn that into an answer so I can tick it? $\endgroup$ – Richard Burke-Ward Feb 12 at 22:09
  • $\begingroup$ I guess this problem comes from a simple mistake and can be simply found in the documentation and so the question might be closed or deleted as you prefer. $\endgroup$ – Artes Feb 12 at 22:27
3
$\begingroup$

FindRoot needs a good initial estimate

Clear["Global`*"]

To get an initial estimate for FindRoot, find a fit for values of {PrimeZetaP[s], s}

data = Table[{PrimeZetaP[s], s}, {s, 1.1, 2, 0.01}];

Using FindFit

f[p_] = a*p^2 + b*p + c /. FindFit[data,
   a*p^2 + b*p + c, {a, b, c}, p]

(* 2.59273 - 1.65311 p + 0.467891 p^2 *)

Looking at the fit

{pmin, pmax} = MinMax[data[[All, 1]]]

(* {0.452247, 2.10884} *)

Plot[f[p], {p, pmin, pmax}, Epilog -> {Red,
   AbsolutePointSize[4], Point[data]}]

enter image description here

Verifying that FindRoot works using better initial estimates

s /. FindRoot[PrimeZetaP[s] == #, {s, f[#]},
    WorkingPrecision -> 15] & /@
 Range[1.43`15, 1.44`15, 0.001`15]

(* {1.22381388261206, 1.22353066085125, 1.22324786557684, 1.22296549598819, \
1.22268355128654, 1.22240203067502, 1.22212093335863, 1.22184025854421, \
1.22156000544051, 1.22128017325810, 1.22100076120941} *)
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.