Questions tagged [precision-and-accuracy]
The precision-and-accuracy tag has no usage guidance.
594
questions
0
votes
0
answers
50
views
Mathematica 13 not Working with Windows 11 Pro (bug)
Erratic behavior in Mathematica 13 on Windows 11 Pro. I have two issues that come and go. (1) Sometimes, the equation controlling the manipulate in my notebooks corrupts. The slider bars are not able ...
2
votes
2
answers
121
views
How to get correct numerical result without lots of digit precisions?
I am wondering if it is possible to get the correct numerical result without computing with a lot of precisions in expressions.
as a simple example suppose in the middle of some of my numerical code ...
1
vote
1
answer
94
views
How to improve accuracy of the integration in the following case?
Consider the following function dsPrimakovdtnucleus:
...
0
votes
0
answers
32
views
5
votes
1
answer
129
views
Incorrect answer zero where correct answer is very large (precision issue)
Define a function F as follows:
F[α_, x_] =
N[Exp[x/2] Abs[Gamma[α/2 + I x /(2 Pi)]]^2, 10];
It is a product of two terms. ...
0
votes
0
answers
62
views
Answer changes slightly when re-run
I am trying to resolve why I get slightly different answers when I re-run my notebook. Here is my full code:
...
6
votes
2
answers
180
views
How to ensure for a solution of `NDSolve` to be positive?
I'am trying to solve kinetic equation for test particles in the Maxwellian plasma. It is Vlasov equation appended with Landau integral of collisions. It is proven that solution of such an equation is ...
2
votes
1
answer
69
views
Increase precision of matrix multiplication [closed]
I am computing U.U......U.x, where x is a vector, U a square matrix and the product involves N times U, i.e., (U^N).x if you like. One way to do this is
...
0
votes
0
answers
38
views
2
votes
3
answers
138
views
Accuracy and precision control for a simple calculation [closed]
Consider a very simple calculation: $231 \times (2.54) ^ 3$, which is the number of cubic cm in a US gallon.
On my phone app calculator I got the exact answer, which is $3785.411784$.
On Mathematica, ...
1
vote
1
answer
92
views
How do I speed up this numerical integration with Bessel functions? (Tried changing Working Precision and Integration Strategies)
I need to compute the function P[b] given as follows:
...
0
votes
1
answer
78
views
Accurate and efficient sampling of interpolated functions
Suppose we are given two interpolated functions
...
1
vote
1
answer
53
views
LinearOptimization and Accuracy
Surprised to encounter the following issue in handling Accuracy with LinearOptimization:
...
0
votes
1
answer
90
views
Is there any alternative for conditional plot that gives a more precise result in a shorter time?
I have the given function $Func$ and want to have a plot of those domains where $-3\leq Func\leq 3$ in precise details. I am using ...
1
vote
0
answers
66
views
How to handle "too small to represent as a normalized machine number" when plotting a figure [duplicate]
I am trying to plot a figure by the following codes:
Plot[(27 2^((-2 + a)/(-1 + a)) 5^(a/(-1 + a)) 7^(1/(1 - a))
a^2)/((-1 + a) (4 + 9 a)), {a, 1.001, 3}]
...
3
votes
3
answers
299
views
Equality of almost equal lists
Can you help me with this common problem I have?
Given two lists:
a={339.66666666666697`, -287.4444444444446`, 0.`}
and
...
1
vote
1
answer
44
views
Interval Arithmetic when calculating eigenvectors
Consider the following matrix with entries being intervals
...
1
vote
2
answers
246
views
How to prevent Mathematica from rounding some PDF values to 0?
Dear Mathematica community,
I'm having a problem with the PDF function for the hypoexponential distribution. Specifically, Mathematica returns 0 as soon as the value is very small. Below is an example:...
1
vote
1
answer
63
views
Using FindRoot and having problems with $MaxExtraPrecision
I'm trying to find the roots of the function radial, written below. And to make this, I'm using the function \[Omega]ini to ...
1
vote
0
answers
81
views
Kahan Compensated Summation
Is there an example/library that implements Kahan summation in Mathematica for matrix-matrix/vector-matrix multiplication?
Having some trouble adapting something like this Compilation of Total with ...
1
vote
0
answers
18
views
FindShortestPath failing with All even when GraphDistanceMatrix succeeds
Shortest Path routines are commonly used within more complex optimization methods that work to ensure there are no negative cycles even when there are negative weight edges. Often there are 0 weight ...
1
vote
0
answers
85
views
Am I losing precision in manually entered equations?
I am using the following code to calculate the two solutions of a quadratic equation in the variable t.
...
0
votes
1
answer
145
views
Floating point precision and speed [closed]
I am attempting to understand how to speed up the evaluation of numerical expression.
Specifically, following the first point of this blog, Mathematica is much quicker dealing with floating-point ...
3
votes
1
answer
297
views
Solution gets worse as I increase Precision and Accuracy goals
I am numerically solving the following ODE below.
If I set AccuracyGoal and PrecisionGoal both to 10 I get a solution that makes sense: constant and then damped oscillation.
However, all things equal, ...
9
votes
1
answer
302
views
IntegerPart - is this a known bug?
I'm working in Mathematica 13.0 and I type
a=0.00001;
IntegerPart[a/a]
and well, the output is 0.
Try with almost any other value of ...
1
vote
0
answers
37
views
Discrepancies in NDSolve Solution Between 4D and its Reduced 3D Counterpart
I have two systems, a 4D system and a 3D system. The 3D system is a reduction of the 4D system in such a way that:
...
5
votes
1
answer
112
views
Mathematica ignores precision requirement when evaluating a Legendre function
Bug persisting through 13.1.0 [CASE:4953269]
When attempting to calculate a certain associated Legendre polynomial within a given precision, Mathematica seems to ignore it if the argument is ...
0
votes
1
answer
79
views
How to improve the accuracy of integration with Bessel function without significant drop in performance?
Consider the following function and integral:
...
4
votes
2
answers
144
views
Adding numbers with defined precision produces incorrect result
I've tracked a bug in my code down to the problem of adding two numbers together, with the left argument having machine precision, e.g by 3` . The issue is, if ...
0
votes
0
answers
36
views
What does standard deviation mean when using Predict[]?
I am using the Machine Learning function Predict[data, Method -> "DecisionTree"], and I am trying to get the most accurate measurement of its accuracy. ...
0
votes
2
answers
191
views
Why this integral gives zero?
I would like to compute this integral for a =100, ... ,1500
$$ \int_1^\infty \dfrac{\left(x^2-1\right)^{3/2}}{x} \,e^{-ax}\, dx $$
...
1
vote
0
answers
52
views
Controlling accuracy for code
So I have a lot of trouble controlling precision and or accuracy with Mathematica. I have tried reading up for it but in the end I get even more confused. Here is my code, it is a little long but it ...
4
votes
1
answer
243
views
NIntegrate fails to converge to desired accuracy
I am calculating an integral with Mathematica. This is the code I am using:
...
0
votes
0
answers
26
views
Issues with ConvexOptimization and SetPrecision
I am completely new to Mathematica (second day), so do not expect things to look polished.
I am trying to perform a ConvexOptimization over a List/Array (dimensionality ...
1
vote
2
answers
86
views
Plotting high precision high degree polynomial
When I plot a high degree polynomial such as (available as CloudObject since it is too big to explicitly include):
...
1
vote
1
answer
106
views
Divide by zero warning: Actual division by zero or spurious?
I have the following code that calculates the gain of an amplifier
...
2
votes
2
answers
1k
views
Error "is too small to represent as a normalized machine number; precision \ may be lost " for small values in Plot
I'm trying to plot two curves but I'm having issues with the lower end of the range:
...
3
votes
0
answers
64
views
What's the best method to use when NIntegrating a sinx + cosx type function?
I'm having some problems when trying to NIntegrate a sinx + cosx type function. I have already tryed several combinations of ...
0
votes
1
answer
74
views
Confusion about precision [duplicate]
When I evaluate
x = 1.0000000000000000001 (* Precision of 20 digits *)
Mathematica returns
...
-3
votes
1
answer
102
views
long division acurate answer on dividing long numbers [closed]
ok but first of all if i have the huge number to be divided what will i have to use for the division to be accurate long division or some other formula square root or 2 this is to calculate music ...
4
votes
1
answer
345
views
Real number equality (==) not working: what's the least-overcomplicated solution?
I'm running a program that evaluates equalities after I substitute all symbols for numbers. The equalities on floats are giving me trouble. My program is reaching a point where something like the ...
0
votes
0
answers
39
views
How do change precision in coefficients in matrices
I alway have this kind of matrices...
obviously I would like to have 0s instead of 10^-15. I've tried with N[] function but doesn't work. Does anybody know how to proceed in this case?
1
vote
3
answers
117
views
Is the result given by NSolve sufficiently reliable to claim that there is such a solution for the equation?
I use this code for ContourPlot
...
0
votes
0
answers
36
views
Which result is more reliable in NMaximize in the given code? with `WorkingPrecision` or without it?
I have two functions $ f(x,y) $ and $ g(x,y) $ over the domains $ 1<x< 2$ and $0<y<\pi$. I use ContourPlot to ses those values of $(x,y)$ for which $g(...
0
votes
2
answers
122
views
How to calculate the maximum value of $x $ which satisfy the conditions $g(x,y)=0$ and $f(x,y)>1$?
I have two functions $ f(x,y) $ and $ g(x,y) $ over the domains $ 1<x< 2$ and $0<y<\pi$. I use ContourPlot to ses those values of $(x,y)$ for which $g(...
1
vote
2
answers
129
views
NSolve and FindRoot give a value which is not correct; how can I obtain the exact solution of the given equation? [closed]
I have two functions $ f(x,y) $ and $ g(x,y) $, I use this code
...
0
votes
0
answers
83
views
Crashing mathematica 12.3 with a simple ODE
I'm trying to solve an ODE using the following code:
...
0
votes
1
answer
102
views
RegionMember command alternative that can check members exactly?
My problem is as follows:
I have an exact rational polygon created using ConvexHullMesh and given a rational point I need Mathematica to decide exactly if it is ...
2
votes
2
answers
122
views
1
vote
0
answers
59
views
Accuracy issue in computing a Markov Transition Matrix
this question is based on a previous post of mine. I am simulating a one-dimensional Markov process on a linear graph. Transition probabilities are different than zero only for nearest neighbours of ...