jose
  • Member for 8 years, 2 months
  • Last seen this week
  • Champaign, IL, United States
User interface Mathematica 12.1 terribly slow
27 votes

Dataset was restructured in the 12.1 release in order to support expanded formatting options and interactivity such as hiding and sorting. As a result, some Dataset outputs showed a slowdown due to ...

View answer
What is the definition of Curl in Mathematica?
Accepted answer
20 votes

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, ..., ...

View answer
Plot a partition of the sphere given vertices of polygons
16 votes

What about some 2D Geo functionality for this? points = {{-0.9207, -0.3896, 0.0091}, {-0.8272, 0.5077, -0.2399}, {0.2544, -0.3511, 0.9010}, {0.3510, 0.6527, 0.6712}, {0.5436, -0.6326, -0.5513}, {0....

View answer
Recognizing special cases of a defined function for permuted arguments
16 votes

I think you need to use a group-theoretical construction. In this way you will have full freedom in specifying any group of permutations you need. In your case the group is G = PermutationGroup[{...

View answer
Extract bathymetry data from a map
Accepted answer
15 votes

I take a screenshot of your image and assign it to the image variable. In[2]:= ImageDimensions[image] Out[2]= {1326, 1150} This computes the positions of the lines in your image: In[3]:= lines = ...

View answer
Why does the GeoGraphics Frame show different Latitude than GeoPosition?
Accepted answer
14 votes

This is not a bug. When dealing with a map there are two different coordinate systems you need to handle, related by the cartographic projection you are using. First you have the {lat, lon} ...

View answer
Are Easter days normally distributed?
12 votes

This is code to compute Easter Sunday for each year (the "Computus"), from Gauss, in the proleptic Gregorian calendar: computusGauss[year_Integer] := Module[{a, b, c, d, e, f, g, h, i, j, k, month,...

View answer
Annulus from GeoDisks: drawing a ring on a map
Accepted answer
10 votes

You can use something like this: p = Entity["City", {"NewYork", "NewYork", "UnitedStates"}]; rOut = Quantity[2000, "Miles"]; rIn = Quantity[1000, "Miles"]; GeoGraphics[FilledCurve[{{GeoCircle[p, ...

View answer
Improving performace of `GeoDistance` and `NearestNeighborGraph`
Accepted answer
9 votes

There are a few things that can be improved here: Don't call {"Latitude", "Longitude"} separately in EntityValue. It's better to use the "Position" property, that ...

View answer
How can I show the relative size of two GeoGraphics objects?
Accepted answer
9 votes

Due to the non-sphericity of the Earth, there is no exact way of rotating a polygon, but the following is a good approximation. Suppose we want to rotate the UK polygon so that London is moved to ...

View answer
Does GeoGraphics support Elliptical Mercator projection?
Accepted answer
9 votes

Yes, it is possible to use the ellipsoidal Mercator projection by specifying an ellipsoidal "ReferenceModel" in the projection. To compare, let me define a spherical Mercator projection: In[1]:= ...

View answer
Calculating Rubiks $ 2 \times 2 \times 2 $ Permutation using Cycles
Accepted answer
8 votes

I think some of the rotations must be corrected: rot1 = Cycles[{{1, 2, 4, 3}, {5, 24, 9, 7}, {6, 23, 10, 8}}]; rot2 = Cycles[{{21, 22, 24, 23}, {1, 11, 20, 10}, {2, 5, 19, 16}}]; rot3 = Cycles[{{11, ...

View answer
GeoDistance - higher spatial resolution / precision?
Accepted answer
8 votes

The problem here is that the geo circle is being resolved into a line as if you were drawing the full primitive, with insufficient resolution for very low scales. To alleviate that, use segments of ...

View answer
Rotate Geographic map
7 votes

A possible way to rotate a map is to use the freedom provided by an oblique projection. Obliqueness adds the three degrees of freedom of a general 3D rotation, namely the {lat, lon} coordinates of the ...

View answer
Generating different GeoPaths for multiple equivalent segments
7 votes

Let me propose an alternative, very similar in spirit to Chip's idea, but avoiding the use of the internal GeoGraphics`GeoEvaluate. I'll base the construction on a L-type displacement that moves a ...

View answer
How to import data about mountain and then plot it?
Accepted answer
7 votes

GeoElevationData has elevation data for the whole world. If you know the position (I hope I interpreted correctly the Wikipedia data from your link): In[]:= p = GeoPosition[{FromDMS[{42, 19, 32.}], ...

View answer
Orthogonal Geodesics to Solar Eclipse Geopath
Accepted answer
7 votes

Take the points of the geo path, and thread the GeoPosition head to have a list of individual geo positions: points = Thread[gpath[[1]]]; Take them in pairs and compute the direction from the first ...

View answer
GeoPosition coordinates from Shape file (.SHP) with unknown Datum
7 votes

My approximation to that projection is proj = {"Stereographic", "ReferenceModel" -> "Bessel1841", "GridOrigin" -> {155000, 463000}, "Centering" -> {52.1562, 5.38764}, "CentralScaleFactor" -&...

View answer
Create group from multiplication table
Accepted answer
7 votes

The multiplication table is itself a list of permutations of a representation of the group so you can do In[1]:= m = {{1, 2, 3, 4}, {2, 3, 4, 1}, {3, 4, 1, 2}, {4, 1, 2, 3}}; In[2]:= G = ...

View answer
Generate symmetric random tensor
Accepted answer
6 votes

Along the same lines of the answer by Daniel Huber, I think what you need here is this combination: RandomSymmetrizedArray[dims_, sym_, dist_] := Normal@ SymmetrizedArray[_ :> RandomVariate[dist], ...

View answer
Nice use case for symbolic tensors?
Accepted answer
6 votes

Tensor simplification can be an expensive computation, so it is not performed automatically. You need to use TensorReduce on symbolic tensor expressions, like you would use Simplify in more general ...

View answer
How to plot countries with accurate area?
Accepted answer
6 votes

The area-preserving projections are listed in GeoProjectionData["EqualArea"]. Most of these projections have formulas for the sphere only, but some of them, like "Albers" or "LambertAzimuthal" in WL ...

View answer
How to understand the symmetry of MMA's tensor
Accepted answer
6 votes

Symmetric[{1,2,3}] means that all six permutations of {1,2,3} are symmetries of the tensor: Equal[tensor, Transpose[tensor, #]] & /@ Permutations[{1, 2, 3}] (* {True, True, True, True, True, True}...

View answer
Perform matrix/tensor contractions more efficiently
6 votes

I think the simplest way to handle the general case is to use TensorProduct and TensorContract, as follows: Take a rank 3 array for example, in dimension 100: In[1]:= A = RandomReal[{-1, 1}, {100, ...

View answer
Combine Stereographic "Entity" Plot of Arctic Sea with Contour Plot
6 votes

I think you first need to start by generating the graphics with ListContourPlot. For example, take this arbitrary data as a 31x31 matrix: data = Table[Exp[-(90 - lat) Degree] Cos[lon Degree] + ...

View answer
Computations in the exterior algebra
6 votes

Suppose we work with objects in some symbolic dimension dim: In[1]:= $Assumptions = (e[1] | e[2] | e[3] | e[4]) \[Element] Vectors[dim] && (a | b) \[Element] Matrices[{dim, dim}, ...

View answer
Orthogonalizing polynomials with inner product depending on parameters
Accepted answer
6 votes

Define your scalar product of the h polynomials: p[h[n_], h[m_]] := 16 Pi S Sum[Binomial[8 S + 2, k] (8 S + 1 - n - m - k), {k, 0, 8 S - n - m}] / (2^(8 S + 1) (n + m + 2) (n + m + 1) Binomial[8 S + ...

View answer
Mixed product identity between tensors in Mathematica 9
Accepted answer
6 votes

You could also do $Assumptions = (a | b | c | d) \[Element] Matrices[{k, k}] KroneckerProduct[a, b] . KroneckerProduct[c, d] // TensorExpand which returns KroneckerProduct[a.c, b.d]

View answer
How to delete duplicate graphics of the same kind?
Accepted answer
5 votes

Here is a suggestion from group theory: We need to define an action on squares for the eight elements of DihedralGroup[4]. In general, it would be enough to define it for the two generators and then ...

View answer
How to generate all $ 3 \times 3 $ matrices with $ a,a,a,a,b,b,b,c,c $?
5 votes

Let me give a GroupOrbits approach, imitating many aspects of the accepted solution. Start again with all permutations of the elements: list = {a, a, a, a, b, b, b, c, c}; perms = Permutations[list]; ...

View answer