Questions tagged [precision-and-accuracy]

Filter by
Sorted by
Tagged with
4
votes
3answers
374 views

How to set a tolerance level for equality constraints

Given two equality constraints: x+y==250 and z+p==65 where x=190, y=50, z=45, p=15, I want ...
1
vote
0answers
81 views

Is this the safest way of defining the global precision?

By restricting $MinPrecision = $MaxPrecision = $MaxExtraPrecision = 17 and adding extra precision to any real number ...
2
votes
1answer
137 views

Double Numerical Integral - precision is not improving answer

Consider this two-dimensional integral ...
5
votes
1answer
128 views

How to increase NDSolve accuracy for 2nd order ODE?

My attempt to NDSolve a 2nd order nonlinear ODE ...
1
vote
0answers
40 views

What does the following error message mean, in the context of NonlinearModelFit?

I am deliberately not including data or a model for this question, as I want a more general answer so that I may be able to trouble shoot this myself in the future. When performing a fit, usually a ...
2
votes
2answers
105 views

Why is Mathematica's default precision only 16 digits? [closed]

I was performing some basic computations when I noticed that NumberForm[N[Zeta[3]], {100, 100}] yields ...
0
votes
0answers
25 views

Conversion of numerics to/from database Real

I am writing data from MMA (11.0.1.0, Win 10 home 64 bit) to a Microsoft SQL Server/T-SQL database and am having considerable trouble controlling precision. The target column in the database has data ...
1
vote
1answer
41 views

Optimization of numerical integration

I would like to ask for a help from community in the numerical computation of an integral and in the preparation of a contour plot. I have already done some work in this direction, but everything is ...
1
vote
2answers
84 views

Getting error General::munfl from NonlinearModelFit [duplicate]

I am trying to fit data to a sum of Gaussians. This data is found in a file called lpeff.txt. So I write the following code: ...
0
votes
1answer
35 views

Selectively changing precision while leaving integers and rationals unchanged

I didn't find an answer to this question on the site, but as I was writing up my question, I figured out how to do it, so I thought I should post it and answer my own question so that others can ...
1
vote
2answers
79 views

Zeros of high degree polynomials

I am working with Hermite polynomials in Mathematica with the built-in function HermiteH. I want to compute the zeros of the polynomial ...
2
votes
2answers
77 views

Plotting with Precision

Suppose we plot Plot[ Exp[x]Exp[-x], {x,0,1000} ] This equals 1, as expected, until around x = 750 where the curve drops sharply to 0. Clearly this is due to ...
2
votes
2answers
141 views

Compute unstable integral with high precision

I want to calculate $$ \int_{\mathbb{R}^n} e^{-t_1^4-t_2^4- ...-t_n^4-(1-t_1-t_2-...-t_n)^4} \text{d}t_1 \text{d}t_2 ... \text{d}t_n $$ with the highest possible n. I tried with ...
2
votes
1answer
401 views

Why does the PoissonDistribution not plot around its mean for moderate large numbers?

I plotted the Poisson Distribution for various mean values (plot label and vertical line). The plots does not peak around the mean as the mean increase. Any advice to get the right plot, or at least ...
1
vote
0answers
50 views

NDSove vs ParametricNDSolve

ParametricNDSolve is very practical when one has to execute NDSolve again and again. However is it equally accurate? I have not ...
1
vote
2answers
151 views

NMaximize not always returning solution

This question is related to a previous question and answer here: NMinimize or NMaximize for a dynamic problem but tackles a different problem. I am trying to solve a simple linear quadratic ...
0
votes
0answers
62 views

Numerical calculation Mathematica 11.2 / 11.3 / 12 [duplicate]

Please I do not understand why Mathematica 11.2 version evaluates numerically the value below Exp[-800]//N (* 3.667874584178*10^-348 *) while 11.3 and 12 ...
1
vote
1answer
99 views

How to make these operations occur faster?

How can I get this section of the code to solve this integration faster. I have rather large values but I don't need it to be too specific. However if I lower the precision it says the integration is ...
0
votes
0answers
43 views

Need help to plot this function

...
0
votes
2answers
56 views

Precision, accuracy and very large/small exponents with Reduce

Numerical precision/accuracy question here. I am currently working on solving nonlinear equations with Reduce. Oftentimes, ...
0
votes
0answers
25 views

NumberForm giving incorrect result [duplicate]

The definition of the NumberForm function is the following: "NumberForm[expr,n] prints with approximate real numbers in expr given to n-digit precision." However ...
3
votes
2answers
76 views

Solution to eigenvalue BVP using NDEigensystem to high precision

I'm trying to solve linear (non-self-adjoint) boundary-value problems to as high precision as possible (optimally 1e-15). For example, the below code solves for the first 5 eigenvalues of the harmonic ...
1
vote
1answer
57 views

Getting values of EllipticK with arguments that are very near 1

I need to evaluate EllipticK[m] very close to 1. However, when I get too close to 1 the function defaults to the exact solution for 1 , which is ...
2
votes
1answer
84 views

Compute the potential of confusion between two matrices

I have a problem. Any help will be appreciated. In order to calculate the accuracy, sensitivity, sensibility and F1 score between diseases and their symptoms, I have two matrices with a different ...
4
votes
2answers
139 views

How can I get high precision circle drawing in Graphics, across ten orders of magnitude

I need to visualize some fractal circle arrangements where tangent circles can vary by ten orders of magnitude. In such cases the circles are not being drawn as tangent. Example: The red and blue ...
0
votes
0answers
52 views

Why doesn't SetPrecision give me the precision I ask for? [duplicate]

I'm dealing with a problem requires a precision of 50 digitals after the decimal point. However, I got the following value when doing so: I don't know what's going on here, ain't it 0.09 with other ...
2
votes
1answer
80 views

Efficient Round edition with different rounding direction

As pointed out in this post, Mathematica has a special version of Round that Round rounds numbers of the form x.5 toward the nearest even integer. A comment by ...
2
votes
1answer
119 views

How to prevent Mathematica from giving inexact answers

Upon doing a simple subtraction 13.725 - 13.5 both Mathematica 11.3 and 12.0 beta version are giving me 0.22499999999999964 ...
3
votes
1answer
204 views

How to increase the accuracy of a plot

I have the following code below: ...
3
votes
0answers
61 views

Slight loss of precision when parsing JSON

Exporting to JSON is working well for me under 11.3. The issue present in previous versions seem to be solved: ...
4
votes
2answers
427 views

Using LinearSolve instead of Inverse does not give a good enough precision

If I want to calculate $B^{-1}A$, then instead of using Inverse, I should in theory just be able to use LinearSolve[B,A]. Now ...
0
votes
1answer
54 views

ContourPlot fails in a simple equation

I'm very new with Mathematica, and I'm struggling with a very simple problem. I want to plot this ...
0
votes
1answer
62 views

ContourPlot showing breaks in contours

I'm trying find graphically the solutions of the intersection of the following functions. ...
2
votes
2answers
134 views

Why is 0 vs 0.0 causing a precision problem?

I wasn't sure what to title this Question. I tried calculating different forms of a continued fraction, and I found that I get a correct result when I set d to 0 but a wrong result (in the final two ...
5
votes
0answers
59 views

Small positive machine number calculation in Mathematica 11.3

In Mathematica version < 11.3, any positive Machine‐Precision Numbers exceeding the range [$MinMachineNumber,$MaxMachineNumber...
8
votes
7answers
1k views

How to display very small numbers in Mathematica?

I am trying to evaluate the function: $$f(x) = \cos(x) - \mathrm{e}^{-2.7 x}$$ at $x = 1.7 \times 10^{-25}$ and Mathematica keeps returning '0.' How do I evaluate the expression in a better way?
3
votes
1answer
99 views

Problem with the Inverse CDF of Non-central F Ratio Distribution

In[3]:= n = 5; n1 = 4; n2 = 6; γ = 0.05; α = 1/370; InverseCDF[NoncentralFRatioDistribution[1, n1 - 1, n1/γ^2], 1 - α - (n - n1)/n2] During evaluation of In[3]...
6
votes
2answers
192 views

Catastrophic loss of accuracy in Orthogonalize

Context In connection to this question I am interested in orthogonalizing known matrices. As a test case, let us consider the definite positive $15 \times 15$ matrix ...
0
votes
1answer
132 views

Good practice about numerical precision

In one of my calculations, I get -1.11022*10^-16 as one of my eigenvalues for a matrix. It's essentially zero and I suppose I could use SetPrecision to make it zero but I wonder what's a good practice ...
0
votes
1answer
63 views

Increasing MaxExtraPrecision arbitrarily changes numerical result

I am trying to confirm that a function $f$ satisfies a particular differential equation of the type $D f=0$, for some differential operator $D$. I set $Df$ as Diffeq...
0
votes
0answers
35 views

Return the precision of the first non zero digit in a number for measurement error representation function

I'd like to return the precision of the first non zero digit in a number. The motivation is so that I can quickly construct my error notation which is the bracketed notation, e.g. $x = 1.234$ with ...
1
vote
2answers
133 views

How to avoid this type of change of digits in computed numbers?

Is there a way to avoid the digits being changed? ...
0
votes
1answer
40 views

Inaccuracy in Plot3D

This problem might be well-known - in this case, I would appreciate a link, because I could not find anything. My problem: A certain function (super long and nasty expression) needs to be plotted. ...
6
votes
1answer
95 views

Loss of accuracy in orthogonalisation of polynomials using Orthogonalize

Context As a mean to understand the growth of structure in the universe, I am interested in characterising the curvature of random fields such as this one: For this purpose I start with a PDF of the ...
0
votes
0answers
40 views

NIntegrate weird behaviour inside a function

I wrote this little function ...
1
vote
0answers
46 views

DensityPlot, ScalingFunctions, and small values

Edit: I figured out I can use Rescale to retrieve the plot as well as get the correct plot legend. I still can't figure out how to rescale the axes from 10^-9 to 1 ...
1
vote
2answers
152 views

Truncate a number in mathematica

I want to truncate a simple number to n decimal digits. For example, 2/3. I used f[x_, n_] := N[IntegerPart[x 10^n]/10^n] but I get ...
1
vote
1answer
52 views

Accuracy of function past 10^(-17)

I am trying to integrate an analytic function: ...