Tag Info

8

The problem is that the precision of a and b are set by the form of their input. a = 1234567891234567889998.5; b = 1234567891234567889999.5; Precision[a] 22.0915 And 0.5 by default has MachinePrecision, these days typically Log10[2^53] or just under 16 digits. Precision[0.5] MachinePrecision Neither setting the precision of 0.5 to 200 or ...

7

If you look at the documentation for Precision, it says that if x is the value and dx the "absolute uncertainty", Precision[x] is -Log[10,dx/x]. This, whenever the estimated error is larger than the value, Mathematica will give a negative precision. Thus, for an estimated error $dx$ and a value $x$ such that $dx/x<1$ here is how the precision as defined ...

6

To make the result of NSum more precise you can use also the NSumTerms option (15 by default, see e.g. Numerical Evaluation of Sums and Products) appropriately increased. Let's try e.g. : a1 = NSum[ HarmonicNumber[2 m]/m^3, {m, 1, Infinity}, WorkingPrecision -> 140, PrecisionGoal -> 70, NSumTerms -> 2000] ...

4

Numerical integration in Mma is a big topic. I suggest reading at least this. The following gives the correct answer: NExpectation[(-(x*y) + z^2) Boole[x*y - z^2 <= 0], {x, z, y} \[Distributed] MultinormalDistribution[{0, 0, 0}, {{3/8, 0, 1/8}, {0, 1/8, 0}, {1/8, 0, 3/8}}], Method -> {"NIntegrate", {Exclusions -> True}}]

4

If you Rationalize all your finite precision numbers and add WorkingPrecision -> 50 to FindRoot the messages go away. For example: /. {Mn -> Rationalize[0.08], cn -> Rationalize[0.25]} and: Table[Vnuc[x, y, 0] + Vdisk[x, y, 0] + Vbar[1, Rationalize[0.1], 7, Rationalize[1.5], Rationalize[0.6], x, y, 0], {x, -10, 10, 1/2}, {y, -10, 10, ...

3

Arbitrary precision can be a tricky thing, particularly when you start to mix numbers at various levels of precision. As the was pointed out in the comments, if you mix quantities Mathematica will coerce the results to be of the lower precision. For example: {Sin[Pi/4], Sin[0.25 Pi]} (* Out: {1/Sqrt[2], 0.707107} *) Note that Sin[Pi/4] returns the ...

3

Regarding your last question: in the docs for FindRoot it says that FindRoot continues until either of the goals specified by AccuracyGoal or PrecisionGoal is achieved. The same thing is mentioned in the docs for NMinimize. On the other hand, the docs for NDSolve say AccuracyGoal effectively specifies the absolute local error allowed at each ...

2

The comments by image_doctor led me to the answer I was looking for: StandardForm@NumberForm[1.2, {20, 4}, ExponentFunction -> (Null &)] (* 1.2000 *) StandardForm@NumberForm[1., {20, 4}, ExponentFunction -> (Null &)] (* 1.0000 *) StandardForm@NumberForm[0.2, {20, 4}, ExponentFunction -> (Null &)] (* 0.2000 *) StandardForm@NumberForm[0., ...

2

Might want to have a look at the InputForm of these. SetAccuracy[0., 5] // InputForm (*Out[38]//InputForm = 05.*) SetAccuracy[1.2, 5] // InputForm (*Out[39]//InputForm=1.19999999999999995559107901499373838305`5.079181246047625*) I doubt either gives the behavior you are after. As was suggested in a comment, maybe NumberForm or PaddedForm will meet ...

2

Initially I forgot to specifically address Manipulate. In addition to this post see also: Manipulating an arbitrary-precision ContourPlot This question may qualify as a duplicate (I'll let the community votes decide) but it has been asked in a different way so I'll answer it anew. There are two issues that may be confounded here: input syntax and ...

2

The problem has to do with the sample points used to contruct the plot, and not with NDSolve. Mathematica automatically subdivides segments when the angle is greater than some limit, but it will do so only MaxRecursion times. One can increase PlotPoints to increase the number of initial sample points and increase MaxRecursion to let Mathematica subdivide ...

1

It seems to be because of numerical errors. There are A LOT of operations so there is plenty of opportunity for errors to grow. To get around this you can use exact arithmetic which Mathematica does if it is given exact numbers, for instance a=3.9 is stored as a floating point number which is inexact causing all computation done to be inexact too. a=39/10 ...

1

Of course, one should also remember that the Method options of NSum[] accept sub-options as well. For instance, NSum[HarmonicNumber[2 m]/m^3, {m, 1, Infinity}, Method -> {"EulerMaclaurin", "ExtraTerms" -> 50, Method -> {NIntegrate, Method -> "DoubleExponential"}}, NSumTerms -> 50, PrecisionGoal -> 90, ...

Only top voted, non community-wiki answers of a minimum length are eligible