Skip to main content
32 votes
Accepted

What's the default colormap (or color scheme) used in mathematica?

"DefaultColorFunction" /. (Method/. Charting`ResolvePlotTheme[Automatic, ContourPlot]) "M10DefaultDensityGradient" ...
kglr's user avatar
  • 399k
31 votes
Accepted

Why Except is so slow as compared to equivalent RegularExpression?

Using StringPattern`PatternConvert we can find the regexp into which Mathematica converts the original string expression: ...
Alexey Popkov's user avatar
29 votes
Accepted

What's behind Method -> {"EquationSimplification" -> "Residual"}

This post contains several code blocks, you can copy them easily with the help of importCode. As mentioned in the comment above, the answer is hidden in this ...
xzczd's user avatar
  • 67.1k
28 votes
Accepted

What happens if you don't Reap what you've Sown?

Preamble This complements the answer of Roman with a few more details. Reap - Sow implementation is based on an internal object <...
Leonid Shifrin's user avatar
26 votes
Accepted

How was Nothing implemented?

Ok, I failed to find a duplicate so here is my comment: I don't know how Nothing is internally implemented but you can do something like this with ...
Kuba's user avatar
  • 137k
23 votes
Accepted

What is the definition of Curl in Mathematica?

The definition used (motivated by exterior calculus) is as follows: Given a rectangular array $a$ of depth $n$, with dimensions $\{d, ..., d\}$ (so there are $n$ $d$'s) and a list $x = \{x_1, ..., ...
jose's user avatar
  • 6,423
22 votes

Mathematica's morphological thinning algorithm

Prologue Some five years ago I have asked exactly this question to the Wolfram support people. Below I have taken their respective answers (one sentence for each ...
UDB's user avatar
  • 1,835
22 votes

What happens if you don't Reap what you've Sown?

It looks like there's no memory being used by Sow when there is no encompassing Reap. With ...
Roman's user avatar
  • 48.8k
20 votes
Accepted

Why does setting SyntaxInformation add a definition to DefaultValues

In my view, the Mathematica front end would have needed a complete rewrite a long time ago to be in a shape where it can compete with modern UI's. Looking at MATLAB, it's clear that you always find ...
halirutan's user avatar
  • 113k
19 votes

Is there a "precedence table" for the canonical Sort ordering?

So I think the docs are mostly clear, if hard to visualize. Here's my version of such a table: ...
b3m2a1's user avatar
  • 47k
19 votes

NDSolve uses different difference order for different spatial derivative when solving PDE

Note: fix is broken since v11.3, a new question has been started aiming at upgrade it. Here's my approach for fixing the difference order. The key idea is ...
xzczd's user avatar
  • 67.1k
18 votes

How do the functions Reap and Sow actually work behind the scenes?

I do not know how Sow and Reap are actually implemented, but to show you that it isn't magic, I can provide the following toy ...
Henrik Schumacher's user avatar
17 votes
Accepted

How does Mathematica calculate the Standard error during a non linear fit?

Rather than give formulas here is how to duplicate the results (coefficient estimates and standard errors) from NonlinearModelFit. First show the example from <...
JimB's user avatar
  • 42.1k
17 votes
Accepted

What stopwords list is the Wolfram language using?

A little spelunking of the code for DeleteStopwords[] yields the internally used stopword list: ...
J. M.'s missing motivation's user avatar
17 votes
Accepted

Why is FreeQ so much faster for some specific variable names?

TLDR: If you run into performance issues related to symbol names, rename your symbols such that System`Private`GetContentCode returns different values for each ...
Ray Shadow's user avatar
  • 7,846
17 votes

What's the principle behind the new MoleculeRecognize function?

Using ResourceFunction["PrintDefinitions"][MoleculeRecognize], one can determine that the source implementation is MolVec. The specific source code is: ...
Carl Lange's user avatar
  • 13.1k
16 votes
Accepted

How does Mathematica solve a certain differential equation?

@Nasser's method seems to be what Mathematica does internally. The following gives hints of the steps taken, and one can see the elements of Nasser's solution. Some is left to the user to guess. The ...
Michael E2's user avatar
  • 239k
16 votes
Accepted

Evaluated vs. unevaluated Association

Summary The confusion we observe here is largely due to ambiguous use of the symbol Association as an expression head. On the one hand, ...
WReach's user avatar
  • 69.1k
15 votes
Accepted

How does FunctionDomain work?

Evaluate ((x - 2) (x + 1))/((x - 2) (x + 3)) and see what it gives. It automatically simplifies to (1 + x)/(3 + x). The second ...
Szabolcs's user avatar
  • 236k
15 votes

What stopwords list is the Wolfram language using?

The stop-words are documented and can be looked up as (see Details section of WordList): WordList["Stopwords"] As it might be ...
Vitaliy Kaurov's user avatar
15 votes
Accepted

How do the functions Reap and Sow actually work behind the scenes?

I will make an exception to the usual practice I try to follow on this site, and fully replicate my post from this answer of mine here, since it answers this question just as directly or even more, ...
Leonid Shifrin's user avatar
14 votes

Accuracy of PrimeQ function

Turning my comment into an answer, One of the tests performed by PrimeQ for machine-sized integers, namely Miller-Rabin using up to the first 12 primes as bases (...
ilian's user avatar
  • 25.5k
14 votes

NDSolve uses different difference order for different spatial derivative when solving PDE

Complete control over the spatial decomposition of the PDE given in the answer by xzczd can be achieved by decomposing the PDE into a large set of ODEs, as described in the Introduction to the ...
bbgodfrey's user avatar
  • 61.8k
14 votes
Accepted

how to take ImageFeatures?

Some introduction Feature extraction is a very important idea in machine learning. It allows us to build a neural network based on some of the pretrained high-performance networks. This is also the ...
xslittlegrass's user avatar
14 votes

What's the default colormap (or color scheme) used in mathematica?

ColorData[97] is the default color scheme. The answer is found in a few different answers throughout this site. For example, Discussion of ...
user6546's user avatar
  • 1,069
14 votes
Accepted

Meaning of InterpolationOrder -> All for multidimensional interpolation

This is code that has been written many moons ago... here is an example: ...
user21's user avatar
  • 40.1k
14 votes
Accepted

Conflict with hidden names

First, you should never give Plus a downvalue. Always give your symbol upvalues instead by using TagSetDelayed. Giving such a ...
Carl Woll's user avatar
  • 131k
14 votes

What's the principle behind the new MoleculeRecognize function?

I am one of the authors of Molvec. It was designed in a classical approach using various image processing heuristics to guess the structure. While it's on my todo list, we still haven't published a ...
dkatzel's user avatar
  • 241
14 votes

FEM doesn't output exactly the same solution for exactly the same code?

You are right to expected that a deterministic algorithm should produce the exact same result every time it is run. And solving the linear equations of this elliptic PDE should be deterministic. Or ...
Henrik Schumacher's user avatar
13 votes

How does Mathematica solve a certain differential equation?

I also do not know how to tell Mathematica to give step by step. May be the Wolfram Alpha PRO version would show the steps? But this is how I would solve this by hand. Solve, where $u\equiv u\left( ...
Nasser's user avatar
  • 147k

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