Tag Info

Hot answers tagged

8

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

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, ...


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}}]


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 = 0``5.*) 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 ...


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