31 votes
Accepted

Is Internal`StringToDouble broken in 12.3?

StringToDouble was renamed StringToMReal as part of code cleanup and the addition of several friends: ...
Itai Seggev's user avatar
  • 14.1k
17 votes

Numerical voodoo in mathematica?

To get exact output, use exact input (and please input your question using plain text Mathematica code that one can easily copy). ...
Nasser's user avatar
  • 143k
16 votes
Accepted

Solve Laplace equation in Cylindrical - Polar Coordinates

I think it is better to use Cartesian coordinates because one does not have to deal with the periodicity in p. To have control on the meshing of the the region, we tell Mathematica explicitly to ...
Matthias Bernien's user avatar
16 votes

Solve Laplace equation in Cylindrical - Polar Coordinates

Here is a analysis of all the problems related to Mathematica in your question. Briefly summarized, These are 3 problems : the lack of build-in tools to visualize the potential and vector field in ...
andre314's user avatar
  • 18.5k
15 votes
Accepted

Why does Abs return negative values?

It is a bug that will be fixed in the nearest release of Mathematica. It affects Abs/Sign of positive Root objects with third argument 1, for which the real root isolation algorithm produces an ...
Adam Strzebonski's user avatar
14 votes
Accepted

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

There are infinitely many (continuum) solutions and basically one cannot list them all e.g. because of the Cantor theorem. This is the reason why numerical approach is unsatisfactory. However we can ...
Artes's user avatar
  • 57.3k
13 votes

Numerical voodoo in mathematica?

The problems at hand comes from using inadequate numerical approximation. The equation behind is quite simple and it can be solved exactly, we put 10/3 instead of <...
Artes's user avatar
  • 57.3k
11 votes

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

direct implementation of Chudnovsky formula for reference: ...
george2079's user avatar
  • 38.9k
10 votes
Accepted

Is it possible to ask Mathematica to give the maximum value of a function over a specific domain?

NMaximize[{f[n], 1 <= n <= 10^6, n ∈ Integers}, n] (* Out: {63.041, {n -> 2}} *) You can then get the corresponding symbolic function value using your ...
MarcoB's user avatar
  • 67.2k
10 votes
Accepted

Problem with NDSolveValue

I will present an anisotropic meshing solution that will allow you to resolve a sharp normalized peak at the center of your cube. Many links applying this technique are in my answer to the question ...
Tim Laska's user avatar
  • 16.3k
9 votes
Accepted

Mathematica will not solve this numerical equation

...
Nasser's user avatar
  • 143k
9 votes
Accepted

Some Strange results from MMA and Matlab

The line Table[N[PHI30EQ[u], 30], {u, 0, 0.1, 0.001}] doesn't do what you think it does. You're asking for 30 digits of precision, but you supply ...
Sjoerd Smit's user avatar
  • 23.5k
9 votes

NDSolve giving a wrong solution

The general problem In using NDSolve to solve first-order IVPs, there are basically two ways to set up the ODE: ...
Michael E2's user avatar
  • 236k
8 votes
Accepted

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

Here is an adaptation of MATLAB code from Trefethen, Ten Digit Algorithms (2005), based on Borwein & Borwein, The Arithmetic-Geometric Mean and Fast Computation of Elementary Functions (1984) that ...
Michael E2's user avatar
  • 236k
8 votes
Accepted

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

Your problem is similar to a wave spectra problem and a regression problem, and I have both types of problems going on at work right now which is why I've thought about your problem a bit. Here is an ...
Chris Chiasson's user avatar
8 votes

N[..., 5] does not returns what I expected

The documentation for N says that N[expr, n] attempts to give a result with n-digit precision. In the Wolfram Language, or any ...
MassDefect's user avatar
  • 10.1k
7 votes
Accepted

How to plot output data of Do-command?

This is a good candidate for NestList ...
eldo's user avatar
  • 69.7k
7 votes
Accepted

Comparing exact expressions vs real numbers

PossibleZeroQ is rather fast and does precisely what you're looking for: RepeatedTiming[PossibleZeroQ[a - b]] {3.2*10^-6, ...
Roman's user avatar
  • 47.5k
7 votes

1-D PDE with nonlinear ODE as boundary condition

NDSolve currently can't handle coupled PDE and ODE, so let's discretize the system all by ourselves, but before that, I'd like to point out the system actually has ...
xzczd's user avatar
  • 66.2k
7 votes
Accepted

Why mathematica does not solve the equation $x\left \lfloor x \right \rfloor=10$ for $x$?

You can specify you want real solutions Solve[x*Floor[x] == 10, x, Reals]
Emmet 's user avatar
  • 356
7 votes
Accepted

Root finding: Is there no bisection method root finder?

There's a bisection method right here. Use bisect = ResourceFunction["BisectionMethodFindRoot"] ...
flinty's user avatar
  • 25.3k
7 votes
Accepted

Obtaining numerical value from Recurrence Table

a[1] = 2; a[n_] := a[n] = 4 Sum[a[i], {i, n - 1}] Table[a[n], {n, 1, 10}] {2, 8, 40, 200, 1000, 5000, 25000, 125000, 625000, 3125000}
Suba Thomas's user avatar
  • 8,741
7 votes
Accepted

NDSolve giving a wrong solution

The reason for that behavior seems to be a big logical bug in NDSolve. During calculation it seems to treat expressions like: ...
darksun's user avatar
  • 302
7 votes
Accepted

How to define a function to be numeric when the input is purely symbolic

Instead of unprotecting NumericQ, one can define an upvalue for h: ...
user293787's user avatar
  • 11.8k
7 votes
Accepted

Finding closed form representations of floating point numbers?

You can use the WolframAlpha function to ask for possible closed forms of a number: ...
Sjoerd Smit's user avatar
  • 23.5k
6 votes
Accepted

N[Product] and NProduct give different results

A bit of re-writing can get around this: ...
chuy's user avatar
  • 11.2k
6 votes

Why does this test yield True

Because there are no elements in your matrix. So there is no element which is not numeric and real. MatrixQ[{{}, {}}, False &] returns ...
meneken17's user avatar
  • 500
6 votes

Numerical voodoo in mathematica?

Read any basic article or chapter about rounding error. When substituting back, the computation that occurs is subtraction $10^{-15}$ (with 16 significant figures, hence 31 correct digits in the ...
Coolwater's user avatar
  • 20.3k
6 votes
Accepted

Visualizing the Schrödinger equation for dipole based interaction Hamiltonian

I think, the answer to your question is a straight forward one. You wanted to plot the solutions of your system, which can be done like this, ...
zhk's user avatar
  • 11.9k
6 votes

How to plot output data of Do-command?

You could use AppendTo to collect the output and then plot. However, I think you have made your recursion unnecessarily complex. You could do something like this: <...
ubpdqn's user avatar
  • 60.8k

Only top scored, non community-wiki answers of a minimum length are eligible