# Could the PrecisionGoal for NDSolve be a negative number?

The help of Mathematica doesn't say so much about the `PrecisionGoal` for `NDSolve`, and I never considered much about it even after I met the warning message

NDSolve::eerr

for several times when I was trying to solve a set of PDEs these days: every time I met it I would simply considered it as a proof for the defect of my assumption for the initial or boundary condition, and my resolution strategy for it is to modify the conditions or sometimes I will also lower the value of the `PrecisionGoal` as the help says.

However, this time I can't ignore it anymore, for I accidentally found that for one of my assumptions, the suitable `PrecisionGoal` for it is a negative integer…

The thing named "Precision" in my mind was always a positive integer, but this time it is negative! Why?…… What's the exact effect of "PrecisionGoal" option for `NDSolve`?

-

## 1 Answer

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 above looks like:

You see that it is really the number of digits in the ratio of the error to the value. If the error $dx>x$ then the log is negative:

`Accuracy` is probably closer to what you have in mind: it's basically to the number of effective digits in the number, as it is `-Log[10,dx]`. If $dx>1$, it can be negative, indicating that a number of digits to the left of the decimal point is incorrect (and of course, it can be non-integer just like the precision). If you really want the number of digits, take the integer part (or round it).

About the last bit of the question, ie, "what does `PrecisionGoal` option for `NDSolve` do?", I think the above plus the explanation in the docs covers it: it specifies the precision (as defined above) to be sought in the solution.

-
– xzczd Aug 2 '12 at 12:50
It's mentioned under `More Information` (click on the yellow box to open it). About the log, if you look at the plots, you'll notice that it reduces to exactly what you'd expect if I fix eg `dx/x` to be exactly 0.01 (ie, it's 2 then). About the "best place" thing, I meant that this is really a general question about putting things in dimensionless form; I talked a little about this here. But in general I guess some sort of math site would be better for that (it's not a Mathematica question really) – acl Aug 2 '12 at 13:00
– xzczd Aug 2 '12 at 13:57

1
No, if they are in SI units they're not dimensionless. – acl Aug 2 '12 at 14:07
No, they're certainly dimensionless as every formula has the same unit, it's then equivalent to dimensionless, for example, `Solve[(s == 2 v) /. s -> 6, {v}]`,now I know that s has the unit m, 2 has the unit s and v has the unit m/s , so after I set s as 6 and solve the equation, though I only get v->3 I will still know the unit of 3 is m/s. – xzczd Aug 2 '12 at 14:22
show 1 more comment
lang-mma
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 5, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9503888487815857, "perplexity_flag": "middle"}