Questions tagged [numerical-value]

Question relating numerical representations, operations and methods, including approximate results instead of exact symbolic results.

Filter by
Sorted by
Tagged with
34
votes
2answers
737 views

GroupBy twice gives different results

Bug introduced in 7.0 or earlier and persisting through 11.1 It took me quite a lot of time to finally trace down to this strange output. I really don't know why. First, I create a list ...
19
votes
2answers
825 views

Error and uncertainty propagation: Is using Precision/Accuracy a sound strategy?

Questions What are the available resources to deal with experimental error and uncertainty propagation in Mathematica? Given that Mathematica already uses linearized model of error propagation on ...
15
votes
3answers
2k views

Solve Laplace equation in Cylindrical - Polar Coordinates

Hey mathematica stackexchange!! I've got a (possibly stupid) problem. I've tried many things to no avail, and I've read every post I've found on Laplace's equation. Background: I'm trying to find the ...
10
votes
3answers
855 views

What is the fastest way to compute digits of $\pi$ using Mathematica?

There are a lot of ways to calculate digits of $\pi$ using Mathematica. The most naïve way I can think of is N[π, 100000000] Of course, there are a lot of fast ...
9
votes
2answers
516 views

Matching pair of numbers {a,-a}, where a is numeric

Imagine you have a list of pairs of numbers, such as {{2,-2}, {1,5}, {1,-3},{-3,3}} The task is to reduce the given list to a list of pairs of type ...
8
votes
5answers
2k views

Numerical voodoo in mathematica? [closed]

So, I was doing some calculations in Mathematica, and came across the following paradox! (I may be exaggerating, but...) I wanted to solve the following equation: $3.33333*10^{-15} - 3.33333*10^{-15} ...
8
votes
2answers
3k views

Could I define 0^0 to be 1? [duplicate]

Many occasions, where I need to work numerically with functions. For a variable strictly between 0 and 1, during the optimization, it could become 0.^0 or 0^0, which then become indeterminate. Is ...
8
votes
2answers
366 views

Why does N[Re@f] give complex result?

Consider this code: ...
8
votes
2answers
350 views

how to get single, and quad Precision out of Mathematica which match Fortran result

by default, if a number has decimal . after it, then Mathematica will do computation using machine Precision, which on my PC (intel hardware) running windows 7 64 ...
6
votes
4answers
139 views

Suppress trailing 0s in numerical values

For example, this is what I want In[1]:= N[Table[4^(i/4), {i, 1, 4}]] Out[1]= {1.41421, 2., 2.82843, 4.} But if I want a few more digits only from the irrational ...
6
votes
1answer
169 views

Machine precision infinity

Is it possible to obtain the machine precision (double) version of Infinity? This is useful when using LibraryLink and C ...
5
votes
3answers
242 views

How to plot output data of Do-command?

The following in a simple numerical solution of the simple harmonic oscillator. ...
5
votes
3answers
131 views

Different Methods in NIntegrate

I am trying to numerically calculate a multidimensional integral which involves Jacobi elliptic theta functions. The integrand is the following: ...
5
votes
3answers
327 views

How to complete function which is not defined for all interval

I have a function testF22 like this ...
5
votes
1answer
104 views

N[Product] and NProduct give different results

I have some trouble. I've been using finite product to study a certain function (see below). However, when I wanted to compute it precisely, I decided to use ...
5
votes
0answers
344 views

How does NSolve find the roots to an equation?

I'm using NSolve to find the roots to a transcendental equation. For this, I need to specify a bounded region where roots are searched. What I want to know is how <...
4
votes
1answer
340 views

DensityHistogram label/display values in Mathematica 8

I'm trying to make a DensityHistogram in Mathematica 8 that overlays the histogram values for each location. What I want is for the value of each square to be ...
4
votes
1answer
123 views

1-D PDE with nonlinear ODE as boundary condition

Recently, I am trying to solve a 1-D PDE with a nonlinear boundary condition using the function NDSolveValue. However, it seems that MMA (12) cannot solve it directly with some computational issues. ...
4
votes
2answers
213 views

Torus-geometry algebraic equations using NSolve and Reduce

Somehow a set of naive-looking equations cannot be solved by using NSolve. Mathematica returns a message like this: ...
4
votes
1answer
115 views

Why does this test yield True

I have this test implemented in my code, when I import a numeric matrix, which I thought would be bulletproof, but it's failing in this case: ...
4
votes
1answer
718 views

Fixed-Point Numbers in Mathematica

I am working with a library that needs input in a Fixed Point notation. I’d like to figure out a way to convert the floating point results into fixed point representation. The fixed point length is ...
4
votes
1answer
609 views

What does it mean that “there are no significant digits to display”? [closed]

So I substitued with the following values in my function T(x,n) and it gave me this red box with the value in the picture. When I hover over it, it tells me that there are no significant digits to ...
3
votes
2answers
578 views

How to obtain numerical solutions of a two-variable equation?

I have a two-variable function: f[x_, y_] := (4 y^2 - 6) (Cos[y π] Cos[x] - Cos[2 y π] Sin[x]) How can I find all the numerical solutions for $x$ and $y$ such ...
3
votes
2answers
656 views

Mathematica will not solve this numerical equation

I have the following equation: ...
3
votes
1answer
547 views

Recognize physical constants?

Is there some way to ask Mathematica to recognize physical constants, such as 32 or 9.81 (gravitational acceleration, in different units, at Earth's surface)? I have in mind something like the "...
3
votes
2answers
292 views

Visualizing the Schrödinger equation for dipole based interaction Hamiltonian

I want to evaluate and plot the solutions of coupled linear differential equations. For each time frame, I want to display the probability values (corresponding to mod square of these solutions), and ...
3
votes
2answers
468 views

Solving an equation approximately

I have a complicated equation in terms of $\omega$ and $\kappa$: ...
3
votes
2answers
191 views

NIntegrate on a solution of a matrix ODE

I've seen similar questions on this site but somehow the solutions there didn't manage to solve my specific problem. I have a function mat1 that takes a square $n \times n$ matrix G, and some final ...
3
votes
2answers
350 views

Creepy numerical artefacts of a closed-form solution

I'm wishing you a nice day and here is my problem: I tried to obtain relation between chemical potential and temperature in a semiconductor and I arrived at this equation: $$ 2 e^{-\Delta/kT} \left( ...
3
votes
2answers
157 views

Solving Equations with HeavisideTheta Functions

I need to solve an equation that involves the HeavisideTheta[] function, but regardless of the method I use Mathematica returns an error message. For example, <...
3
votes
1answer
116 views

Comparing exact expressions vs real numbers

Often I need to generate some data using some symmetry operations and I usually keep them as exact expressions (for example, consider the points on a triangular grid ...
3
votes
1answer
50 views

NumericQ and unknown number of variable in a module-block

I have the following problem I want to address in an elegant way. I have a function of many variables f[x, y, z,...] I want to find the minimum with ...
3
votes
3answers
223 views

How to change random values in manipulate?

I made a Manipulate box that is working very well, using lots of random numbers. I would like to add a button to "reset" (i.e. to change, randomize, or reselect) all the random parameters. Here's ...
3
votes
1answer
102 views

Laplace equation DirichletCondition ignored

My goal is to find out force between two parallel identical disks with Voltage difference. To solve this, I tried to use laplace equation. And below is my code. where R is radius of disks, d is ...
3
votes
2answers
257 views

How can one generate an open-ended sequence of low-discrepancy points in 3D?

I'd like a low-discrepancy sequence of points over a 3D-hypercube $[-1,1]^3$, but don't want to have to commit to a fixed number $n$ of points beforehand, that is just see how the numerical ...
3
votes
1answer
87 views

Proving the positive semidefiniteness of a 6X6 symbolic matrix

Specifically, I want to check the positive semidefiniteness of the following 6X6 symbolic matrix ...
3
votes
1answer
150 views

How to avoid rounding error, when exporting numerical values

How to avoid the rounding error, when exporting data like this: ra = Range[0.004, 0.074, 0.0005]; Export["range.txt", ra] The result is this:
3
votes
1answer
151 views

Inverse prediction function

I am trying to write a code which learns a data set. Now, I want to know the input value for a given output value. Consider, the following code ...
3
votes
1answer
64 views

How to use NDSolve to solve 1+1 D heat equation $u_t=u_{xx}$ with $ -\infty<x<\infty$ and $0\leq t\leq T$?

How to use NDSolve to solve 1+1 D heat equation $u_t=u_{xx}$ with $ -\infty<x<\infty$ and $0\leq t\leq T$? ...
3
votes
2answers
79 views

Checking NDEigensystem Results

I'm looking to verify the output of a call to NDEigensystem. I'm doing this by plotting the operator acting on the Interpolating Function outputs versus the ...
3
votes
1answer
181 views
3
votes
1answer
87 views

Numerical precision problem

I have this simple code: ep = 1 - 80000000000 (-(199999/200000) + 1/E^(1/200000)) ep // N -8.27404*10^-8 ...
3
votes
1answer
139 views

Why does NSolve give different results in different version of Mathematica?

I am working on a problem with a colleague who uses Mathematica v.10.2 while I have v.11.0 Student Edition. We are solving the exact same equations but get two slightly different results. Why would ...
3
votes
2answers
605 views

Plot numerical solutions for a varying parameter

I would like to solve this equation $\log{\frac{a}{1 - a}} + b (1 - 2 a) = 0$ letting varying the parameter $b$ in $\lbrace 0,1,\ldots,20\rbrace$ and then plot the result. I am trying writing the ...
3
votes
2answers
132 views

Role of Accuracy in numerical evaluations, SplitBy vs GatherBy

This is a follow-up question to this question. I generated a list by substituting the results of a solve[] routine and set: ...
3
votes
1answer
94 views

Is this bifurcation or numerical error?

I encountered a definite integral (with parameter $k$) that produces the "chaotic" figures below. $$F(k) \equiv \int_{\theta_k}^{\theta_{k+1}} f(\theta, J \sin\theta - k)\,\mathrm{d}\theta~, \qquad f(...
3
votes
1answer
80 views

Numeric values for MinkowskiQuestionMark

Why NumericQ[MinkowskiQuestionMark[Pi]] returns False? Is it defined only for algebraics? Numerical evaluation gives some number,...
3
votes
1answer
127 views

Solve a system of 4-th order polynomial equations (numerically)

I have a function defined on $ S^6 \times S^6 $ (two spheres embedded in $ \mathbb{R}^7 $ individually). Let us call this vector $ \vec{f}(\vec{x},\vec{y}) $, where $ \vec{x} $ and $ \vec{y} $ are ...
3
votes
1answer
153 views

How to make Mathematica substitute exact numerical values of (derivatives) 2F1

I have a long output that contains Taylor expansion of some function. Some of the coefficients are combinations of the (derivatives of) 2F1 at nice integer values of the coefficients. I can see that ...
3
votes
1answer
274 views

Dealing with square roots [duplicate]

Consider following expression: $$ \sqrt{-\left(2 \sqrt{x^{-8/3}-x^{-4/3}+1}\, x^{4/3}+5\right) x^{4/3}+4 \sqrt{x^{-8/3}-x^{-4/3}+1}\, x^{4/3}+2 x^{8/3}+5} $$ In code: ...