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
1
vote
0answers
40 views

Numerical evaluation after Normal? [closed]

I'm interested in numerical evaluation thru substitution: a /. a -> 1 (*=> 1 *) However if I used Normal in the "pipe" —...
0
votes
1answer
96 views

Numerical value of an expression with a uniform step size [closed]

I have a complex expression that is so difficult to separate its Real part from it Imaginary part. What I thought of doing is to get the numerical value of the Real and Imaginary part, Then I will use ...
0
votes
1answer
361 views

Specifying precision of a number in StringForm[]

I want to use StringForm to provide the headers to a table of numbers I have just calculated. Basically, I want the top row of spots in the table to have the form $D = x~~\text{(nm)}$, where x ...
3
votes
2answers
266 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 ...
0
votes
2answers
202 views

Numerical Differentiation of a Numerical Integral

I am trying to evaluate the following expression numerically $$\frac{d^2}{dt^2}e^{-2t^2}\int_0^\infty\frac{\xi/\sqrt{2}}{\xi^{3/2}}e^{(-\xi^2/2-2\xi t))}$$ My code is as follows ...
4
votes
1answer
94 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 ...
0
votes
1answer
90 views

How to fix step size in do loop? [duplicate]

I apply the following command: Do[Print[var[u] = u], {u, -1, 1, 0.1}] It produces out put. But when i recall the value var[-0.4] as below: ...
5
votes
3answers
295 views

How to complete function which is not defined for all interval

I have a function testF22 like this ...
0
votes
1answer
223 views

Solving a complex equation

I try to solve a complicated equation. To do that, I write (excuse me, I could not copy paste in an appropriate way from the notebook) ; ...
1
vote
1answer
123 views

Numeric calculation with many digits

I try to calculate something like 1.569732312*Pi and by default mathematica returns something like 4.93146 (only 5 digits after floating point), but I believe there is much more digits, especially ...
4
votes
1answer
114 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: ...
1
vote
0answers
78 views

Plotting the Full width at half maximum as a function of a parameter

I have this function and I want to plot the FWHM of it as a function of the parameter "a", defined between 0 and 10. It should look like the picture attached. I also put the original equation in case ...
3
votes
2answers
495 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 ...
1
vote
1answer
75 views

Getting non-real answers when assuming variable is real when trying to numerically find maximum entropy distribution

I'm trying to find the maximum entropy distribution as such: Assuming[Element[l, Reals], NSolve[Sum[Exp[l i] i/Sum[Exp[l j], {j, 0, 100}], {i, 0, 100}] == 50,l]] ...
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} ...
1
vote
1answer
186 views

NSolve/Reduce Help: 3Equations/5Variables

I have this system of equations that I have been trying to solve using Mathematica; I had been running this last evaluation for 30 hours and my computer crashed :/! So, instead of deciding to run ...
1
vote
2answers
54 views

Chains of approximate numeric equalities

Mathematica considers two numbers equal if "at most their last seven binary digits" differ. For example: ...
1
vote
1answer
465 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 ...
2
votes
1answer
66 views

What Heads do not have the attribute NumericFunction, but still give True in NumericQ?

The following expressions give True in the NumericQ test: ...
1
vote
1answer
106 views

Can't get a numerical value for this vector operation

I have written these codes: ...
1
vote
0answers
57 views

Why doesn't N[0.33333, 3] return 0.333? [duplicate]

Basic question, other answers I found didn't really seem to address this. N[x,3] seems to only work if x is analytic instead of ...
0
votes
2answers
134 views

I'm trying to solve a system of complex equations

I'm simply trying to solve a system of equations and mathematica can't do it for all values over the region of interest. I have a 3x3 matrix that has a specific parametrization and after squaring the ...
3
votes
3answers
193 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 ...
10
votes
3answers
724 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 ...
3
votes
2answers
121 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: ...
4
votes
1answer
506 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 "...
1
vote
0answers
103 views

Using Classifier with NearestNeighbors methods

I am using a Machine learning toolbox on mathematica. I have 8 classes. Training data: for each class, there 100 samples with size 160. I used this code. ...
0
votes
0answers
86 views

Maintaining working precision in my program

I am badly stuck with this program I am writing. I want output of program below to be precise up to 25 digits after decimal point. I am supplying all inputs with precision 25. But after each iteration ...
0
votes
1answer
94 views

How to calculate digits of Trott Constants?

How to calculate digits of numbers (Trott Constant) whose continued fraction representation is the same as the digits of its radix representation with Mathematica?
34
votes
2answers
731 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 ...
4
votes
2answers
193 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: ...
1
vote
1answer
528 views

How to find and express all polynomial roots with greatest precision?

I've already plowed through the documentation and a bunch of other Questions on this, but I've only found partial or tangentially related answers. I need numerical results for all of the complex ...
0
votes
2answers
846 views

How to make an Histogram where the data are strings? [duplicate]

Histogram[{3, 3, 2, 2, 2, 2, 2, 1, 1}] works great to give you an histogram in which mathematica counts the occurence of each number and makes the plot. Is there a ...
1
vote
0answers
83 views

Combining Manipulate and NDEigenvalues [closed]

I think there may be a quick solution to this problem which I can't seem to fix at the moment. The question is how do we eliminate the error in the following ...
2
votes
1answer
69 views

Non-integral common denominator

I have a list r = {114.49, 311.876, 538.704} whose elements are multiples of a non-integer value. I want to find the common denominator ...
2
votes
0answers
51 views

Differences in AbsoluteTiming for similar codes

Consider the two following codes with the same SeedRandom (which ensures the same set of random numbers) but different use of the ...
1
vote
2answers
214 views

How to solve this two algebraic equation simultaneously for u and H ?(all real number)

I want to find the non-zero value of H when beta is changing(especially what value of beta when increasing will there be a non-zero H value). H is between [0,100]. This is actually the calculation ...
1
vote
2answers
241 views

Significantly different results between Mathematica and Wolfram Alpha with large radicals and small numbers [closed]

I have some code which involves tiny numbers being put to the power of very large numbers. The function I'm looking at is $\varphi = \omega(T) \left(1 - (1 - \epsilon)^{n_{e}(T)} \right)$ when $\...
3
votes
2answers
332 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( ...
0
votes
1answer
357 views

Why does my function return an expression rather than a number? [closed]

I feel like I'm going insane. I have a function $f(x)=e^{-x^2}$ which I need to evaluate using forward, backward and central first order finite differences with intervals ...
9
votes
2answers
513 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 ...
1
vote
1answer
107 views

Determine whether one value is divisible by another [closed]

How do I determine whether one number is evenly divisible by another in the case of large numbers, for example: 52^52 / 52!
2
votes
2answers
693 views

Center column heading in TableForm

I have a TableForm as follows: ...
0
votes
1answer
86 views

Difference Eigenvector values in mathematica 9 and mathematica 10 [duplicate]

I have the following matrix; ...
1
vote
1answer
136 views

The problem (time) caused by ?NumericQ

In here, I asked a related (similar) question. Using ?NumericQ seems have slowed down the entire calculation. But I now have a more serious problem: ...
0
votes
1answer
161 views

Error with numerical summation - how to specify “n choose r”?

I'm trying to do the following sum: NSum[((50000 - x) choose x)*(1/3^15)^x*((3^15 - x)/3^15)^(50000 - x), {x, 1, 4}] But I keep getting an error saying: ...
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 ...
0
votes
0answers
157 views

Speed up numerical optimization (for plotting and solving)?

Briefly speaking, I want to plot a function PIfun[], which its value is based on numerical optimization using NMaximize. It ...
3
votes
1answer
146 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 ...
8
votes
2answers
294 views

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

Consider this code: ...