## Chapter 2Year 2020

### 2.1 Thursday, December 24, 2020

#### 2.1.1 Top new questions this week

##### These PDE’s no longer evaluate in version 12.2 as they did under 12.1. What can be done to make them evaluate under 12.2?

These 399 PDE’s no longer produce result under Version 12.2 on windows. DSolve now returns unevaluated. These all evaluated under version 12.1. Why is that? And ...

##### Travelling around Jupiter

Since we have soon historical conjunction of Jupiter and Saturn I have prepared code with visualization planet Jupiter and Saturn with moons. This code ﬁrst been prepared for version 11.3 and with ...

##### Numerically evaluating parameter derivatives of a hypergeometric function

I am unable to obtain the numerical value of the derivative of the hypergeometric function. Please note that the (2,4,0,0) is the derivative with respect to the ﬁrst and second argument

##### Numeric Solution Hydrogen Atom

I’m trying to solve the Schrödinger equation for the hydrogen atom without made the variable separation of the polar and radial coordinate. It is my test code to extrapolate to another system with its ...

##### Sum cause a Recursion problem

Sum[((-1)^(i + 1)*Binomial[n, i]*(n - i)!)/n!, {i, 1, n}]

This cause a Recursion problem.

As the comment said, If simplify the formula and then sum it, problem ...

##### Is it possible to ask Mathematica to give the maximum value of a function over a speciﬁc domain?

I have a function $$f(n)$$ over $$n\in \mathbb {N}$$. I want to know its maximum value over a very large domain, say $$n=1,2,3,4,...,10^6$$. Is there a way to ask Mathematica to give me the maximum value of ...

##### Unrolling a surface

The surface is determined by this parametric equation ParametricPlot3D[{Cos[],Sin[],z(2+ Cos[])},{,-Pi,Pi},{z,0,1}]

How to unfold the surface in Mathematica? ...

#### 2.1.2 Greatest hits from previous weeks

##### Conversion of Sine to Cosine

I’m solving equations with many Cosines and Sines. And I want to convert all the Sines to Cosines using trigonometric formulas such as cos(x)=sin(x+pi/2). How can I do this?

answered by Sjoerd C. de Vries https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=57 1 vote

##### How to ask Mathematica to imitate Andy Warhol’s pop-art painting?

I tried to ask Mathematica to imitate Andy Warhol, let it convert a Marilyn Monroe’s portrait so that it looks like Warhol’s world famous pop-art painting. However, the result shown below is far from ...

##### Plot, extract data to a ﬁle

I need to save data that Mathematica uses inside the Plot command. The format that I would like to have is:

x1 y1
x2 y2
.....

##### My Girlfriend is going to prison...Save her with Math

Salacious title, but true story.

##### How to create animated snowfall?

Well, the title is self-explanatory. What sorts of snowfall can we generate using Mathematica? There are two options I suggest to consider:

1) Continuous GIF animations with smallest possible number ...

##### Parallel and perpendicular symbol from Mathematica to LaTeX

I want to get the following expression from Mathematica to LaTeX:

$\begin {bmatrix} E_{\parallel } \\ E_{\perp } \end {bmatrix}$

I have tried to use inbuilt 'symbol' character from the special ...

##### 1 Plot, 2 Scale/Axis

I would like to plot those two datasets on top of each other. But they have very diﬀerent range on the $$y$$ axis. How can I have two diﬀerent axis?

I found the following on the help menu but quite ...

#### 2.1.3 Can you answer these questions?

##### How to determine if a number is an integer power?

How can I do simple tests like determining if an integer is a power of 2? Mathematically, the result below should be True, and I understand why it doesn’t work on MMa, but how do I do this test ...

asked by Jerry Guern https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=20042 1 vote

##### dot product of vectors with noncommutative elements

I came upon an interesting problem. Suppose you have three vectors $$\psi =(a, b)$$, $$\phi =(c,d)$$ such that their components do not commute: $$ac\neq ca$$, $$bd \neq db$$ etc. (in general the vectors may ...

asked by geom https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=68502 1 vote

##### How to Inherit Arrowheds size?

I’m trying to write a Module that produces some arrows with custom Arrowhead shapes. However, I want the code external to the

asked by Wynne https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=36616 1 vote

### 2.2 Thursday, December 17, 2020

#### 2.2.1 Top new questions this week

##### Plotting the Star of Bethlehem

Christmas is around the corner! In preparation, consider the polynomial f[x_,y_]:= 1/10 (4 - x^2 - 2 y^2)^2 + 1/2 (x^2 + y^2)

and deﬁne $$r=(f_x,f_y)$$ using the ...

##### Opacity gradient in custom legend

I need to produce the legend of a plot which encodes a color gradient together with a color gradient. In particular, I would like the image bellow to have the blueish edge faded and the redish solid:

##### Circle Packing in Cone Texture

This is a cone with texture generated by PatternFilling in plane. The problem this texture mapping is not conformal. So my question is how to generated a pattern image which could suit a ﬁxed height ...

##### Is there a Mathematica CUDA ode solver?

I have a system of ODEs which I’d like to solve with many (thousands) diﬀerent initial conditions. In the net there are articles that CUDA can speed up such computations, but I haven’t found ...

##### How to properly use the function ThermodynamicData

I’ve been trying to use the function ThermodynamicData, and it is going ﬁne when I try to calculate properties such as Enthalpy or Entropy or even phase as a ...

##### How do I reorder and combine sublists based on sublist rankings given by another list?

I have two lists:

##### How to convert cuboid to mesh eﬃciently

cuboids =
Table[Cuboid @@ (pts = RandomReal[100, {2, 3}]), {i, 10000}];

Method1:

#### 2.2.2 Greatest hits from previous weeks

##### Mathematica code for Bifurcation Diagram

At the moment I am trying to construct a bifurcation diagram of the iterative function $$f(x)=$$ $$ax-1.1975x^3$$. I’ve scoured the internet for pre-made bifurcation diagrams and found many (mostly of the ...

##### What are the most common pitfalls awaiting new users?

As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ...

##### Calculate the 2D Fourier transform of an Image

I am new to Mathematica, and using version 8.0.

I would like to calculate the 2D Fourier Transform of an Image with Mathematica and plot the magnitude and phase ...

##### How to make the digits of go around in a spiral like this?

Here is a start.

MapIndexed[Text[Reverse[First[RealDigits[Pi,10,252]]][[Tr@#2]],#]&,
Table[{t Cos[t],t Sin[t]},{t,0,16Pi,0.2}]]//Graphics

##### How to make a Spherical Cow?

Being a theoretical physicist, I always have a great respect for Spherical Cow. So I thought about making one myself. I am not sure how can I create (something considered to be the simplest!) this ...

##### How can I plot a graph of an integral?

I want to plot the following function:

$\int \left (\frac {\Gamma (x+1)}{2}-\frac {\Gamma (x-1)}{2}\right ) \, dx$

##### How to tell Mathematica that certain variables are real/imaginary, integer-valued, etc

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=66273 I’m trying to expedite some quantum mechanical calculations (expectation values etc.) by running them through Mathematica. When I say, for example,

#### 2.2.3 Can you answer these questions?

##### Interpolation for diﬀerent Parameters

I am rather new to Mathematica and I tried to ﬁnd a solution for my Problem on my own, also looking through this site and the suggested Similar Questions, but I at least could not make out that my ...

asked by n00bBoi1 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=76302 1 vote

##### Problem in iterative equation

I am solving the following iterative equation to calculate Tf and Cp as a function of temperature:

An initial attempt for a ...

##### Importing equations generated in subpackage to be solved in another subpackage

I have a package which contains two subpackages: one ("MOTSimulatorMOTGenerator") which generates a systems of diﬀerential equations of the form

asked by crich https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=76216 1 vote

### 2.3 Thursday, December 10, 2020

#### 2.3.1 Top new questions this week

##### Find the equidistance curve between two curves

I have three function $$f(x)=x^x$$, $$g(x)=\ln (x)^{\ln (x)}$$, $$h(x)=\ln (x)^2$$ and I want to ﬁnd (numerically) $$C$$ the center of the circle tangent to the three curves.

I think that one way is to ﬁnd ...

##### Confused by results of FunctionDomain

Why does Mathematica give me the function domain of $f(x)=(2x-3)^{\frac {1}{5}}-(2x+1)^{\frac {1}{5}}-(x - 3)^{\frac {1}{5}}$ as $$x\geq 3$$? I used this command:

##### Cannot reproduce well-known summation result

Bug introduced in 4.2 or 5.0, persisting through 12.2.0.

Note: this is a repost of my OP on math.SE. I am posting it here because multiple users with diﬀerent Mathematica versions have given me the ...

##### Is there a way to get tooltip for parts of a string?

Is there a way to get the tooltip to appear for parts of a string?

##### Nice use case for symbolic tensors?

I come from before the times of symbolic tensors in Mathematica, and am used to working with concrete tensors and custom commands to contract them using Transpose, Dot, etc. I recently realized that ...

##### Drawing hollow disks in 3D with an sphere in center and small spheres on the rings

I was trying to draw the following logo of an atom using Mathematica, but I could only ﬁgure out how to draw intersecting ellipses, not a nice logo like below. Do you have any idea? And is ...

##### Solve‘DirInf[] Meaningful value or just a bug?

Bug introduced in 4.1 or earlier and persisting through 12.2.0. or later

To the problem below, I get four independent, incomplete solutions, three in terms of ...

#### 2.3.2 Greatest hits from previous weeks

##### Why is raytracing so slow?

I’m trying to get some rays to bounce in a circle. But I want to be able to control the reﬂections, i.e. the direction the rays bounce in the circle. I have a MWE below, and it is severely limited by ...

##### Generate a Unit Circle Trigonometry

Struggling often with Trigonometry I would like to have some code to generate this Unit Circle Trigonometry. Would be of great help when I need to transform some data :

##### Drawing a square root spiral

Here is a start. I’m looking for a nice way to draw it.

##### How do I make a 3DPlot using cylindrical coordinates?

I’m trying to plot a function of the form $$z(r,\theta )$$ where $$r \in [0, R]$$ for a ﬁnite R, $$\theta \in [0,2\pi [$$, and z is the third coordinate, a function of the ﬁrst two. I couldn’t ﬁnd anything ...

##### How to calculate contour integrals with Mathematica?

How to calculate the integral of $$\frac {1}{\sqrt {4 z^2 + 4 z + 3}}$$ over the unit circle counterclockwise for each branch of the integrand?

##### Skip header lines on import

When importing a data ﬁle what are the comment symbols for Mathematica? That is, given a ﬁle like this

blabla
bulbul

1 2 6 54 7 ...

what symbol do I have ...

##### Using Export[] sends the ﬁle where?

I am trying to use the Export command to convert a list of plots into a *.gif ﬁle, and the command runs and executes well, but I can’t ﬁnd the ﬁle! Where is it ...

##### Periodical sum of rows by a certain step

I’ve been struggling with one problem. I have a classic matrix in this example 12x4 such as: matrix = Table[i, {i, 12}, {4}]

##### HankelTransform problem

Somewhere in the following code there is a bug. The result should not be zero! FunctionExpand@HankelTransform[Sqrt[r] Cos[r], r, k, 1/2]

I think the answer should ...

asked by SolutionExists https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=70331 1 vote

### 2.4 Thursday, December 3, 2020

#### 2.4.1 Top new questions this week

##### Interpolation on an unstructured mesh

This may have a duplicate but I have spent some time looking and can’t ﬁnd it. I have experimental data in the form of { {x1, y1, z1}, {x2, y2, z2}...} I wish to interpolate it so my thoughts turned ...

##### Tower of Pisa function

I’m trying to construct a ’smooth’ function $$f : \mathbb {R}^2 \longrightarrow [0,1]$$ such that all level sets $\{ x | f(x)=y\}$ are circles in a way that $$f$$ looks like the ’Leaning Tower of Pisa’.

##### How can I ingest and analyze benchmark results posted at MSE?

How can I ingest Mathematica / WL benchmark results posted at Mathematica Stack Exchange (MSE), like the ones posted here? Assumptions:

There are multiple answers with benchmarks posted

##### Construct a polyhedron from the coordinates of its vertices and calculate the area of each face

I have the 3D coordinates for a set of points. I want to construct the convex polyhedron with those points as vertices.

I know I can use functions like DelaunayMesh

##### Make an InterpolatingFunction periodic

Interpolation can make an InterpolatingFunction periodic with the option ...

##### How do I place the Clock arrows inside this clock face?

I am trying to program a clock, I have the face I want and the hands but I can not seem to put them together so they work.....

##### How can I sketch a right-angled triangle?

I would like to replicate this ellipse, but with a right-angled triangle (with smooth/rounded corners). The formula for this ellipse:

#### 2.4.2 Greatest hits from previous weeks

##### Elegant operations on matrix rows and columns

Question

The Mathematica tutorial has a section ’Basic Matrix Operations’, describing operations like transpose, inverse and determinant. These operations all work on entire matrices. I am missing a ...

##### Positioning axes labels

I need to change the position of my axes labels such that the y-axis label is in the middle and parallel to the y-axis. I’d also like the x-axis label to be in the middle of the x-axis rather than ...

##### How to create word clouds?

Word clouds are rather useless fancy and visually appealing plots, where words are plotted with diﬀerent sizes according to their frequency in a corpus. Many applications exist out there (Wordle, ...

##### How do I clear all user deﬁned symbols?

Is there some way to do this other than going to Evaluation -> Quit kernel and ﬁring a new one up?

##### What does # mean in Mathematica?

I asked Mathematica to compute the following

Solve[c (1-x)^2-x^(1/4) == 0, x]

and it returned this:

  x = Root[#1^8 c^4 - 8 #1^7 c^4 + 28 #1^6 c^4 - 56 #1^5 c^4

##### How to manipulate 2D plots?

When it comes to visual analysis, large datasets or data with intricate internal details often makes plotting in 2D useless, as the outcome is either just a fraction of the full dataset, or no details ...

##### How to make an inkblot?

How to eﬀectively create a polygon that looks like a realistic inkblot? So far, I could come up with this (borrowing from Ed Pegg Jr.’s Rorschach demonstration):

#### 2.4.3 Can you answer these questions?

##### What is the fastest way to get the lowest eigenvalue and corresponding eigenstate in Mathematica?

I tried to use the Arnoldi method to get the smallest eigenvalue and corresponding eigenstate for large matrix. However, Arnoldi did not give me the desired result:

##### How do I get built-in functions to use custom objects as if they were e.g. List?

Overview: My goal is to create a custom object -...

##### How to speed up this code (ﬁnding eigenvector with smallest eigenvalue)?

I have following code. The function TraceSystem is to take partial trace of matrix and I think this part is ﬁne. The main code is below in dd and I think the main problem is in here for Eigenvector. ...

asked by lol https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=40838 1 vote

### 2.5 Thursday, November 19, 2020

#### 2.5.1 Top new questions this week

##### 3D Inclusion with structured mesh and coarse and arbitrary matrix

I am wondering if there is a simple way to deﬁne a structured 3D mesh (inclusion) like e.g. that and surround it with a corse and unstructured Matrix. It should be possible to reﬁne both more or ...

##### Smoother jelly / water eﬀect on an image

I’m trying to achieve a jelly / water surface eﬀect. I’d like it to be a bit smoother. Here I am taking a triangulated rectangle and perturbing all points by a little random noise for each frame. ...

##### Can Mathematica be used to edit MP3 tags?

Can Mathematica edit mp3 tags? I have a set of ﬁles and I’d like to batch process artist, album title, etc. I know other tools exist; I wonder if Mathematica can do it.

##### How can I put the edge of a rectangle inside it rather than outside it?

Problem: when I draw a rectangle and put a coloured edge around it, the displayed edge is centred along the nominal edge and if it follows the same course as one of the axes then it does not show up. ...

##### How do I invert my matrix?

I have the following matrix $$M$$:

\begin{bmatrix}
P & p & 0 & 0 \\
pe_1 & Pe_1 & \sqrt{P^2 - p^2}q_1 & \sqrt{P^2 - p^2}r_1 \\
pe_2 & Pe_2 & \sqrt{P^2 - p^2}q_2 &
\end{bmatrix}

##### How to convert a Dataset into an indexed dataset / association-of-associations given a column header?

Given a dataset as such

If "letter" is the header that is chosen, how do I convert it into an indexed dataset / association-of-associations? i.e. How do ...

##### Automatically draw chords from n-1 points on a circle to a ﬁxed point on the circle

I want to put n equally spaced points on a circle and automatically draw chords from all points to a ﬁxed point preferably P(0,0). I have managed to draw the points and the circle so far with

#### 2.5.2 Greatest hits from previous weeks

##### How to ﬁnd the position of elements in a list satisfying criteria

Say I have a list x={2,4,6,8,10} and I want to ﬁnd out the positions of the elements that are greater than 7.

##### Finding Limits in several variables

Is there a way to ﬁnd a limit of a multivariable function, like

$\lim _{(x,y)\to (0,0)} f(x,y)$ with Mathematica?

When $$f$$ is continuous, we can use $\lim _{(x,y)\to (0,0)} f(x,y)=\lim _{(x,0)}$

##### Why round to even integers?

According to the Mathematica help:

Round rounds numbers of the form x.5 toward the nearest even integer.

For example:

Round[{0.5, 1.5, 2.5, 3.5, 4.5}]

gives

##### Why is raytracing so slow?

I’m trying to get some rays to bounce in a circle. But I want to be able to control the reﬂections, i.e. the direction the rays bounce in the circle. I have a MWE below, and it is severely limited by ...

##### How do I identify the source of a "Tag times protected" error?

I have some code that looks like

Table[
a = 1;
b = {2, 3}
c = i;,
{i, 2}
]

which gives an error:   Set::write: Tag Times in c {2,3} is Protected....

##### Mathematica command that allows it to read my intentions

In version 2.0 of Mathematica there was a command, ReadProgrammerIntentions[ ] which allowed it rapidly compose code that could solve problems simple to complex, ...

##### How to make a Spherical Cow?

Being a theoretical physicist, I always have a great respect for Spherical Cow. So I thought about making one myself. I am not sure how can I create (something considered to be the simplest!) this ...

#### 2.5.3 -Can you answer these questions?

##### Setting pieces of "matrices" - unwanted behavior

I am constructing matrices whose elements are lists themselves (of varying length), and am (re)setting the entries of these matrices using among others the "All" command. It seems that in ...

##### system of coupled nonlinear pdes with FEM (magneto-hydrodynamic mass transfer)

I’m trying to reproduce the magneto-hydrodynamic ﬂow studied here using the nonlinear FEM functionality, and have been having trouble implementing the Neumann boundary conditions. Pardon the long ...

asked by George Varnavides https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=41179 1 vote

##### Create a Cellular Automata rule in Mathematica

I want to create an image in a cellular automata, more speciﬁcally an image of an object, like a turtle for example. I found this article online, and i am trying to replicate the results for growing ...

### 2.6 Thursday, November 12, 2020

#### 2.6.1 Top new questions this week

##### How to cut a list by max sum

 {5, 10, 3, 8, 9, 8, 8, 4, 1, 7}

let maxsum=20, then I get ...

##### Is it possible to ask Mathematica to stick two plots together to give a continuous plot ? (An example is given)

I want to plot a function over a large range of $$x$$. The problem is that for very large $$x$$, even increasing PlotPoint to $$5\times 10^6$$ and MaxRecursion 15, it does not give the whole result. But I ...

##### ReplaceAll, Unexpected output

Each week I import a dataset, and every week the dataset diﬀers in length (the number of records). After the import I need to do some transformations. One of these transformations is the ReplaceAll.

##### Find All Permutations for Multiset

Take a list with repetitions, say {a, a, b, c}, and some permutation thereof, say {c, a, b, a}. I want to know which ...

##### Counting the number of edges between two graph partitions

Consider the following:

g = RandomGraph[WattsStrogatzGraphDistribution[1000, 0.1, 5]]
comm = FindGraphPartition[g, 2];
CommunityGraphPlot[g, comm]

##### Summing over Partitions

Imagine I have a list of integers $$l=\{l_1,l_2,...,l_{50}\}$$, say, for example

l = RandomInteger[10, 50]

and I want to ﬁnd how many ways there are of summing ...

##### Incomplete web image scraping

Occasionally when I scrape images from a webpage, such as:

Import["https://www.freeart.com/gallery/m/mondrian/mondrian.html", "Images"]

only a ...

#### 2.6.2 Greatest hits from previous weeks

##### Positioning axes labels

I need to change the position of my axes labels such that the y-axis label is in the middle and parallel to the y-axis. I’d also like the x-axis label to be in the middle of the x-axis rather than ...

##### How to perform a multi-peak ﬁtting?

I am wondering how to implement the multi-peak detecting and ﬁtting in Mathematica. Following is an example of ﬁtting the data using three peaks (such that the data ~ peak1 + peak2 + peak3). The ...

##### How to generate a random snowﬂake

'Tis the season...

And it’s about time I posed my ﬁrst question on Mathematica Stack Exchange. So, here’s an holiday quest for you Graphics (and P-Chem?) gurus.

What is your best code for generating ...

##### Figuring when the minute and hour hand coincide on a clock

I would like to list all possible times in a 12-hour period, where the hour hand overlaps the minute hand completely. This is really a question about three distinct things - to be done in Mathematica ...

##### Is there an open source implementation of Mathematica-the-language?

I’ve seen questions before such as "What is the best open-source equivalent for Mathematica?", but that speciﬁc question (and that line of inquiry in general) cares more about the computer algebra ...

##### How to make a Spherical Cow?

Being a theoretical physicist, I always have a great respect for Spherical Cow. So I thought about making one myself. I am not sure how can I create (something considered to be the simplest!) this ...

##### What’s the most diﬃcult multidimensional integral that Mathematica has solved?

I am interested in benchmarking numerical integration methods and am trying to develop a wider set of diﬃcult multivariate examples. For my particular methods, I only want to look at non-negative-...

#### 2.6.3 Can you answer these questions?

##### Solving $$E[abXab]=Y$$ for Gaussian $$(a,b)$$

I have $$d/2$$-dimensional variables $$a,b$$ jointly distributed as Gaussian($$\mu ,\Sigma$$) in $$d$$ dimensions, and need to solve the following equation for $$X$$ $E[ab^TXab^T]=Y$ This is equivalent to ...

asked by Yaroslav Bulatov https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=217 1 vote

##### Problem with RunProcess

I’m trying to use the RunProcess function to run docker on Mac OS using Mathematica. But there is a problem:

asked by Wei Li https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=75601 1 vote

##### Does NumberLinePlot give the whole results over a large domain? Or we need to increase its precision?

I use this code over the domain $$x\in (0,300)$$

asked by charmin https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=74550 1 vote

### 2.7 Thursday, November 5, 2020

#### 2.7.1 Top new questions this week

##### Why is there a discrepancy between JoinedCurve/FilledCurve and the underlying BSplineCurve segments?

This may be related to How to discretize a BezierCurve?, but this question deals with BSplineCurves with speciﬁc SplineWeights, ...

##### Converting an equation with units to one without units

I may have a solution but it is not slick! See below Doing numerical calculations with functions that use units can be very slow. I would like to have a function or operator that can turn my functions ...

##### Generate an e machine graph from transition probability matrices

I am trying to generate this type of graphic:

see Fig.1a from https://arxiv.org/abs/0905.3587. This process is associated with two transition matrices

##### Deconvolution approaches for 3D data

Building neural nets in the WL is great. I was in the process of rewriting a previous GAN of mine in the WL to see if I can get better performance, and was surprised to ﬁnd that the standard ...

##### construct a lattice with a deﬁned unitcell

We can construct a base-centered tetragonal unit cell by: LatticeData["CenteredTetragonal", "Image"]

But how can we construct a lattice by

##### How to remove Null plot markers in QuantilePlot?

Bug introduced in 12.0 and persisting in 12.1.1

I want to change the plot markers of the data points in QuantilePlot. This seems pretty straightforward:

##### Split in non-overlapping sub-lists with elements within an interval from the ﬁrst member

I want to split a large ordered list into consecutive non-overlapping sub-lists, such that all elements are within an interval from the ﬁrst member of the sub-list . For example:

#### 2.7.2 Greatest hits from previous weeks

##### Code that generates a mandala

My little brother asked me to print original mandalas for coloring. I would like some idea on how to create them, but without color, so he can color them.

##### How to create word clouds?

Word clouds are rather useless fancy and visually appealing plots, where words are plotted with diﬀerent sizes according to their frequency in a corpus. Many applications exist out there (Wordle, ...

##### How can I draw the Olympic rings with Mathematica?

How can I draw the 5 interlocking Olympic rings with Mathematica? (SVG version) Edit

Hard choice, but some pretty cool answers here. I didn’t have 3D answers in mind when I posted the question, but ...

##### Calling Correct Function for Plotting DiracDelta

I am wondering what is the correct function in Mathematica to plot the true impulse function, better known as the DiracDelta[] function. When using this inside of a ...

##### How to create eﬀect like Van Gogh’s stroke brush?

I need to apply Van Gogh’s stroke brush eﬀect to a random image Take the following image as an example:

Thank you so much if you could help!

##### Parallel and perpendicular symbol from Mathematica to LaTeX

I want to get the following expression from Mathematica to LaTeX:

$\begin {bmatrix} E_{\parallel } \\ E_{\perp } \end {bmatrix}$

I have tried to use inbuilt ’symbol’ character from the special ...

##### Help ﬁnd a bright object on Mars!

In today’s news, scientists found a bright object on one of Curiosity’s photos (it’s near the bottom of the picture below). It’s a bit tricky to ﬁnd - I actually spent quite some time staring at the ...

#### 2.7.3 Can you answer these questions?

##### How can I determine and then plot a conﬁdence bands in QuantilePlot?

Does anyone know if its possible to plot a conﬁdence band in QuantilePlot? I haven’t been able to ﬁnd any documentation for this, or a previous example on here.

##### How to remove the smallest term from asymptotic expansion?

It is well-known that $$e^{-1/x}\sim o(x^n)$$ as $$x\to 0^+$$ for any $$n\in \mathbb {N}$$, thus if I do an asymptotic expansion for a function, say $$f=1/(1-x)+e^{-1/x}$$ as $$x\to 0^+$$, I expect to receive an ...

##### Solving the following system of integrodiﬀerential equations: speed up of the code

Consider a system of equations

asked by John Taylor https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=41058 1 vote

### 2.8 Thursday, October 29, 2020

#### 2.8.1 Top new questions this week

##### Dynamically drag graph vertices

Is it possible to make a dynamic graph with an ability to drag vertices? In other words let vertices behave like Locators and change its ...

##### Display Number with SI preﬁxes

I have a number of val = 0.000015783 which represents a current value in Amps. I want to display it with 3 signiﬁcant digits and with SI preﬁxes instead of the ...

##### Understanding the proﬁler: Is pattern matching/de-structuring expensive?

I was proﬁling some code and I am trying to understand what the results mean. Suppose we have the very idiomatic,

##### How to select the fastest approach for large numerical data computations?

I really love the ﬂexibility of Mathematica: there are several ways to perform one task. However, to get the performance of the intense numeric calculation, it can ...

##### Performance of pure function - Best way to deﬁne a function?

In general, to deﬁne a function, we often use f[x_]. Another way is to use pure function (full form and shorthand). I want to test the performance of these ...

##### Font style inconsistency on "number sign" (hashtag) and "at symbol"

Why number sign "#" (known as hashtag symbol on social media) or at sign "@" are not consistent with the ...

##### Solving a Nonlinear Complementary Problem (plasticity)

I would like to solve the following: given $$t\mapsto \sigma (t)$$ and $$E>0$$, $$\sigma _y>0$$, ﬁnd $$\epsilon$$ such that:

#### 2.8.2 Greatest hits from previous weeks

##### Crack CAPTCHA using deep learning

Deep convolutional neural networks are very good at computer vision related tasks. Optical Character Recognition (OCR) is one important branch of computer vision. In fact, the convolution neural ...

##### Why I get the "Set::write: "Tag Times in is Protected." error?

Why I get the error below with this code:

##### What do the X and Y axis stand for in the Fourier transform domain?

In Wolfram Mathematica the function Fourier has the following declaration

Fourier[list]

And after a list is given to the ...

##### Where can I ﬁnd examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I’m always looking out for ways to either improve my way of doing things in Mathematica, or to see if there’s something nifty that I haven’t ...

##### How to calculate scalar curvature Ricci tensor and Christoﬀel symbols in Mathematica?

I am seeking a convenient and eﬀective way to calculate such geometric quantities. I’ve used packages like TensoriaCalc, but they don’t work at all time. Sometimes,...

##### How to add a front-end to the free Wolfram Engine?

The Free Wolfram Engine for Developers is available for pre-production ...

##### Plotting Complex Quantity Functions

Trying to plot with complex quantities seems not to work properly in what I want to accomplish. I would like to know if there is a general rule/way of plotting when you have complex counterparts in ...

#### 2.8.3 Can you answer these questions?

##### How to deﬁne a derivative of a function at some point?

Consider a function  derivative[x_]:=D[Sin[x],x]

When calling it with some argument, like derivative[2], instead of $$\cos (x)$$ it gives me $$\partial _{2}\sin (2)$$. Is ...

asked by John Taylor https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=41058 1 vote

##### Insuﬃcient memory problem in Mathematica

I am trying to initialize a 48600 x 48600 packed array from a sparse matrix and a diagonal matrix in Mathematica 8. If S1 is a sparsearray of that size then and S2 is list of 48600 length, then I am ...

##### Classify; how UtilityFunction matrix is applied to resolve prediction?

I can’t ﬁnd any explanation about the details of the real computation, please anybody knows?

asked by pablo https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=61453 1 vote

### 2.9 Thursday, October 22, 2020

#### 2.9.1 Top new questions this week

##### How can I reproduce this mandala with Mathematica?

I found this image on the Internet and it is very beautiful. How can I reproduce it? The ideal would be to be able to control the colors of the outside as well as the center.

##### Tennis Racket theorem

Torque-free Euler equations experiment seen in low gravity of Russian spacecraft is modelled here with a view to see its tumbling motion around the intermediate axis $$\omega _2$$ rotation. However its ...

A fun combinatoric puzzle that’s popped up in my work that I think would be cute to have a Mathematica solution to, if anyone wants to give it a go. It’s basically a ladder climbing/descending problem ...

##### Remove inner brackets

If I have the result

##### Identify the Vertices and Lines around the edges of a free surface - Mesh/DiscreteGraphics

To write a mesher that closes a mesh surface using an implied surface from a boundary spline curve and mesh generated using DiscreteGraphics, I need to identify the Vertices and Lines around the edges ...

##### How can I extract the edge points from an image?

I want to extract the edge points from a text image and use ListPlot[points] to visualize those points:

I tried to used ...

##### How to speed up integers ﬁnding function?

Playing with integers I looked for a way of ﬁnding, let’s say, $$4$$-digits positive integers such that $$a,b,a+b$$ had the same digits, like $1089 + 8019 = 9108$ I am a newbie and I used this function

#### 2.9.2 Greatest hits from previous weeks

##### Where can I ﬁnd examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I’m always looking out for ways to either improve my way of doing things in Mathematica, or to see if there’s something nifty that I haven’t ...

##### Plotting a Phase Portrait

I’m trying to plot a phase portrait for the diﬀerential equation $x'' - (1 - x^2) x' + x = 0.5 \cos (1.1 t)\,.$ The primes are derivatives with respect to $$t$$. I’ve reduced this second order ODE to ...

##### How can I save both the plot and the legend together?

In this example, how can I put the legend inside the graph? Currently, when I save the graph, only the graph is saved, not the legend.

##### Find eigen energies of time-independent Schrödinger equation

I’m trying to get the eigenvalues of a one dimensional time-independent Schrödinger equation,

$$-\frac {h^2}{2m_0}\frac {d^2\psi }{dx^2}+U(x)~\psi =Ei~\psi$$

where U(x) is some potential and Ei is the ...

##### xkcd-style Plots

I received an email to which I wanted to respond with a xkcd-style graph, but I couldn’t manage it. Everything I drew looked perfect, and I don’t have enough command over ...

##### How to create a new "person curve"?

Wolfram|Alpha has a whole collection of parametric curves that create images of famous people. To see them, enter WolframAlpha["person curve"] into a Mathematica ...

##### How to plot an ellipse?

I’m new to Mathematica, and I’m ﬁnding it diﬃcult to plot an ellipse. I tried using

Plot[(x/5)^2 + (y/3)^2 == 1, {x, -5, 5}, {y, -3, 3}]

but I’m getting ...

#### 2.9.3 Can you answer these questions?

##### Equation of Motion: Perturb Scalar Field and ﬂat FLRW Metric (xAct)

Is there a way to get the equations of motion (eom) of a scalar ﬁeld from a Lagrangian in a perturbed FLRW metric? I want to perturb the ﬁeld as well as the metric to 1st order. What I did so far:

asked by kalle https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=68748 1 vote

##### Is there any way to change the box-formatting behavior thoroughly?

Background The box-formmating behavior is aﬀected by the downvalues of the symbol MakeBoxes. But the formatting behavior is not exactly ...

##### How to get colors at points in Graphics3D?

To get the color at a 2D point in Graphics you can Rasterize it and look up the pixel value, but not for ...

### 2.10 Thursday, October 15, 2020

#### 2.10.1 Top new questions this week

##### How can I plot my ﬁnancial indicator below a trading chart (produced by TradingChart) with the same x-axis?

Since this question was not answered, I would like to ask again with some additional information. I have a trading chart saved as chart1 as follows.

##### Adding elements of second list in succession
t1 = {{1, 2}, {3, 4}};
t2 = {{a, b, c}, {e, f}};

I want to add in succession elements of list 2 to list 1 to get:

##### Has the Undo command really been settled? On version 12.1 it only works sporadically. What are some reasons it drops steps?

Although Undo has been around since version 10 (before my time) I’ve noticed that sometimes it works just ﬁne up to the moment of the last ...

##### Solving heat equation on a cylinder with insulated ends and convective boundary conditions

I am trying to solve heat equation on a cylinder whose ends are thermally insulated and its circular face is exposed to convection. Therefore I have Neumann boundary condition on all faces of the ...

##### Converting a RawBoxes object to a workable expression

I have manged to turn an image into a RawBoxes expression. How do I turn in back into something I can use in Graphics In ...

##### Mean age of people

I have the following datas:

I want to ﬁnd mean age by using following formula,

Any way to do this in general in Mathematica easily.

##### Suggestion bar still causing Kernel crashes?

On Mathematica 12.1.1, Windows 10. When Suggestions bar is active, entering and evaluating the following crashes the Kernel.

#### 2.10.2 Greatest hits from previous weeks

##### How to express trigonometric equation in terms of of given trigonometric function?

How can I express a trigonometric equation / identity in terms of a given trigonometric function?

using following trigonometric identities

##### Elegant operations on matrix rows and columns

Question

The Mathematica tutorial has a section ’Basic Matrix Operations’, describing operations like transpose, inverse and determinant. These operations all work on entire matrices. I am missing a ...

##### What do the X and Y axis stand for in the Fourier transform domain?

In Wolfram Mathematica the function Fourier has the following declaration

Fourier[list]

And after a list is given to the ...

##### Figuring when the minute and hour hand coincide on a clock

I would like to list all possible times in a 12-hour period, where the hour hand overlaps the minute hand completely. This is really a question about three distinct things - to be done in Mathematica ...

##### Code that generates a mandala

My little brother asked me to print original mandalas for coloring. I would like some idea on how to create them, but without color, so he can color them.

examples

##### How to generate a random snowﬂake

’Tis the season...

And it’s about time I posed my ﬁrst question on Mathematica Stack Exchange. So, here’s an holiday quest for you Graphics (and P-Chem?) gurus.

What is your best code for generating ...

##### Extract real part of a complex expression better than Re does

I have a complex expression with real positive variables only.

Mathematica Input Style:

#### 2.10.3 Can you answer these questions?

##### Passing input from a textﬁle into a function

I have a text ﬁle which is a list of numbers and would like to pass each number in the list as input to a Mathematica function. For example, my text might contain [2, 1, 4], and I would like to pass ...

asked by Joshua Steier https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=75099 1 vote

##### How to get the coeﬃcients of second-order Runge-Kutta formula coherently?

The form of the second order Runge Kutta formula is as follows(the following is from page 287 of this book):

asked by A little mouse on the pampas https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=42417 1 vote

##### Taking "intermediate" limits, e.g. $${\cal X}\to 0$$ but $${\cal X}/\epsilon \to \infty$$ as $$\epsilon \to 0$$ - *without* taking $$\epsilon \to 0$$ directly

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=232859 I have an expression that I would like to take limits of but not in a conventional sense. Take for example, an expression like

This expression involves intermediate variables

asked by epsilonD3LT4 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=75082 1 vote

### 2.11 Thursday, October 1, 2020

#### 2.11.1 Top new questions this week

##### What is a good way of perfoming operations on speciﬁed columns of a table with many columns

If I have a table of data and I want to do a speciﬁc operation on say the third column, I usually do something like this:

##### Quickest way to test whether array is constant

At the moment I use Length[ DeleteDuplicates[ array ] ] == 1 to check whether an array is constant, but I’m not sure whether this is optimal. What would be the ...

##### Solving a rotating combination lock puzzle

The following puzzle appears in The House of da Vinci II and I thought it might be interesting to tackle in Mathematica:

There are numbers marked on four rotating cylinders. These numbers must add up ...

##### Shortest way to make a checkerboard pattern

I’m looking for the shortest (in terms of characters) code snippet to make an n-square checkerboard. Here’s my ﬁrst try (comes in at 72 characters):

##### Smoothing the Region?

There is a 2D Pi

I successed transformed it to 3D.

##### How to replace only the isolated variable x?

I want to replace the variable x in the result, not x in unrelated x[i]

##### Counting Elements in Multiple Lists

How to build a table that counts how many times each element in mainlist occurs in lst1, lst2, lst3, lst4 and which lst1, lst2, lst3, lst4 contains that element. For example, in mainlist, element ...

#### 2.11.2 Greatest hits from previous weeks

##### What does # mean in Mathematica?

I asked Mathematica to compute the following

Solve[c (1-x)^2-x^(1/4) == 0, x]

and it returned this:
x = Root[#1^8 c^4 - 8 #1^7 c^4 + 28 #1^6 c^4 - 56 #1^5 c^4 ...

##### Where can I ﬁnd examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I’m always looking out for ways to either improve my way of doing things in Mathematica, or to see if there’s something nifty that I haven’t ...

##### How do I identify the source of a "Tag times protected" error?

I have some code that looks like

Table[
a = 1;
b = {2, 3}
c = i;,
{i, 2}
]

which gives an error:
Set::write: Tag Times in c {2,3} is Protected....

##### How to create a new "person curve"?

Wolfram|Alpha has a whole collection of parametric curves that create images of famous people. To see them, enter WolframAlpha["person curve"] into a Mathematica ...

##### Mathematica 10.0.x freezes in Initializing kernels

Bug caused by paclet update and ﬁxed by paclet update.

I updated to Windows 10 and have been running Mathematica ﬁne on it for over a month. For some reason, it has just stopped working. I don’t ...

##### Extract real part of a complex expression better than Re does

I have a complex expression with real positive variables only.

Mathematica Input Style:

##### Calculate the 2D Fourier transform of an Image

I am new to Mathematica, and using version 8.0.

I would like to calculate the 2D Fourier Transform of an Image with Mathematica and plot the magnitude and phase ...

#### 2.11.3 Can you answer these questions?

##### Simplify Equation with variable unequal to zero

How can I simplify the following equation with Mathematica assuming z!=0? I have the following code:

asked by Franz Ferdinand https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=74882 1 vote

##### ﬁnding primes using chebyshev bias

Using the problem from my previous question link. For each n, that is n= $$10^3$$ to $$10^6$$ with a ten-fold increase, how do I use Chebyshev Bias to display the number of primes (which are in the ...

asked by complab56 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=74866 1 vote

##### Why does NDSolve not give consistent results?

This is my code:

asked by S.J.E. Huisman https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=74858 1 vote

### 2.12 Thursday, September 24, 2020

#### 2.12.1 Top new questions this week

##### Solving the Lotka-McKendrick model with NDSolve

The Lotka-McKendrick model is a demographic model that represents the way a population changes over time due to fertility and mortality. For an age-speciﬁc population density $$u(a, t)$$, and a total ...

##### Nonlinear dispersal equation modeling insect aggregation

I’m a newbie with Mathematica, I know it’s a basic answer, but I can’t solve the problem on my own. I have the following equation reﬂecting insect aggregation at low population densities (taken from ...

##### Making a faster alternative for PatternSequence

I need to improve a pattern or switch an approach. It is best described by an example For a hierarchy/order given by a list e.g.:

order = {1, 2, 3}

and a list:

##### How can I get material property data past what’s provided via ElementData?

Background Let’s say I want information (e.g. bulk modulus or space group) on an element or chemical compound that isn’t available via e.g. ElementData[]

##### DSolve does not return solution to simple system of second order PDEs

I’m trying to solve a simple system of second order PDEs with Mathematica 11.1. Here is the system:

##### Build the following symmetric array

My mind is a bit cloudy and I can’t quite pinpoint the pattern here that will allow me to write an elegant piece of code to build the following symmetric matrix of for a given size ...

##### Evaluate section by button click

I have a section in my notebook devoted to unit testing, since I’m not comfortable to use the built-in system. I’d like to evaluate the entire section by button click. But I get lost in the notebook ...

#### 2.12.2 Greatest hits from previous weeks

##### Assign the results from a Solve to variable(s)

I understand Mathematica can’t assign the results of a Solve to the unknowns because there may be more than 1 solution. How can I assign the 4 values of following result to variables?

##### Finding unit tangent, normal, and binormal vectors for a given r(t)

For my Calc III class, I need to ﬁnd $$T(t), N(t)$$, and $$B(t)$$ for $$t=1, 2$$, and $$-1$$, given $$r(t)=\{t,t^2,t^3\}$$.

I’ve got Mathematica, but I’ve never used it before and I’m not sure how to coerce ...

##### Multivariable Taylor expansion does not work as expected

The basic multivariable Taylor expansion formula around a point is as follows:

$f(\mathbf r + \mathbf a) = f(\mathbf r) + (\mathbf a \cdot \nabla )f(\mathbf r) + \frac {1}{2!}(\mathbf a \cdot \nabla )$

##### xkcd-style Plots

I received an email to which I wanted to respond with a xkcd-style graph, but I couldn’t manage it. Everything I drew looked perfect, and I don’t have enough command over ...

##### What’s the most diﬃcult multidimensional integral that Mathematica has solved?

I am interested in benchmarking numerical integration methods and am trying to develop a wider set of diﬃcult multivariate examples. For my particular methods, I only want to look at non-negative-...

##### Drawing a square root spiral

Here is a start. I’m looking for a nice way to draw it.

##### Get a "step-by-step" evaluation in Mathematica

Is it possible in Mathematica to get a step-by-step evaluation of some functions; that’s to say, outputting not only the result but all the stages that have led to it? If so, how does one do it?

#### 2.12.3 Can you answer these questions?

##### How can I make NDSolve aware of vectorial nature of an ODE?

I am trying to solve the equilibrium equation $$\text {DIV } \mathbf P(\textbf {u}(x,y)) = \mathbf {f}$$, where $$\mathbf P$$ is the stress tensor deﬁned by $\mathbf P = \mathbf F + (1-\det \mathbf F)$ asked by rmk236 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=74782 1 vote

##### NDsolve Boundary Condition is a Function of the Solution

I am trying to solve something like Fick’s Law using NDSolve

$\frac {\partial \varphi }{\partial t}=\frac {\partial ^2 \varphi }{\partial r^2}+F(r,t)$ Subject to a ...

asked by UranylTrioxide https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=74775 1 vote

##### Optimizing a graph-theoretic piece of code

I have written the following piece of code:

### 2.13 Thursday, September 17, 2020

#### 2.13.1 Top new questions this week

##### Display hexagon grid to visualize Langton’s ant

I am looking to recreate the following image from this reference as

using Mathematica’s Polygon documentation under "Applications" as a starting point. I want to eventually use Mathematica ...

##### Position function error

I recently upgraded from Mathematica 6 to the most recent version. In my new version the Position function returns strange results that were not present in the old ...

##### Mathematica 12.1.0.0 exporting low quality images at high ImageResolution

I recently upgraded from Mathematica 11 to Mathematica 12.1.0.0 . I understand there were some UI changes to accommodate high resolution monitors. I’m not sure if this issue is related to that. I am ...

answered by Piotr Wendykier https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=9239 1 vote

##### How can I count the color pixels in each partition of the image

I have a image of 1000 x 1000 pixels of which I have made 5 x 5 partitions. After that I am looking for a way to count number of color pixels in each partition. Thanks in advance for help.

##### Why does Nearest not return both equally distant values?

Deﬁne the following three vectors:

a = {0., 0., 0.};
b = {-0.5, 0.4330127018922193, 0.25};
c = {-0.5, 0., 0.};

Note that the distance from a to c is the ...

##### BarChart does not display asymmetric error bars correctly

BarChart seems to read the uncertainty in elements the other way around. The object: Around[5, {1, 10}] is evaluated as . However, when you use it in a BarChart, the uncertainties are swapped:

##### Pattern-matching complex numbers as a + bi

I just started working with Mathematica and am toying with pattern matching. There may be something obvious I’m missing in this, but I can’t ﬁgure it out by myself. I want to write down a function ...

#### 2.13.2 Greatest hits from previous weeks

##### Plot, extract data to a ﬁle

I need to save data that Mathematica uses inside the Plot command. The format that I would like to have is:

x1 y1
x2 y2
.....

##### How to calculate scalar curvature Ricci tensor and Christoﬀel symbols in Mathematica?

I am seeking a convenient and eﬀective way to calculate such geometric quantities. I’ve used packages like TensoriaCalc, but they don’t work at all time. Sometimes,...

##### How can I improve Mathematica’s resolution on a macbook retina display?

Mathematica 9.0 looks a bit fuzzy on the retina screen, how can I increase the resolution? Here another screenshot showing a direct comparison between the browser and Mathematica

##### Code that generates a mandala

My little brother asked me to print original mandalas for coloring. I would like some idea on how to create them, but without color, so he can color them.

examples

##### How to create eﬀect like Van Gogh’s stroke brush?

I need to apply Van Gogh’s stroke brush eﬀect to a random image Take the following image as an example:

Thank you so much if you could help!

##### Find eigen energies of time-independent Schrödinger equation

I’m trying to get the eigenvalues of a one dimensional time-independent Schrödinger equation,

$$-\frac {h^2}{2m_0}\frac {d^2\psi }{dx^2}+U(x)~\psi =Ei~\psi$$

where $$U(x)$$ is some potential and Ei is the ...

##### How to ﬁnd the position of elements in a list satisfying criteria

Say I have a list x={2,4,6,8,10} and I want to ﬁnd out the positions of the elements that are greater than 7.

#### 2.13.3 Can you answer these questions?

##### Faster alternative to ImageCorrespondingPoints?

I’m trying to use ImageCorrespondingPoints to register frames in a video sequence. Computational speed is an important consideration for the application I am ...

##### How to make this expression?

How to code this expression in WolframAlpha. I am interested in how to code the second sum, because it contains a boolean expression: $\sum _{i=1}^{100}{\sum _{j>n}}{x_{i}x_{j}}$

asked by Andrey Stebenkov https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=74632 1 vote

### 2.14 Thursday, September 10, 2020

#### 2.14.1 Top new questions this week

##### Can we use Mathematica to design an electronic active ﬁlter?

How can we use Mathematica to design an electronic implementation of an active ﬁlter?

##### How to mesh a French biscuit (modulated ellipsoid)

I would like to create a boundary mesh of the following ellipsoid, whose thickness is modulated along its long axis:

The surface parametrization I used for it is:

##### Solutions for searching over Mathematica notebooks?

I have hundreds of Mathematica notebooks accumulated over the years, and I’d like to search over them. I’ve been using various versions of text search (grep, SilverSearcher, Spotlight), but there are ...

##### Coordinate-free derivative

Given the function $f:v\mapsto \dfrac {v}{\|v\|},$ I would like to compute the derivative of $$f$$, that is $$df(v)$$. It is possible to derive it by hand, which leads to

##### Please explain this syntax: GaborWavelet[6]["FourierFactor"]

I’ve been using Mathematica for some years, yet I’m befuddled by this statement: GaborWavelet[6]["FourierFactor"]

It appears to give the center frequency ...

##### How to select several columns from a dataset

I have a dataset with 20 columns. For a analysis I need all columns except the columns 9 and 11. What I do is:

##### BarLegend ticks distorted in MatrixPlot

As shown in many threads here (this, this, ...), Ticks is a valid option of BarLegend.

But it doesn’t seem to work well in this ...

#### 2.14.2 Greatest hits from previous weeks

##### Help ﬁnd a bright object on Mars!

In today’s news, scientists found a bright object on one of Curiosity’s photos (it’s near the bottom of the picture below). It’s a bit tricky to ﬁnd - I actually spent quite some time staring at the ...

##### Extract real part of a complex expression better than Re does

I have a complex expression with real positive variables only.

Mathematica Input Style:

##### Solving $$L=\frac {3}{2} \sqrt {4 \pi ^2 A^2+W^2}-\frac {\sqrt {5 W \sqrt {4 \pi ^2 A^2+W^2}+6 \pi ^2 A^2+3 W^2}}{\sqrt {2}}+\frac {3 W}{2}$$ for $$W$$

When I solve the aforementioned equation for $$W$$ or $$A$$ on Mathematica I get a long and ugly equation in return, namely one of the solutions for $$W$$ is: (attempt to read at your own health)

##### How to ask Mathematica to imitate Andy Warhol’s pop-art painting?

I tried to ask Mathematica to imitate Andy Warhol, let it convert a Marilyn Monroe’s portrait so that it looks like Warhol’s world famous pop-art painting.

However, the result shown below is far from ...

##### Cutting bagels into linked halves

I recently came across this video: Mathematically correct breakfast, which shows how a bagel can be neatly sliced into two identical linked halves. I’d like to try this with Mathematica. Here’s a ...

##### How to generate a random snowﬂake

’Tis the season... And it’s about time I posed my ﬁrst question on Mathematica Stack Exchange. So, here’s an holiday quest for you Graphics (and P-Chem?) gurus.

What is your best code for generating ...

##### Finding unit tangent, normal, and binormal vectors for a given r(t)

For my Calc III class, I need to ﬁnd $$T(t), N(t)$$, and $$B(t)$$ for $$t=1, 2$$, and $$-1$$, given $$r(t)=\{t,t^2,t^3\}$$.

I’ve got Mathematica, but I’ve never used it before and I’m not sure how to coerce ...

#### 2.14.3 Can you answer these questions?

##### Solving equations over unknown Domains

I am trying to solve for what values of some variables make some expressions true; not exactly equations. For a toy example, I am trying to solve for all values of $$x$$ that make $$4x$$ an Integer.

asked by Matthew Crawford https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=51196 1 vote

##### Not able to globalize variables from a manipulate expression

I am attempting to globalize the variables inside of a Manipulate expression for which my variables are also using interdependent controls. I have attempted to use

asked by Ryan https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=74490 1 vote

##### force maximum simpliﬁcation of radicals in a traditional way-How to do it?

this should be simple but I can’t get mathematica to simplify a radical or a set of radicals and express them in the traditional way for example by simplifying this

### 2.15 Thursday, September 3, 2020

#### 2.15.1 Top new questions this week

##### Is it possible to call back to Mathematica when using Python through ExternalEvaluate?

makes it possible to call Python code from Mathematica. The Wolfram Client for Python makes it possible to call Mathematica from Python. When using ...

##### How to select 2 pairs of distinct twins form a list of 4-tuples?

Given a list of 4-tuples as follows. data = Tuples[Range@6, 4]; I want to select any 4-tuples with two pairs of diﬀerent twins, for example, as follows:

##### Combine two plots with reversed y-axis

I need to display two y-values for a list of points. I tried doing this:

##### Can this probability function speed be improved?

I have a process that as part of it requires a certain probability query, speciﬁcally, given a multinomial distribution with f equiprobable categories and r trials, some speciﬁc category has a given ...

##### Embed a rose ﬂower image in 3D space with axes labeled in UTF8

I am trying to create an image in which a rose ﬂower image in a 3D space with axes labeled in UTF8! Labels don’t render correctly and not sure how to put the image at say the original of XYZ space.

##### Simplify Nested Lists

I have a problem with nested lists. For example, i have this list:

#### 2.15.2 Greatest hits from previous weeks

##### How can I plot implicit equations?

If you enter the following into Wolfram | Alpha, you get nice graphs:

graph 4 x^4 + y^2 = 2  How do you do this in Mathmatica? I realize that these are not ...

##### My Girlfriend is going to prison...Save her with Math

Salacious title, but true story.

##### Image processing: Floor plan - detecting rooms’ borders (area) and room names’ texts

Here is a simple building ﬂoor plan. I would like to derive the rooms as (rectangular) components and the names of the rooms. This is very common representation of building ﬂoor plans.

The problem

##### Crack CAPTCHA using deep learning

Deep convolutional neural networks are very good at computer vision related tasks. Optical Character Recognition (OCR) is one important branch of computer vision.

In fact, the convolution neural ...

##### Solving $$L=\frac {3}{2} \sqrt {4 \pi ^2 A^2+W^2}-\frac {\sqrt {5 W \sqrt {4 \pi ^2 A^2+W^2}+6 \pi ^2 A^2+3 W^2}}{\sqrt {2}}+\frac {3 W}{2}$$ for $$W$$

When I solve the aforementioned equation for $$W$$ or $$A$$ on Mathematica I get a long and ugly equation in return, namely one of the solutions for $$W$$ is: (attempt to read at your own health)

##### Entering numbers in Scientiﬁc Notation?

I need to play with a lot of powers such as 10^-3,1E-3 does not work for it. Is there any short form for it?

answered by Joe https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=44710 1 vote

##### Finding unit tangent, normal, and binormal vectors for a given r(t)

For my Calc III class, I need to ﬁnd $$T(t), N(t)$$, and $$B(t)$$ for $$t=1, 2$$, and $$-1$$, given $$r(t)=\{t,t^2,t^3\}$$.

I’ve got Mathematica, but I’ve never used it before and I’m not sure how to coerce ...

#### 2.15.3 Can you answer these questions?

##### How to force FindClusters to return a speciﬁc number of clusters?

I am using FindClusters with the Method -> "KMedoids" option. I am specifying a desired number of clusters. It returns with many fewer than the desired number. Is there a way to force it ...

##### Calculate a nested integral

I wish to plot the following probability on Mathematica: $\pi =n\cdot \int _{-\infty }^{+\infty }\int _{-\infty }^{+\infty }$

##### Diﬀerents Initial Conditions for NDSolve

I would like to solve a system of diﬀerential equations and another euqtions conect to the system. For example:

asked by Slayz https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=74408 1 vote

### 2.16 Thursday, August 20, 2020

#### 2.16.1 Top new questions this week

##### Deleting duplicates after n-occurrences

As a generalization of DeleteDuplicates, I want to delete duplicates from a list, but only after n number of duplicates. Say,

##### How can I enclose a closed curve with another identical slightly bigger closed curve?

I have a closed curve. I am trying to enclose this closed curve with another closed curve, which looks identical in the shape of the ﬁrst closed curve, but slightly bigger. How to do this?

##### Glowing weighted graph (network): vertexes and edges

I am trying to ﬁnd a way (desirably simple and performance/speed optimized for larger graphs) to do the following :

Styling graph vertexes by glow-eﬀect and its intensity depending on ...

##### Why does it take so long to Quit?

Running Quit is a core task repeated many times in any debugging/development cycle. Its eﬃciency is therefore important and yet in my set-up it is taking ...

##### How to use Flatten to a speciﬁc element of a list

Let's say I have a list {{1, 2, 3}, {4, 5}, ...}. I want to make the list
look like {1, 2, 3, {4, 5}, ...}. I am doing this way:

##### Parsing error [bug?] with systems of nonlinear PDEs, Mathematica 12.0.0

I ﬁnd the following behavior using 12.0.0. (EDIT: I asked a friend to try it in 12.1.1 and he ﬁnds the same result.) Here is a system of coupled nonlinear PDEs that ...

##### Collecting common powers of terms

How to collect the common powers appearing in the following function using MATHEMATICA, such that if I input

(4 m^6)/((m - n)^2 (m + n)^4 (2m+n)^4)

then the ...

#### 2.16.2 Greatest hits from previous weeks

##### Help ﬁnd a bright object on Mars!

In today’s news, scientists found a bright object on one of Curiosity’s photos (it’s near the bottom of the picture below). It’s a bit tricky to ﬁnd - I actually spent quite some time staring at the ...

##### How to plot an ellipse?

I’m new to Mathematica, and I’m ﬁnding it diﬃcult to plot an ellipse. I tried using

Plot[(x/5)^2 + (y/3)^2 == 1, {x, -5, 5}, {y, -3, 3}]

but I’m getting ...

##### How to make the digits of $$\pi$$ go around in a spiral like this?

Here is a start.

MapIndexed[Text[Reverse[First[RealDigits[Pi,10,252]]][[Tr@#2]],#]&,
Table[{t Cos[t],t Sin[t]},{t,0,16Pi,0.2}]]//Graphics

##### How to calculate contour integrals with Mathematica?

How to calculate the integral of $$\frac {1}{\sqrt {4 z^2 + 4 z + 3}}$$ over the unit circle counterclockwise for each branch of the integrand?

##### How to make a Spherical Cow?

Being a theoretical physicist, I always have a great respect for Spherical Cow. So I thought about making one myself. I am not sure how can I create (something considered to be the simplest!) this ...

##### How to ﬁnd integer solutions?

Following is the equation: Need to solve for integer values of x,y when a,b lies between -1000 and 1000. Problem is to ﬁnd the number of integer values of pair (x,y) that satisfy it.

##### Plotting a Phase Portrait

I’m trying to plot a phase portrait for the diﬀerential equation $x'' - (1 - x^2) x' + x = 0.5 \cos (1.1 t)\,.$ The primes are derivatives with respect to $$t$$. I’ve reduced this second order ODE to ...

#### 2.16.3 Can you answer these questions?

asked by Ceddaerrix https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=74211 1 vote

##### Custom arrowhead will not align properly

I am trying to put a custom arrowhead on an arrow I am drawing in a plot. My problem is that the (thick) line of the arrow is showing behind the arrow tip. So it seems like the arrowhead is aligned ...

asked by Bjoj https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=36437 1 vote

##### How to control a presenter notebook with a mobile device?

In the video of the link below, at 1:40 is said that the presentation can be controlled by a mobile device, how can I do that?

asked by Daniel Rocha da Silva https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=74279 1 vote

### 2.17 Thursday, August 13, 2020

#### 2.17.1 Top new questions this week

##### Which function names have been re-purposed in Mathematica after being deprecated?

I have just learned about the new function Splice from this answer. It turns out that this function used to have a completely diﬀerent usage! (See below.) To me, this seems dangerous, to deprecate a ...

##### StringJoin in Thread not working

Here is what I have tried ﬁrst.

Thread[f["x", {"1", "2"}]]

{f["x", "1"], f["x", "2"]}

But the weirdest thing happened when I ...

##### Using sequence to complete arguments to a function

I have a function of, say 4 arguments f[a,b,{c,e},d] where some of the arguments are lists. Given a list of triplets that are possible last-three-arguments to f I’d like to paste them as arguments to ...

##### How can I get the progressive application of list of rules?

I have a very long list of rules, and using this list of rules I want to see how some elements evolve as I successively apply the next rules on the previous rule.

Here is the simpler version of my ...

##### Finding the Period of a Limit Cycle

I’m interested in the periods of limit cycles of the Wilson-Cowan equations which have the form $x'(t) = -x + S(ax(t) - by(t) +e)$ $y'(t) = -y + S(cx(t) - dy(t) + f)$ where $S(x) = 1 +$ ...

##### Assigning a Color to each Point on the Plane

I have a dataset consisting of points on the plane and a corresponding color. These colors divide the plane into a few distinct regions. I would like to make a plot or diagram that nicely shows this ...

##### using regex to ﬁnd a speciﬁc word

I want to ﬁnd the word "circle" and "circles" in the list.

list = {"circle" , "picircle" , "circles" }

The regex code I wrote which isn’t working:

#### 2.17.2 Greatest hits from previous weeks

##### Can Mathematica do symbolic linear algebra?

For instance, is there some way I can say "let A and B be arbitrary real $$m\times n$$ and $$k\times m$$ matrices, Simplify[Transpose[Transpose[A].Transpose[B]]]" and Mathematica would simplify it to B.A? ...

##### How to make the digits of go around in a spiral like this?

Here is a start.

MapIndexed[Text[Reverse[First[RealDigits[Pi,10,252]]][[Tr@#2]],#]&,
Table[{t Cos[t],t Sin[t]},{t,0,16Pi,0.2}]]//Graphics

##### How to plot an ellipse?

I’m new to Mathematica, and I’m ﬁnding it diﬃcult to plot an ellipse. I tried using

Plot[(x/5)^2 + (y/3)^2 == 1, {x, -5, 5}, {y, -3, 3}]

but I’m getting some errors. Is there something wrong ...

##### Standard deck of 52 playing cards in curated data?

I am not sure how to ﬁnd out what all is included as curated data. For example, are the individual images of each of the 52 cards in a standard deck of playing cards included?

If not, is there a way ...

##### Skip header lines on import

When importing a data ﬁle what are the comment symbols for Mathematica? That is, given a ﬁle like this

blabla
bulbul

1 2 6 54 7 ...
..

what symbol do I have to put in front of header lines so ...

##### How to graph a sphere with cartesian equations?

I’m new to Mathematica and I need to ask how to graph a sphere, cylinder, etc.. using cartesian equations.

For example in sphere’s case $$x^2+y^2+z^2=1$$

I tried to use Plot3D but it doesn’t ...

##### How to create a new "person curve"?

Wolfram|Alpha has a whole collection of parametric curves that create images of famous people. To see them, enter WolframAlpha["person curve"] into a Mathematica notebook, or person curve into ...

#### 2.17.3 Can you answer these questions?

##### Mathematica 12.0 and BibTeX reference problem (Windows 10)

I have problems getting the Citation Management in Mathematica 12.0 to work. It does not work with either EndNote or BibTeX. To do a minimal example, I have the following BibTeX ﬁle (libra.bib) ...

asked by jaclea https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=7911 1 vote

##### How to convince Mathematica that $$(-1)^{2/3} = e^{2\pi i /3}$$

I have a list T which contains 3 + 4*E^(2*Pi*I/3). Yet MemberQ[ T , 3 + 4*(-1)^(2/3) ]
returns false.
One can check for themselves with MemberQ[{3 + 4*E^(2*Pi*I/3)}, 3 + 4*(-1)^(2/3)].
It will return  ...

Monitor[
WebImageSearch["dog",  ...

asked by M.R. https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=403 1 vote

### 2.18 Thursday, August 6, 2020

#### 2.18.1 Top new questions this week

##### How can I ﬁnd a functional square root in Mathematica?

A functional square root of a function $$g$$ is another function $$f$$ such that $$g=f\circ f$$. According to that article, there is a systematic approach to ﬁnding a functional square root that involves ...

##### The numerics of FresnelS[]

Bug introduced in 12.1 or earlier and persisting through 12.1.1 or later [CASE:4615361]

Note: A worse problem existed in 12.0 for inputs greater than 8 and of precisions less than 43.66; 12.1 ﬁxed ...

##### How to enter a nuclear reaction?

Sometimes the simplest things are the most diﬃcult, I need to make a presentation, and I thought to do it in Mathematica, I wanted to do a demonstration too, well...this is the Rutherford’s equation

##### How to ﬁnd a numerical antiderivative with NIntegrate methods?

@JimBelk asked in Interpolating an Antiderivative how to ﬁnd a numerical antiderivative. I gave an answer that uses NDSolve with the default method for integrating $$y'=f(x,y)$$. However for ...

##### How to draw one-line Venn diagram?

This is the a list of set.

data = {{"A"}, {"J"}, {"Q"}, {"G", "H"}, {"I", "O"},
{"B", "C", "E",  ...

##### How to express permutation as the least number of exchanges

In some problems, it is necessary to ﬁnd out what minimum number of exchanges can change a list ...

##### Remove mesh triangles in contour plot

How do I get rid of the mesh in this contour plot?

 ContourPlot[x^2 + y^2, {x, -10, 10}, {y, -10, 10},
Contours -> {1.0, 4.0, 10.5}, ContourStyle -> None,
ContourShading ->  ...

#### 2.18.2 Greatest hits from previous weeks

##### How to create animated snowfall?

Well, the title is self-explanatory. What sorts of snowfall can we generate using Mathematica? There are two options I suggest to consider:

1) Continuous GIF animations with smallest possible number ...

##### What does # mean in Mathematica?

I asked Mathematica to compute the following

Solve[c (1-x)^2-x^(1/4) == 0, x]

and it returned this:

x = Root[#1^8 c^4 - 8 #1^7 c^4 + 28 #1^6 c^4 - 56 #1^5 c^4 + 70 #1^4 c^4 - 56 #1^3 c^4 + 28  ...

##### Elegant operations on matrix rows and columns

Question

The Mathematica tutorial has a section ’Basic Matrix Operations’, describing operations like transpose, inverse and determinant. These operations all work on entire matrices. I am missing a ...

##### Help ﬁnd a bright object on Mars!

In today’s news, scientists found a bright object on one of Curiosity’s photos (it’s near the bottom of the picture below). It’s a bit tricky to ﬁnd - I actually spent quite some time staring at the ...

##### Plot, extract data to a ﬁle

I need to save data that Mathematica uses inside the Plot command. The format that I would like to have is:

x1 y1
x2 y2

i.e. basically, two columns, x and y (sorted, if possible) so that I ...

##### Labeling individual curves in Mathematica

I need to create a plot for export and inclusion in a report. Is there a better way to label curves than PlotLegends? From what I’ve read and my personal experience, PlotLegends is pretty bad.

Is ...

##### How to add a vertical line to a plot

In the plot below I would like to add two vertical lines at $$x = \frac {\pi }{15} \pm \frac {1}{20}$$. How can I do that?

f[x_] := (x^2 z)/((x^2 - y^2)^2 + 4 q^2 x^2) /. {y -> /15, z -> 1, q ->  ...

#### 2.18.3 Can you answer these questions?

##### Does MMA have a built-in function or a user-deﬁned function to judge whether the two matrices are congruent

It can be seen from the following relationship that matrix A and matrix B must be congruent matrices with each other:

A = {{1, 4, 4}, {5, 2, 2}, {3, 1, 3}};
B = EulerMatrix[{/4, 0,  ...

##### Symbolic solution to periodic boundary conditions

Is it possible to get an analytical solution to the following problem? If so, how? $a w^{(1,0)}(x,t)+b w^{(0,1)}(x,t)=p(x)+g w(x,t)$

asked by Scott G https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=74062 1 vote

##### Collecting terms in NCAlgebra

Let's say we have GP[v],GM[v]: two noncommutative objects depending on the commutative variable v.
<< NC;
<< NCAlgebra;
SetCommutative[v];
SetNonCommutative[GP, GM]
NCCollect[
GM[v] **  ...

asked by Kawette https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=60529 1 vote

### 2.19 Thursday, July 23, 2020

#### 2.19.1 Top new questions this week

##### How to rewrite a tensor as a matrix
{TensorProduct[{1, 0}, {0, 1}, {0, 1}, {0, 1}, {0, 1}]}/Sqrt[2]//MatrixForm
and I got
$$\left( \begin{array}{cc} \left( \begin{array}{cc} \left( \begin{array}{cc} 0 & 0 \\ 0 & 0 \\ asked by Moeki https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73815 12 votes answered by Suba Thomas https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=5998 9 votes ##### Breaking "Functional Loops" and Doing Lazy Evaluation In Mathematica Alright, so this is a question about the functional way to break a for/while loop. Since we’re on the Mathematica SE, I’m interested in the ways a Mathematica vet would handle this, however the ... asked by dskeletov https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=34831 8 votes answered by ﬂinty https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72682 6 votes ##### Hexadecimal bytes as variable converted to binary bits I am working with hexadecimal bytes but need to shift them into lists of binary bits for a few operations and then back again. For example, I would like C12B to turn into ... asked by toothandsticks https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73837 8 votes answered by Hausdorﬀ https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73380 9 votes ##### Kernel starts up very slowly on Linux V 12.1.1, starting a kernel, e.g. by entering wolframscript in the shell, takes an unexpectedly long time (~5 min, the time elapsed between pressing Enter and the showing-up of In[1] := ); but the ... answered by Ordinary users68 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=42417 5 votes ##### How to decompose a list of n-tuples into a union of Cartesian products I have a list with all elements at the same level { {a, d}, {a, e}, {a, f}, {b, d}, {b, e}, {b, f}, {c, d}, {c, e}, {c, f}, {x, t}, {x, q} } How can I transform this to a list of ... asked by Martin Leung https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73880 7 votes answered by yarchik https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=9469 4 votes ##### Mathematica emits a beep after any evaluation - how to remove it? Without any obvious reason Mathematica started to emit a beep after each evaluation, even when it is error free. Why is that, and how can I turn it oﬀ? I tried restarting Mathematica to no avail, and ... asked by Jxx https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=68480 6 votes answered by Ordinary users68 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=42417 6 votes ##### Prony series with a large number of terms A Prony series is similar to a Fourier series but can have fewer terms. It takes the form $$\sum _{i=1}^{M} A_i e^{\sigma _i t} \cos \left (\omega _i t+\phi _i\right )$$ Note that unlike Fourier series ... asked by Hugh https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=12558 6 votes #### 2.19.2 Greatest hits from previous weeks ##### Is there an open source implementation of Mathematica-the-language? I’ve seen questions before such as "What is the best open-source equivalent for Mathematica?", but that speciﬁc question (and that line of inquiry in general) cares more about the computer algebra ... asked by sblom https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=178 121 votes answered by Simon https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=34 83 votes ##### Image processing: Floor plan - detecting rooms’ borders (area) and room names’ texts Here is a simple building ﬂoor plan. I would like to derive the rooms as (rectangular) components and the names of the rooms. This is very common representation of building ﬂoor plans. The ... asked by s.s.o https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=840 63 votes answered by Niki Estner https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=242 58 votes ##### How to make Jacobian automatically in Mathematica If we have two vectors, $$a$$ and $$b$$, how can I make Jacobian matrix automatically in Mathematica? $$ a=\left(
\begin{array}{c}
x_1^3+2x_2^2 \\
3x_1^4+7x_2
\end{array}
\right);b=\left(

##### Skip header lines on import

When importing a data ﬁle what are the comment symbols for Mathematica? That is, given a ﬁle like this

blabla bulbul

1 2 6 54 7 ...

what symbol do I have to put in front of header lines so ...

##### How to ﬁnd the position of elements in a list satisfying criteria

Say I have a list x=2,4,6,8,10 and I want to ﬁnd out the positions of the elements that are greater than 7.

Select[x, #>7&] gives the elements themselves, and Position[x,8] gives the  ...

##### How to make an inkblot?

How to eﬀectively create a polygon that looks like a realistic inkblot? So far, I could come up with this (borrowing from Ed Pegg Jr.’s Rorschach demonstration):

RandomBlot[num_, opts___] :=  ...

##### How to generate a random snowﬂake

’Tis the season... And it’s about time I posed my ﬁrst question on Mathematica Stack Exchange. So, here’s an holiday quest for you Graphics (and P-Chem?) gurus.

What is your best code for generating ...

#### 2.19.3 Can you answer these questions?

##### How to write this piece of code without AppendTo

I am trying to ﬁll a vector starting from component 11 from another vector, I use this code:

Do[AppendTo[xp, x[[i + 10]]], {i, 1, 99982}]

How can I ﬁll xp without using ‘AppendTo’?

asked by mattiav27 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=8822 1 vote

##### Solving a cubic equation in mathematica

I am trying to solve a cubic equation using Mathematica of a rather complicated expression say $$f(r,\beta ,\theta )$$ , and in terms of $$r$$ the maximum degree term that appears is of degree $$3$$ so I ...

asked by Wubba lubba dub dub https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=70072 1 vote

##### Using Select for lattice points

I know how to use Select to generate a list of numbers which satisfy a certain condition. However, I am not sure how to do this for points (speciﬁcally 2-tuples) rather than numbers. What I am trying ...

asked by Descartes Before the Horse https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=69355 1 vote

### 2.20 Thursday, July 16, 2020

#### 2.20.1 Top new questions this week

##### Reveal the formal PDE of FiniteElement

When FiniteElement method is used, the diﬀerential equations will ﬁrst be transformed to certain standard form (named as formal PDE in recent FEM document), and it turns out to be critical to check ...

##### Drag and lift force acting on an airfoil

To calculate force acting on an airfoil we can use FEM with version 12 and over. Here we show an example with NACA2415. First we calculate mesh and potential ﬂow:

ClearAll[NACA2415];
NACA2415[{m_,  ...

##### When is a symbol a Symbol? Is there an easy mathematica way to test if an object is a symbol sort of like a SymbolQ?

Yes I know there is no built in native function called SymbolQ (but JavaScript does). However could one be simulated to work for most cases? I often rely

on objectName[symbol] and makeRuleRow[symbol]  ...

##### Using Regular Expression

sample2 = "this is a test to ﬁnd whether pi works for other words or not as well pi pi pi potatpi pineapple pi-neapple";

so sample2 is a string, and I want to search the word/substring ...

##### Changing the color of the animate box

Is there a way to change the coloring of the boxes that are generated by Animate or Manipulate? The color of what is gray by default.

Animate[ArrayPlot[CellularAutomaton[n, {{1}, 0}, {40, All}]], {n,  ...

##### Bad linear ﬁt for simple data

I have some data :

data={{1.01074, 0.964488}, {1.08552, 0.993067}, {1.07907,
1.01836}, {1.0477, 1.03695}, {1.07717, 1.07973}, {1.10243,
1.08195}, {1.12669, 1.09112}, {1.09405, 1.09319},  ...

##### How to use each replacement only once in a list of replacements

I have a list of replacements and some list they are acting on. However, some RHS of the replacements rules are identical (the LHS is not). I want to use those rules one after another (perhaps cycling ...

#### 2.20.2 Greatest hits from previous weeks

##### Positioning axes labels

I need to change the position of my axes labels such that the y-axis label is in the middle and parallel to the y-axis. I’d also like the x-axis label to be in the middle of the x-axis rather than ...

##### Generate a Unit Circle Trigonometry

Struggling often with Trigonometry I would like to have some code to generate this Unit Circle Trigonometry. Would be of great help when I need to transform some data :

##### Is there something like DensityPlot3D to visualize atomic orbitals?

I’m visualizing some hydrogen like atomic orbitals. For looking at plane slices of the probability density, the DensityPlot function works well, and with something like:

Manipulate[
DensityPlot[  ...

##### Mathematica command that allows it to read my intentions

In version 2.0 of Mathematica there was a command, ReadProgrammerIntentions[ ] which allowed it rapidly compose code that could solve problems simple to complex, based on my requirements. Understand ...

##### Does Mathematica 11 work with MacOS Catalina 10.15

I just upgraded my macbook to 10.15 and could not open Mathematica 11. I am wondering are there any workarounds to use Mathematica 11 without upgrading to 12? Thank you!

##### Finding Limits in several variables

Is there a way to ﬁnd a limit of a multivariable function, like

$\lim _{(x,y)\to (0,0)} f(x,y)$ with Mathematica?

When $$f$$ is continuous, we can use $\lim _{(x,y)\to (0,0)}$ ...

##### Parallel and perpendicular symbol from Mathematica to LaTeX

I want to get the following expression from Mathematica to LaTeX:

\begin{bmatrix}
E_{\parallel} \\ E_{\perp}
\end{bmatrix}

I have tried to use inbuilt ’symbol’ character from the special ...

#### 2.20.3 Can you answer these questions?

##### Finding the domain in which a function is analytic with no imaginary part

I was wondering if it is easy to see if a given expression evaluates to a real number in a given domain? Let e.g. $$f(x,y,z)$$ be some function depending on three variables $$x,y,z$$. I would like to know if ...

asked by CAF https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=30885 1 vote

##### Argmax - all maximizer positions

Generally the Argmax function returns one position, where a function is maximized. Is there a easy way to obtain a list of rules for all maximizer points?

asked by Daniel Rehsmann https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73792 1 vote

##### AceFEM MacOS not responding

I just upgraded to v7.114 of AceFEM running on MacOS 10.15.5 and Mathematica 12.0.0.0. I was running v7.101 without a problem. AceGEN seems to work but all AceFEM code starts but does nothing. The ...

asked by Andrew https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73727 1 vote

### 2.21 Thursday, July 9, 2020

#### 2.21.1 Top new questions this week

##### How to solve the Monty Hall problem?

Problem For purely recreational purposes I would like to solve the Monty Hall problem with Mathematica using the function Probability (dedicated to the calculation of probabilities). About the Monty ...

##### Change Opacity along a ListLinePlot

I’m trying to change the opacity of a line in a ListLinePlot for increasing x-value. E.g. the line should have opacity 1 at beginning and shade than down to opacity along the line. I want to take the ...

##### Use Cases with empty cells in the list

I work with a complex dataset. The most simple form of this list looks like:

dat1 = {{a, b, c, {}}, {d, e, f, {1}}, {h, i, j, {2}}}

I want to select the nested {} part.
Cases[dat1, {___, {a_}} :>  ...

##### Writing compiled functions as fast as Python’s Numba

I want to write some code to simulate a damped oscillator that is just as fast as code written using Numba's @njit decorator. I’ve written the mathematica code and mine is 20-40x slower than the ...

##### Why are more highly nested lists often not more memory and time-intensive?

I would expect more highly nested lists, being deeper and more complex than ﬂatter lists, to take up more space (bytecount) and take more time and memory to operate on in general. Consider the ...

##### Correcting the Color Scale of a MatrixPlot

I did a MatrixPlot of a set of values that range between 0 and 1. I got the following ﬁrst plot with no problems:

As we can see from the legend, the values range between 0 and 1. Now, I am doing ...

##### Verify an inequality of many parameters

I’ve got an inequality of 10 non-negative parameters (arising from a 5x5 matrix) and would like to verify whether it holds. I tried the following, which doesn’t seem to work:

#### 2.21.2 Greatest hits from previous weeks

##### How to calculate scalar curvature Ricci tensor and Christoﬀel symbols in Mathematica?

I am seeking a convenient and eﬀective way to calculate such geometric quantities. I’ve used packages like TensoriaCalc, but they don’t work at all time. Sometimes, I run into the following error:

##### Figuring when the minute and hour hand coincide on a clock

I would like to list all possible times in a 12-hour period, where the hour hand overlaps the minute hand completely. This is really a question about three distinct things - to be done in Mathematica ...

##### xkcd-style Plots

I received an email to which I wanted to respond with a xkcd-style graph, but I couldn’t manage it. Everything I drew looked perfect, and I don’t have enough command over PlotLegends to have these ...

##### Are you interested in purchasing David Wagner’s "Power programming with Mathematica"?

I recently contacted McGraw-Hill to see if they have a mechanism in place for printing out-of-print books that are still of interest. Speciﬁcally, I asked about "Power programming with Mathematica" ...

##### Parallel and perpendicular symbol from Mathematica to LaTeX

I want to get the following expression from Mathematica to LaTeX:


\begin{bmatrix}
E_{\parallel} \\ E_{\perp}
\end{bmatrix}

I have tried to use inbuilt ’symbol’ character from the special ...

##### Mathematica Minecraft

Some time ago I asked myself: with all these great graphics and interactive capabilities of Mathematica, what kinds of 3D games can be implemented in it? And the answer which came to mind is ...

##### Labeling individual curves in Mathematica

I need to create a plot for export and inclusion in a report. Is there a better way to label curves than PlotLegends? From what I’ve read and my personal experience, PlotLegends is pretty bad.

#### 2.21.3 Can you answer these questions?

##### How to include a meter in Manipulate that shows a value calculated from the manipulate dynamic variable?

I’m trying to make a visualization of grid (representing magnetic states) and I want to include a meter that shows a variable calculated from the manipulate index

(of the form J1/J2 = (index)*0.1) so  ...

asked by mike1994 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73104 1 vote

##### Measuring the time remaining until completion for built in functions

All of the functions in How to create a progress bar?, the ProgressIndicator built-in and Monitoring lengthy computations estimate the completion time for implementation of operations that are ...

asked by thinkingdude https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73139 1 vote

##### creating uppertriangularized matrix

I am trying to create an uppertriangularized matrix of arbitrary size,max of the form

{{1,2,3,4,5},{0,1,2,3,4},{0,0,1,2,3},{0,0,0,1,2},{0,0,0,0,1}}

using the code
table = Table[mu^(j - 1)  ...

asked by Z Ming Ma https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=70345 1 vote

### 2.22 Thursday, July 2, 2020

#### 2.22.1 Top new questions this week

##### How to make a structured mesh with a hole and extrude it

I am trying to use the FEMAddOns package to make a structured mesh with a hole and then extrude it. As a warm up example this worked nicely.

Needs["FEMAddOns"]
pts1 = Table[
25. (  ...

##### How to NOT a speciﬁc pattern?

been going around in cirlces on this:

{1/3, 1, 0.22, 3, "v", 4} /. _?NumericQ -> "999"

Now I’m trying to replace everything that is not a number; is there a way to do this? ...

##### Ordering Problem With VoronoiMesh

Imagine I want to model 2D cells moving in a tissue. Consider, as an example, Lloyd’s relaxation algorithm. Using VoronoiMesh I’m able to mimic some cell movement. Now, if I colour one of the cells in ...

##### Peculiar behaviour in the implementation of "Filling"

I was working with mathematica and I need to use "Filling", however I notice that it doesn’t work when you have "small" numbers, for example if I make the following:

##### i_:0|1 varies in v12.1: incompatible change or bug?

Just check

i_: 0 | 1 // FullForm

In v12.0 or earlier the output is
Alternatives[Optional[Pattern[i, Blank[]], 0], 1]

But in v12.1 the output becomes
Optional[Pattern[i, Blank[]], Alternatives[0,  ...

##### Inverse of StringReplace

Suppose I have the following StringReplace rule

StringReplace[st, {"a" -> "0", "OverBar[a]" -> "1", "b" -> "1",

##### Intersection of 3 circles in GeometricScene

I am trying to represent the image below in Mathematica and can’t seem to make it work. There doesn’t seem to be any constraint of type circle intersection in the documentation. I tried this:

#### 2.22.2 Greatest hits from previous weeks

##### Why I get the "Set::write: "Tag Times in is Protected." error?

Why I get the error below with this code:

Needs["VectorAnalysis"]

= 1000;
g = 9.80665;
= 0.001;
p[x_, y_, z_, t_] = {x^2, Sqrt[y], -z, t^3};
f[x_, y_, z_, t_] = {-x^2, Sqrt[y]/2, z, t^2};

...

##### What are the most common pitfalls awaiting new users?

As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ...

##### Is it possible to export the equations from Mathematica to MATLAB?

Is it possible to export the output expressions from Mathematica computations (e.g., equations) in valid MATLAB syntax?

##### Generate a Unit Circle Trigonometry

Struggling often with Trigonometry I would like to have some code to generate this Unit Circle Trigonometry. Would be of great help when I need to transform some data :

##### How to ﬁnd the position of elements in a list satisfying criteria

Say I have a list x=2,4,6,8,10 and I want to ﬁnd out the positions of the elements that are greater than 7.

Select[x, #>7&] gives the elements themselves, and Position[x,8] gives the  ...

##### Get a "step-by-step" evaluation in Mathematica

Is it possible in Mathematica to get a step-by-step evaluation of some functions; that’s to say, outputting not only the result but all the stages that have led to it? If so, how does one do it?

##### Is there any algorithm that runs faster in Mathematica than in C or Fortran?

I’m just curious. My friend just told me that Mathematica is mostly for symbolic calculation and not eﬃcient for Numerical computations. He told me that’s the reason most of the people don’t use ...

#### 2.22.3 Can you answer these questions?

##### An apparent bug in Geometry‘ConvexHull2

I was replacing some usages of Geometry‘ConvexHull2 with ConvexHullMesh and found one of my tests failing. It turned out the test asserted an incorrect expected result that agrees with the result of ...

##### When making a package, how can I make a function that is already used by system?

Obviously, Plus[a,b] is given by Mathematica but say I have a package and I want to name a function Plus[a,b]. How can I go about making a new function without overwriting the original function ...

##### Simplifying expressions using elementary properties of integrals

I want to be able to use Simplify (or FullSimplify) to simplify expressions involving, for example, sums of integrals, for instance turning $\int _a^b f(x)\,dx + \int _b^c f(x)\,dx$ into $\int _a^c$ ...

### 2.23 Thursday, June 25, 2020

#### 2.23.1 Top new questions this week

##### Version 12.1.1 unable to type ">"

Bug introduced in 12.1.1

Since I upgraded to version 12.1.1 I am unable to use > (Shift+.). When I type Shift+. the cell that I am typing in converts to Python. What am I doing wrong?

Steps to ...

##### Is there any better way to create a, a, a, b, b, b, b, b, c, c from a, 3, b, 5, c, 2?

My attempt:

data = {{a, 3}, {b, 5}, {c, 2}};

output = Table[#[[1]], #[[2]]] & /@ data // Flatten

{a, a, a, b, b, b, b, b, c, c}

##### Selecting lists where all are prime

Given

    t={{7, 13, 19}, {13, 25, 37}, {19, 37, 55}, {25, 49, 73}, {31, 61, 91}, {37, 73, 109}}

I want to select those lists where all three numbers are primes, so I should get
{{7, 13, 19}, {37,  ...

##### Inverting replace direction

I just have a simple problem. I have a list such that,

rep = { a1 -> b1, a2 -> b2, a3 -> b3};

I want to invert replace direction such that,
{ b1 -> a1, b2 -> a2, b3 -> a3}

I have a list of coordinates that make a near-parabolic graph, which I managed to ﬁt and calculate the curvature. However, the curvature only outputs a equation. Is there any way to calculate the ...

##### Legendre expansion of the Dirac delta function

There is a known expansion for the Dirac delta function in the interval $$(-1, 1)$$ in terms of the Legendre polynomials as

$$\delta(x) = \sum_{k = 0}^{\infty} (-1)^k \frac{(4k + 1) (2k)!}{2^{2k + 1} asked by Novice https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72595 7 votes answered by yarchik https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=9469 11 votes ##### Which methods are available for NDEigensystem? I am trying to ﬁnd out what methods/options are available for NDEigensystem and descriptions of their use. Perusing the help, online Q&As, Mathematica’s in-line autoﬁll, etc., I’ve found a few, ... asked by Eli Lansey https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=9 6 votes answered by user21 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=18437 5 votes #### 2.23.2 Greatest hits from previous weeks ##### How can I save both the plot and the legend together? In this example, how can I put the legend inside the graph? Currently, when I save the graph, only the graph is saved, not the legend. Expr1 = -2 p + 1 Expr2 = 2 p - 1 Expr3 = p - 1/2 Plot[{Expr1, ... asked by Mika Ike https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=6543 41 votes answered by C. E. https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=731 35 votes ##### Formatting legend text font I am using this code to plot a graph, and I am trying to make the font of the legend bigger. <<PlotLegends ListLogLogPlot[{Sort[moby]}, PlotRange -> Full, Joined -> True, asked by Julia https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=525 20 votes answered by kglr https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=125 25 votes ##### QR Code in shopping cart handle This week, the market people from my work wanted to put QR codes in shopping cart handles, but when they tested it, the QR code did not work. I noted that the cylindrical curvature (even small) ... asked by Murta https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=2266 194 votes answered by halirutan https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=187 190 votes ##### Solving $$L=\frac {3}{2} \sqrt {4 \pi ^2 A^2+W^2}-\frac {\sqrt {5 W \sqrt {4 \pi ^2 A^2+W^2}+6 \pi ^2 A^2+3 W^2}}{\sqrt {2}}+\frac {3 W}{2}$$ for $$W$$ When I solve the aforementioned equation for $$W$$ or $$A$$ on Mathematica I get a long and ugly equation in return, namely one of the solutions for $$W$$ is: (attempt to read at your own health) asked by J.D’Almbert https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=19257 8 votes answered by Alexei Boulbitch https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=788 14 votes ##### 1 Plot, 2 Scale/Axis I would like to plot those two datasets on top of each other. But they have very diﬀerent range on the $$y$$ axis. How can I have two diﬀerent axis? I found the following on the help menu but quite ... asked by 500 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=172 145 votes answered by ArgentoSapiens https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=92 149 votes ##### What are the most common pitfalls awaiting new users? As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ... asked by Dr. belisarius https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=193 462 votes answered by Michael E2 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=4999 279 votes ##### How to express trigonometric equation in terms of of given trigonometric function? How can I express a trigonometric equation / identity in terms of a given trigonometric function? using following trigonometric identities Sin[x]^2+Cos[x]^2==1 Sin[x]/Cos[x]==Tan[x] asked by Prashant Bhate https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=99 30 votes answered by Simon https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=34 37 votes #### 2.23.3 Can you answer these questions? ##### Using RegionPlot with NDSolve So I have a DE which has no analytical solution and thus solved using NDSolve, involving some parameters like this: solution=NDSolve[{b/z[t]^4+a z'[t]+z''[t]==0,z[0]==3,z'[0]==3},z,{t,0,5}] I was ... asked by t-smart https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=53560 1 vote ##### Implementing binomial expansion of (non-commuting) matrices in Mathematica Given two matrices $$A$$ and $$B$$, their Binomial expansion is, in general, given by (see this page) $$(A+B)^n = \sum \limits _{k=0, k=n[2]}^n \Bigg ( \sum \limits _{r=0}^k \binom {k}{r} A^r B^{k-r} \Bigg )$$ ... asked by Rob https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=66809 1 vote answered by ﬂinty https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72682 0 votes ##### Acquiring images from Zwo ASI camera in Mathematica Home Edition v 11.2.0.0 I plan to use a ZWO ASI planetary camera (USB connection) for astronomical photography and would like to control the image acquisition using Mathematica. The issue is that although I have installed ... asked by Dave Baker https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73406 1 vote ### 2.24 Thursday, June 18, 2020 #### 2.24.1 Top new questions this week ##### Find second largest elements in list Given a list: lis = {37.21, 37.21, 37.2, 44, 44, 44, 101, 101} What is a simple way to extract the second largest elements? In[]:= someFunction[lis] Out[]= {44, 44, 44} asked by Conor Cosnett https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=36681 14 votes answered by Mr.Wizard https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=121 16 votes ##### The performance of AceFEM in Intel Processor VS. AMD Processor I am going to buy a new powerful desktop that I will use to run ﬁnite element simulations using AceFEM. I found out that the new AMD Ryzen 9 3950X obtained more points in the CPU Passmark benchmark ... asked by KratosMath https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=53039 8 votes answered by marko https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=48938 8 votes ##### Rendering PNG images to spline curves I found something interesting on this page (Generic contour smoothing with shading) that could help me improve my images. Unfortunately, they can only be used with graphics generated by the software ... asked by LCarvalho https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=37895 8 votes answered by ﬂinty https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72682 9 votes ##### Parallel computing: cores vs threads I’m running Mathematica on a machine wtih 48 cores and 96 threads. I want to limit the number of threads the computation can have access to. If I give LaunchKernels[1] it correctly launches a single ... asked by Paolo Pani https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73287 8 votes answered by Mr.Wizard https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=121 9 votes ##### Convert ConvexHull to Inequality I have the following convex hull. P0={0,0,0}; P1={1,0,0}; P2={0,1,0}; P3={0,0,1}; ConvexHullMesh[{P0,P1,P2,P3}] Now I want the region algebraically as equality of the convex hull generated, in ... asked by Sumit Banik https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=71940 7 votes answered by kglr https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=125 9 votes ##### Multi-variable Fixed Point Iteration Command? We want to ﬁnd the zeros of a multi-dimensional function  f[x_, y_] = {x + 1/4 (-Cos[x] + Sin[y]), x - y - Sin[y]/4} To ﬁnd the zeros, we can initialize and show the iterates using FindRoot asked by Moo https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=36141 7 votes answered by ﬂinty https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72682 7 votes ##### Unimport wolfram language package In Wolfram Language, Import["ﬁle.wl"] can import external wolfram package, Is it reversible? Can I unimport some packages? In other means Unset all the Function, Variable which is Set when ... asked by Audra Jacot https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=67051 6 votes answered by Szabolcs https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=12 7 votes #### 2.24.2 Greatest hits from previous weeks ##### Positioning axes labels I need to change the position of my axes labels such that the y-axis label is in the middle and parallel to the y-axis. I’d also like the x-axis label to be in the middle of the x-axis rather than ... asked by John_dydx https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=7849 15 votes answered by Virgil https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=27697 16 votes ##### Using Export[] sends the ﬁle where? I am trying to use the Export command to convert a list of plots into a *.gif ﬁle, and the command runs and executes well, but I can’t ﬁnd the ﬁle! Where is it supposed to go? Did it even work? asked by Patrick Da Silva https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=1785 37 votes answered by Vitaliy Kaurov https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=13 51 votes ##### How to tell Mathematica that certain variables are real/imaginary, integer-valued, etc I’m trying to expedite some quantum mechanical calculations (expectation values etc.) by running them through Mathematica. When I say, for example, u[x_] := Sqrt[2/L] * Sin[Pi * n * x / L] and then ... asked by Matthew Brunetti https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=22304 36 votes answered by SquareOne https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=19960 22 votes ##### Generate a Unit Circle Trigonometry Struggling often with Trigonometry I would like to have some code to generate this Unit Circle Trigonometry. Would be of great help when I need to transform some data : asked by 500 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=172 18 votes answered by Mark McClure https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=36 32 votes ##### How to add a vertical line to a plot In the plot below I would like to add two vertical lines at $$x = \frac {\pi }{15} \pm \frac {1}{20}$$. How can I do that? f[x_] := (x^2 z)/((x^2 - y^2)^2 + 4 q^2 x^2) /. {y -> /15, z -> 1, q -> ... asked by sjdh https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=515 54 votes answered by Ajasja https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=745 75 votes ##### Selecting every n-th element from a list I have a list: data = {4, 5, 7, 8, 9, 5, 3, 2, 1, 2, 13, 12}; I want to take those elements in the list which are located at equal distances, say, every third element, getting the list {7, 5, 1, ... asked by Suro https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=20003 34 votes ##### How to plot an ellipse? I’m new to Mathematica, and I’m ﬁnding it diﬃcult to plot an ellipse. I tried using Plot[(x/5)^2 + (y/3)^2 == 1, {x, -5, 5}, {y, -3, 3}] but I’m getting some errors. Is there something wrong ... asked by Sriram https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=6075 17 votes answered by Jens https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=245 29 votes #### 2.24.3 Can you answer these questions? ##### Export Large Sparse Matrix As .mtx File I’m trying to export a large sparse matrix of dimension 1164960 by 1164960 with 17815680 elements as an .mtx ﬁle so I can import it into Python. I ﬁrst the run the following code successfully. asked by Daniel Berkowitz https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=27536 1 vote ##### What are "VariableReplacementDump" and "TranscendentalDump"? I have run into a Mathematica object I’ve never seen before and Googling those reveals nothing. I’m talking about VariableReplacementDump and TranscendentalDump. Here’s how I got these: asked by Lokdal https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=23117 1 vote ##### Why doesn’t Mathematica provide an answer while Wolfram|Alpha does, concerning a series convergence? Among other series I’ve been working on, I was asked to ﬁnd whether $\sum _n 1-\cos (\frac {\pi }{n})$ converged, and Mathematica’s output to SumConvergence[1 - Cos[Pi/n], n] simply was repeating the ... asked by Hal https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73083 1 vote ### 2.25 Thursday, June 4, 2020 #### 2.25.1 Top new questions this week ##### Find if there are consecutive 1s in a binary representation of a number Given a list of numbers in decimal form, what is the most eﬃcient way to determine if there are any consecutive 1s in the binary forms of those numbers? My solution so far: dim = 3; declist = ... asked by KHAAAAAAAAN https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=65587 10 votes answered by MassDefect https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=42264 10 votes ##### Why do some PlotThemes not work with Mesh as expected? What can be done about it? While updating my answer for (189038) I noted that some PlotThemes do not work with Mesh in a meaningful way: SeedRandom["08.01.2019"]; plotThemes = Map[ToString] @ { Web, Monochrome, Detailed, ... asked by gwr https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=764 9 votes answered by kglr https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=125 10 votes ##### How can I replace a set of Nested For Loops with a Functional Code Alternative? Despite having looked over various posts concerning optimizing nested For loop expressions into a functional programming equivalent I still can not ﬁgure out how to actually to do this. Such ... asked by Stuart Poss https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=35282 8 votes answered by kglr https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=125 7 votes ##### How to construct this matrix in Mathematica I create a symbolic matrix using the following: mat = ToExpression[Table[StringJoin[{"s", ToString[i], ToString[j]}], {i, 1, d}, {j, 1, d}]] for arbitrary $$d$$. Notice that for $$d=2$$, this gives asked by Sid https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=26461 8 votes answered by Edmund https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=19542 6 votes ##### Rewriting partitions using exponents I’m looking for a way to re-express a partition given in full form, like $$\{{2, 2, 1, 1}\}$$, into the shortened form $$\{2^2, 1^2\}$$, i.e. given a partition with repeated entries, count the number of ... asked by ZeroTheHero https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=52937 7 votes answered by kirma https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=3056 7 votes ##### What is the diﬀerence between a variable and a "slot variable"? Investigating Function[] , I found: What is the diﬀerence between using a variable (in the case, $$u$$) and a "slot variable"? It seems anything can be done with both. Is there something that ... asked by Billy Rubina https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=603 7 votes answered by MarcoB https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=27951 9 votes ##### Eﬃciently populate sparse matrix with band structure I’m trying to eﬃciently populate elements of a very large (2^20 x 2^20) symmetric matrix with 1s - luckily the matrix is very sparse, <0.1the matrix has a very well deﬁned ... asked by KHAAAAAAAAN https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=65587 7 votes answered by Henrik Schumacher https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=38178 8 votes #### 2.25.2 Greatest hits from previous weeks ##### Is there something like DensityPlot3D to visualize atomic orbitals? I’m visualizing some hydrogen like atomic orbitals. For looking at plane slices of the probability density, the DensityPlot function works well, and with something like: Manipulate[ DensityPlot[ ... asked by Peeter Joot https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=10 44 votes answered by xslittlegrass https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=1364 24 votes ##### How to ﬁnd integer solutions? Following is the equation: Need to solve for integer values of x,y when a,b lies between -1000 and 1000. Problem is to ﬁnd the number of integer values of pair (x,y) that satisfy it. asked by Sahil Sareen https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=12396 2 votes answered by bill s https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=1783 4 votes ##### How can I plot the direction ﬁeld for a diﬀerential equation? I’d like to plot the graph of the direction ﬁeld for a diﬀerential equation, to get a feel for it. I’m a novice, right now, when it comes to plotting in Mathematica, so I’m hoping that someone can ... asked by Matt Groﬀ https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=1735 29 votes answered by Peter Breitfeld https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=307 24 votes ##### Calculate the 2D Fourier transform of an Image I am new to Mathematica, and using version 8.0. I would like to calculate the 2D Fourier Transform of an Image with Mathematica and plot the magnitude and phase spectrum, as well as reconstruct the ... asked by user8727 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=8727 14 votes answered by Nasser https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=70 32 votes ##### How do I draw a pair of buttocks? I’m trying to develop a function which 3D plot would have a buttocks like shape. Several days of searching the web and a dozen my of own attempts to solve the issue have brought nothing but two ... asked by Simpleton Jack https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=22399 287 votes answered by mikuszefski https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=7608 440 votes ##### Elegant operations on matrix rows and columns Question The Mathematica tutorial has a section ’Basic Matrix Operations’, describing operations like transpose, inverse and determinant. These operations all work on entire matrices. I am missing a ... asked by sjdh https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=515 177 votes answered by Mr.Wizard https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=121 60 votes ##### Finding Limits in several variables Is there a way to ﬁnd a limit of a multivariable function, like $\lim _{(x,y)\to (0,0)} f(x,y)$ with Mathematica? When $$f$$ is continuous, we can use $\lim _{(x,y)\to (0,0)}$ ... asked by Dominic Michaelis https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=5899 30 votes answered by whuber https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=91 41 votes #### 2.25.3 Can you answer these questions? ##### How to plot a characteristic curve for silicon diode There is a ﬁgure given that shows the relation between Forward current(y axis) and forward Voltage (x axis ) for a forward biased diode, with the given formula asked by Haneen Hussam https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73068 1 vote answered by MarcoB https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=27951 0 votes ##### GetProcessMemoryInfo The GetProcessMemoryInfo from psapi.dll is a helpful function that can be used to monitor the memory wolframkernel.exe used, where how much memory can be used and is actually used by wolframkernel is ... asked by Frank https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=8207 1 vote answered by Frank https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=8207 0 votes ##### Solving PDE IVP with inequalities in domains I want to solve the following problem in Mathematica: I used the following Mathematica code. I am unsure whether this is the correct way of entering the assumptions for the initial and boundary ... asked by Leponzo https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=60411 1 vote ### 2.26 Thursday, May 28, 2020 #### 2.26.1 Top new questions this week ##### PlusMinus deﬁnition unexpectedly aﬀects plotting In version 10.1 I found a strange Plot behavior I did not anticipate. It seems that various heads including PlusMinus are treated as wrappers and stripped by Plot in a way that is not safe. This ... asked by Mr.Wizard https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=121 12 votes answered by Mr.Wizard https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=121 12 votes ##### Can someone boost even more my code? UPDATE As suggested by Roman, I’ve included here all my code. I’m using just bult-in function and compile to boost my code, but I think that it can be better. My code looks like  nof = 30; ... asked by Magela https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=68365 11 votes answered by Henrik Schumacher https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=38178 19 votes ##### Why does NMaximize miss this global maximum? I am having trouble maximizing a function which appears as a curvature of a planar curve. {tmin, tmax} = {0, 2 Pi} f = -((6-3 Cos[t] - Cos[3 t])/((-11+6 Cos[t] + 8 Cos[2 t] - 6 Cos[3 t] + Cos[4 t]) ... asked by A. Kato https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=62063 8 votes answered by Michael E2 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=4999 12 votes ##### How to break the x axis of a plot? I have the following data from which I get an interpolation: SPE = Interpolation[{{0, 4.08}, {0.5, 9}, {1.5, 12}, {5, 0.158}, {10, 0.158}, {15, 0.415}, {20, 0.802}, {30, 2.64}, {40, 4.99}, {60, ... asked by mattiav27 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=8822 8 votes answered by kglr https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=125 7 votes ##### How to pick consecutive numbers from list? Question is very simple. If we have tst = {2,3,4,6,7,9,11} result must be {{2,3,4}, {6,7}, {9}, {11}} There are similar questions, but not exact. My best solution is: myFun[arr_] := ... asked by lesobrod https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=5950 8 votes answered by J. M.’s technical diﬃculties https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=50 14 votes ##### Multiply each element of second position of two list If I have two list such as: list1 = {{40., 7.50551*10^-10}, {40.,7.50557*10^-10}, {40.,7.50566*10^-10}, {40.0001, 7.50578*10^-10}, {40.0001, 7.50591*10^-10},{40.0001, 7.50607*10^-10}, ... asked by John https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72900 7 votes answered by David Keith https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=44700 7 votes ##### Area/Volume of a 2D/3D object as it is ﬁlled up with water How could I get the volume of water on a region as it is ﬁlled up with water from below? Assume gravity points in some appropriate downward axis like y (or z in 3D) so the water ﬁlls upward from ... asked by ﬂinty https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72682 6 votes #### 2.26.2 Greatest hits from previous weeks ##### Plotting the frequency spectrum of a data series using Fourier testData = Table[N@Sin[500 x], {x, 0, 100}]; ListLinePlot[Abs[Fourier[testData]], PlotRange -> Full] Gives me Which I do not expect because the Fourier Transform is FourierTransform[Sin[500 ... asked by C. E. https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=731 14 votes answered by KennyColnago https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=3246 16 votes ##### Generate a Unit Circle Trigonometry Struggling often with Trigonometry I would like to have some code to generate this Unit Circle Trigonometry. Would be of great help when I need to transform some data : asked by 500 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=172 18 votes answered by Mark McClure https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=36 32 votes ##### Figuring when the minute and hour hand coincide on a clock I would like to list all possible times in a 12-hour period, where the hour hand overlaps the minute hand completely. This is really a question about three distinct things - to be done in Mathematica ... asked by Steve D https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=191 15 votes answered by Verbeia https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=8 21 votes ##### Formatting legend text font I am using this code to plot a graph, and I am trying to make the font of the legend bigger. <<PlotLegends ListLogLogPlot[{Sort[moby]}, PlotRange -> Full, Joined -> True, ... asked by Julia https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=525 20 votes answered by kglr https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=125 25 votes ##### How do I clear all user deﬁned symbols? Is there some way to do this other than going to Evaluation -> Quit kernel and firing a new one up? asked by niklasﬁ https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=82 95 votes answered by Artes https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=184 92 votes ##### How to calculate contour integrals with Mathematica? How to calculate the integral of $$\frac {1}{\sqrt {4 z^2 + 4 z + 3}}$$ over the unit circle counterclockwise for each branch of the integrand? asked by user64494 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=7152 40 votes answered by Artes https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=184 63 votes ##### Calling Correct Function for Plotting DiracDelta I am wondering what is the correct function in Mathematica to plot the true impulse function, better known as the DiracDelta function. When using this inside of a function or just the function ... asked by night owl https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=116 17 votes answered by Heike https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=46 19 votes #### 2.26.3 Can you answer these questions? ##### Natural deduction with FindEquationalProof Out of curiosity, I’m trying to implement a natural deduction prover in Mathematica using FindEquationalProof. So far, I’ve implemented a few of the easier rules: axioms = { ForAll[{A, B}, ... asked by imas145 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=61387 1 vote ##### NDSolve very slow I am trying to run this code to get the output from NDSolve for 4 dynamical equations. However, I have two issues: (1) It is taking a very long time (can reach several hours for a given instance) ... asked by user135626 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=19550 2 votes ##### Change Font and Size of Print[] output I managed to create a deﬁnition for the "Print" style, following the instructions here. However, the result does not work in my v.12.1. On the plus side, a "Print" entry exists at the bottom of the ... asked by Nicholas G https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=43662 1 vote ### 2.27 Thursday, May 21, 2020 #### 2.27.1 Top new questions this week ##### How to clear all deﬁnitions matching f[1, ...] but not f[2, ...]? I would like to clear all deﬁnitions of the form f[1,...] in such a way that f[2,...] remain unaﬀected. The two methods I know to clear variables don’t seem to apply to this situation: Pattern asked by WillG https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=59634 10 votes answered by Simon Woods https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=862 15 votes ##### Rescaling data to make a "continuous" function I have acquired many sets of data, which all represent a single function, but which are randomly rescaled by a constant (due to the measurement speciﬁcs). I’m looking to eﬀectively stitch them ... asked by ChaSta https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=48457 9 votes answered by aooiiii https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=68990 7 votes ##### Why does Mathematica ignore 1 as an exponent? Or as a coeﬃcient? Two diﬀerent examples of same problem:  In: Cases[{f^2, g^3, k^p, h}, x_^n_ -> n] Out: {2,3,p} # The result misses the exponen of h, '1' The same problem in a diﬀerent context: asked by MaxB https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=66077 8 votes answered by Nasser https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=70 11 votes ##### How to add ’border’ to Voronoi diagram Suppose I have a set of points pts, from which I generate a Voronoi diagram VD: pts = RandomReal[{-1, 1}, {100, 2}]; VD = Show[VoronoiMesh[pts], Graphics[{Red, Point[pts]}]] Now, as per the ... asked by TumbiSapichu https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=53229 7 votes answered by kglr https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=125 7 votes ##### Contracting indices in lists Using an answer to this question (Working with Dirac Gamma Matrices using FeynCalc - A simple problem), I deﬁned Clear[] SetAttributes[, Listable] [_] := If[ == 0, KroneckerProduct @@ ... asked by FB20 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72314 6 votes answered by Chanto https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=35091 4 votes ##### How to extract all possible sub-products which match speciﬁc pattern? I have an expression of the form expr = 3*(a.b)*(c.d)*f[x] + 5*(m.n)*(p.q)*(r.s)*f[y] and want to extract all possible subexpressions matching the pattern ((_).(_))*f[_]. Expected result (in ... asked by Shadowray https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=47416 6 votes answered by Marius Ladegård Meyer https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=22099 7 votes ##### Raytracing using Regions & NSolve I want to use geometric shapes in Mathematica to build complex shapes and use my raytracing algorithm on it. I have a working example where we can get the intersections from a combination of a Cone[] ... asked by Tomi https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=36939 6 votes answered by Tim Laska https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=61809 5 votes #### 2.27.2 Greatest hits from previous weeks ##### Help ﬁnd a bright object on Mars! In today’s news, scientists found a bright object on one of Curiosity’s photos (it’s near the bottom of the picture below). It’s a bit tricky to ﬁnd - I actually spent quite some time staring at the ... asked by Victor K. https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=1351 197 votes answered by Niki Estner https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=242 255 votes ##### Figuring when the minute and hour hand coincide on a clock I would like to list all possible times in a 12-hour period, where the hour hand overlaps the minute hand completely. This is really a question about three distinct things - to be done in Mathematica ... asked by Steve D https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=191 15 votes answered by Verbeia https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=8 21 votes ##### How to perform a multi-peak ﬁtting? I am wondering how to implement the multi-peak detecting and ﬁtting in Mathematica. Following is an example of ﬁtting the data using three peaks (such that the data ~ peak1 + peak2 + peak3). asked by Everett You https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=1389 54 votes answered by Silvia https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=17 54 votes ##### Using Export[] sends the ﬁle where? I am trying to use the Export command to convert a list of plots into a *.gif ﬁle, and the command runs and executes well, but I can’t ﬁnd the ﬁle! Where is it supposed to go? Did it even work? asked by Patrick Da Silva https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=1785 37 votes answered by Vitaliy Kaurov https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=13 49 votes ##### Can Mathematica do symbolic linear algebra? For instance, is there some way I can say "let A and B be arbitrary real $$m\times n$$ and $$k\times m$$ matrices, Simplify[Transpose[Transpose[A].Transpose[B]]]" and Mathematica would simplify it to B.A? asked by Niki Estner https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=242 61 votes ##### Assign the results from a Solve to variable(s) I understand Mathematica can’t assign the results of a Solve to the unknowns because there may be more than 1 solution. How can I assign the 4 values of following result to variables? asked by stevenvh https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=1450 52 votes answered by Artes https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=184 33 votes ##### Creating a table/Matrix during a For loop I have a For loop (with i as a counter), which calculates diﬀerent values (y1, y2, y3,...) as a function of the variable x. How can I create a table/matrix which contains i lines, each line ... asked by Solarboy https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=727 10 votes answered by Mr.Wizard https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=121 14 votes #### 2.27.3 Can you answer these questions? ##### Computations with OptimizedExpressions without completely expanding them I have to manipulate huge expressions that are rational functions of many (30) variables with integer coeﬃcients. Storing them just as a ratio of two polynomials would be impractical. But they can ... asked by Vladimir Reshetnikov https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=7288 2 votes ##### LeviCivitaTensor contraction indices apparently my computer has problems when I try to perform a calculation with TensorContract. In particular, with the second answer to my previous question Contracting indices in lists, I want to ... asked by FB20 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72314 1 vote ##### Using Fold[ or Map[ Better? I’m working through MMA Cookbook by Mangano, page 54. He shows Map is a compact form of Fold function. Is using Fold function important? myMap3[f_, l_] := Fold[Prepend[#1, f[#2]]&, {}, l] asked by code9910743 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=59860 2 votes ### 2.28 Thursday, May 14, 2020 #### 2.28.1 Top new questions this week ##### What causes Module variables to leak? Sometimes, after writing code like f[] := Module[{a}, ...] and running f[] multiple times, there will be many Temporary symbols of the form a123 in the Global namespace. Sometimes this happens ... asked by Szabolcs https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=12 25 votes answered by Leonid Shifrin https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=81 22 votes ##### Looping through all functions deﬁned in Mathematica Is there a way to loop through all the Functions (Elementary and Special functions) that exist in Mathematica? I want to construct a table of some identities and maybe I can discover something ... asked by Micha Kuczynski https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72609 12 votes answered by kglr https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=125 13 votes ##### Solver for COVID-19 epidemic model with the Caputo fractional derivatives As it is known in biological system with memory it would be suitable to use fractional derivatives to describe evolution of the system. In a current version of Mathematica 12.1 there is no special ... asked by Alex Trounev https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=58388 10 votes ##### Possible bug in ﬁnite sum over inverse squares $$\sum \limits _{i=1}^n \frac {1}{(x (n-i)+i)^2}$$ Revisiting the problem Limit of partial sums involving inverse squares I found another diﬃculty with Sum[] Consider this sum s[x_, n_] := Sum[ 1/(i + (n - i) x)^2, {i, 1, n}] Here we assume x ... asked by Dr. Wolfgang Hintze https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=16361 10 votes answered by Soner https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=49198 13 votes ##### Removing banal words from a list NB: I am aware of the DeleteStopwords symbol. I want to remove from a list of words the ones that are likely to be more banal. So for instance if we have {"exegesis", "mystification", "bread", ... asked by Diﬀycue https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=46327 9 votes answered by Vitaliy Kaurov https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=13 10 votes ##### How to reproduce Wolfram Language’s base64 encoded string with command-line tool? With Wolfram Language: In[7]:= ExportString["foobar", "Base64"] Out[7]= "Zm9vYmFyXDo0ZTJkXDo2NTg3" With the closest command-line software I could think of echo -n 'foobar' | openssl base64 ... asked by qazwsx https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=357 9 votes answered by Jason B. https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=9490 17 votes ##### Does the following change to MKL environment variable boost Mathematica speed on AMD CPUs I personally do not have an AMD CPU but since they are literally becoming quite hot these days, I thought whether the following ﬁx (as proposed here: ... asked by Ali Hashmi https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=27331 7 votes answered by ilian https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=145 9 votes #### 2.28.2 Greatest hits from previous weeks ##### Multivariable Taylor expansion does not work as expected The basic multivariable Taylor expansion formula around a point is as follows: $$
f(\mathbf r + \mathbf a) = f(\mathbf r) + (\mathbf a \cdot \nabla )f(\mathbf r) + \frac{1}{2!}(\mathbf a \cdot  ...

##### How to calculate scalar curvature Ricci tensor and Christoﬀel symbols in Mathematica?

I am seeking a convenient and eﬀective way to calculate such geometric quantities. I’ve used packages like TensoriaCalc, but they don’t work at all time. Sometimes, I run into the following error:

##### How to create eﬀect like Van Gogh’s stroke brush?

I need to apply Van Gogh’s stroke brush eﬀect to a random image

Take the following image as an example:

Thank you so much if you could help!

##### How to perform a multi-peak ﬁtting?

I am wondering how to implement the multi-peak detecting and ﬁtting in Mathematica. Following is an example of ﬁtting the data using three peaks (such that the data ~ peak1 + peak2 + peak3).

The ...

##### What are the most common pitfalls awaiting new users?

As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ...

##### How to ﬁnd integer solutions?

Following is the equation:

Need to solve for integer values of x,y when a,b lies between -1000 and 1000. Problem is to ﬁnd the number of integer values of pair (x,y) that satisfy it.

##### LaTeXand Mathematica

I quite often would like to draw graphics in my LaTeXdocuments using Mathematica. I have encountered three problems. I would like to know if there are any workarounds to these problems

I would ...

#### 2.28.3 Can you answer these questions?

##### Construct a binary tree where nodes are labeled according to given rule

I want to plot a binary tree in Mathematica where the nodes are labeled according to a given rule. In fact, whether a node has a left child or a right child or both, will be determined by a rule. And ...

asked by Mwen Rele https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72568 1 vote

##### How to get proper TeX output from splicing the following ﬁle?

In order to let other users with Mathematica 12.x test this problem for me, I now use FileTemplate instead of Splice.

I want to splice (with FileTemplate) the following ﬁle that has been simpliﬁed ...

asked by Money Oriented Programmer https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=42141 1 vote

##### Application of spatially varying boundary conditions and source term in AceFEM

I am trying to model a simple 2D steady state heat conduction problem using automatically generated Q2 elements.

The problem consists of a square domain with prescribed temperatures along the bottom ...

asked by DvanHuyssteen https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=69831 1 vote

### 2.29 Thursday, May 7, 2020

#### 2.29.1 Top new questions this week

##### ‘Count‘ for ‘SparseArray‘

Why does Count not work with SparseArrays, and is there any function I can use to replace it?

What would be an eﬃcient workaround?

Example:

a=ConstantArray[0,{10},SparseArray];
Count[a,0] (*  ...

##### What is the best and most eﬃcient way to curry?

Suppose I have a function with a signature like g[expr, _?(f), {1}, Heads -> False]
and I want to access it as an operator by giving the first argument last.
I see there are various ways of doing  ...

##### Mathematica and Excel

I have a number of large data sets in Excel and .dat from OMEdit Modelica that then need to import some or all of it to Mathematica for manipulation and plotting. Importing the data is easy enough ...

##### Local variables in sums and tables - best practices?

Stumbled on Local variables when deﬁning function in Mathematica in math.SE and decided to ask it here. Apologies if it is a duplicate - the only really relevant question with a detailed answer I ...

##### How can I make Mathematica solve this set of four equations?

I use Mathematica version 12.1 on Windows 10.

I have four equations in four unknowns.

Is there a trick to make Mathematica solve these?

I tried Solve and NSolve and it is not able to do it. ...

##### obtain properly formatted code from autogenerated package

Overview: I have written a few mathematica packages, always using the method of writing my code in a mathematica notebook and letting mathematica autogenerate the .m package ﬁle. Currently I do not ...

##### Why is StreamPlot plotting direction like this?

I am doing a StreamPlot and something seems wrong with the output.

  StreamPlot[{0, -(y - x)^3}, {x, -3, 3}, {y, -3, 3}]

The plot is attached and I highlighted the issue in red

Shouldn't the  ...

#### 2.29.2 Greatest hits from previous weeks

##### My Girlfriend is going to prison...Save her with Math

Salacious title, but true story.

 dmethyl1 = {
{0, 0},
{.25, 1},
{.5, 7},
{1, 26},
{1.5, 40},
{2, 45},
{2.5, 45},
{3, 44},
{3.5, 44},
{4,  ...

##### Calculate the 2D Fourier transform of an Image

I am new to Mathematica, and using version 8.0.

I would like to calculate the 2D Fourier Transform of an Image with Mathematica and plot the magnitude and phase spectrum, as well as reconstruct the ...

##### Help ﬁnd a bright object on Mars!

In today’s news, scientists found a bright object on one of Curiosity’s photos (it’s near the bottom of the picture below). It’s a bit tricky to ﬁnd - I actually spent quite some time staring at the ...

##### Are you interested in purchasing David Wagner’s "Power programming with Mathematica"?

I recently contacted McGraw-Hill to see if they have a mechanism in place for printing out-of-print books that are still of interest. Speciﬁcally, I asked about "Power programming with Mathematica" ...

##### Even Fibonacci numbers

Today, I found the Euler Project. Problem #2 is

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the ﬁrst 10 terms will be:

1, ...

##### What does # mean in Mathematica?

I asked Mathematica to compute the following

Solve[c (1-x)^2-x^(1/4) == 0, x]

and it returned this:

x = Root[#1^8 c^4 - 8 #1^7 c^4 + 28 #1^6 c^4 - 56 #1^5 c^4 + 70 #1^4 c^4 - 56 #1^3 c^4 + 28  ...

##### How to ask Mathematica to imitate Andy Warhol’s pop-art painting?

I tried to ask Mathematica to imitate Andy Warhol, let it convert a Marilyn Monroe’s portrait so that it looks like Warhol’s world famous pop-art painting. However, the result shown below is far from ...

#### 2.29.3 Can you answer these questions?

##### How to specify AxesOrigin for DateListPlot?

I would like to generate a plot with the y axis on the graph. In a "normal" numeric plot I do this using the AxesOrigin option. How to I specify the crossing point in a DateListPlot?

Here’s the MWE ...

asked by jmm https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=57731 1 vote

##### How to create a seek bar with Slider

I am trying to create a simple audio player but I am stuck at designing the seek bar. I am using the AudioStream framework.

After loading music in a variable stream, I can access its position using ...

asked by Sâu https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=67944 1 vote

##### How can I get a plot of "surface area coverage" of a parametric plot?

I have a parametric function deﬁned by the x and y functions:


x = r*Cos[w_0*t - w_L*t] +
z*Cos[w_P*t - w_L*t]

y = r*Sin[w_0*t - w_L*t] +
z*Sin[w_P*t - w_L*t]

I can change the variables ...

asked by Cameron_3298 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72418 1 vote

### 2.30 Thursday, April 23, 2020

#### 2.30.1 Top new questions this week

##### Wrong function of NotebookDirectory[] in the 12.1 version

Bug introduced in 12.1.0

Could anybody help?

NotebookDirectory[] function began working wrong in 12.1 (the bug was not present in 12.0 and earlier versions).

When folder name includes Russian ...

##### How complete is the WL’s string language?

Consider the following example:

Suppose I am interested in words that contain all the letter of the list
characters={"e","t","l","a","b"} at least once. An example would be
the word "abilities" or a  ...

##### Reusing PARDISO symbolic factorization

Is there a way to do this natively in Mathematica? I read in several places that this is possible with LibraryLink, but I don’t have a lot of experience with C and so I’m having trouble implementing ...

##### How to Improve FEM Solution with NDSolve?

First some comments. This same calculation works beautifully in 2D with essentially the same code. I have copied it largely unaltered into 3D as part of a migration to 3D so that I can do more complex ...

##### What is the diﬀerence between Wolfram Script and Wolfram Engine?

I don’t understand the diﬀerence between these products:

Wolfram Script

Wolfram Engine

Would someone help me understand what these are? And how it diﬀers from just using Mathematica in the ...

##### Implicit Riccati Equation Solver (to ﬁnd the anti-stabilizing solution

I’ve found that the latest MATLAB icare() solver includes the possibility to ﬁnd also the anti-stabilizing solution of the Riccati equation. I haven’t found a similar option on Mathematica. Is there ...

##### Dates not printed in DateListPlot

A simple example

Clear["Global*"];

data = TimeSeries[{1, 2, 1, 3, 0, 0, 0, 2, 21, 15, 21, 7, 11, 5, 10,
18, 73, 38, 103, 21, 35, 31, 46, 31, 35, 94, 71, 48, 78, 71, 74,
95, 95, 56,  ...

answered by kglr https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=125 1 vote

#### 2.30.2 Greatest hits from previous weeks

##### Mathematica code for Bifurcation Diagram

At the moment I am trying to construct a bifurcation diagram of the iterative function $$f(x)=$$ $$ax-1.1975x^3$$. I’ve scoured the internet for pre-made bifurcation diagrams and found many (mostly of the ...

##### Drawing a square root spiral

Here is a start. I’m looking for a nice way to draw it.

Graphics[{EdgeForm[Black], White,
Polygon @ {{0, 0}, {-1, 0},
Sqrt[2] {Cos[#], Sin[#]} &[Pi - (ArcCot[1])]},
Polygon @ {{0,  ...

##### How do I draw a pair of buttocks?

I’m trying to develop a function which 3D plot would have a buttocks like shape.

Several days of searching the web and a dozen my of own attempts to solve the issue have brought nothing but two ...

##### How can I improve Mathematica’s resolution on a macbook retina display?

Mathematica 9.0 looks a bit fuzzy on the retina screen, how can I increase the resolution?

Here another screenshot showing a direct comparison between the browser and Mathematica

##### Using Export[] sends the ﬁle where?

I am trying to use the Export command to convert a list of plots into a *.gif ﬁle, and the command runs and executes well, but I can’t ﬁnd the ﬁle! Where is it supposed to go? Did it even work?

##### How to create eﬀect like Van Gogh’s stroke brush?

I need to apply Van Gogh’s stroke brush eﬀect to a random image

Take the following image as an example:

Thank you so much if you could help!

##### Elegant operations on matrix rows and columns

The Mathematica tutorial has a section ’Basic Matrix Operations’, describing operations like transpose, inverse and determinant. These operations all work on entire matrices. I am missing a ...

#### 2.30.3 Can you answer these questions?

##### Can one use .wls (script) ﬁles in a simple way, like Matlab scripts?

I have been ﬁghting unsucessfully with the intricacies of creating Mathematica packages (Private, scopes , context) for a long time. I just need a simple version of Matlab scripts, to be able to ...

asked by ﬂorin https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=54979 1 vote

##### Introduction to Probability

Is there any newer book or online resource that would be good introductory text to probability with Mathematica? I have Introduction to Probability with Mathematica by Hastings but it is over 10 years ...

asked by grga https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=70392 1 vote

##### Do palettes limit the execution time of a user-deﬁned function?

I have deﬁned a function ConvertToMarkdown that does some long processing of a notebook: converts it to markdown, save inputs/outputs as images, generates a word cloud etc., that can take multiple ...

asked by Victor K. https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=1351 1 vote

### 2.31 Thursday, April 16, 2020

#### 2.31.1 Top new questions this week

##### Raytracing; why so slow?

I’m trying to get some rays to bounce in a circle. But I want to be able to control the reﬂections, i.e. the direction the rays bounce in the circle. I have a MWE below, and it is severely limited by ...

##### How use the black mode permanently

Now I can use this functionResourceFunction["DarkMode"][] to use the dark mode, but when I turn on Mathematica again, the black mode will not work. How can I set to use the black mode permanently.

##### DeleteCases depending on all elements

I have a listed of Tupels

list = {{10, 5}, {20, 4}, {20, 3}, {10, 6}};

If there are two elements a and b for which

a[[1]] <= b[[1]] && a[[2]] <= b[[2]]

then I would like to delete  ...

subsubsectionMathematica is unable to compute the derivative of the function $$\frac {\sin ^2(x)}x$$ https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=219273

Consider the function $f: \mathbb R\to \mathbb R, x\mapsto \begin {cases}\frac {\sin ^2(x)}x, & x\neq 0, \\ 0, & x=0.\end {cases}$

It is clear that $$f\in \mathcal C^1(\mathbb R)$$ and that

I am using Mathematica and I would like to download the dataset "Epidemic Data for Novel Coronavirus COVID-19" for basic investigation from Wolfram homepage. Can anyone give me some instructions or ...

##### NIntegrate vs quadGK in Julia

I am trying to understand the numerical integration routine by using as a benchmark the function

f[x_] := -x^2 + x^4

used to define the following function

g[z_] := NIntegrate[1/Sqrt[-f[x]], {x, z,  ...


##### Overﬂow with NDSolve

Backslide introduced in 10.0, persisting through 12.1.

I am trying to solve the following diﬀerential equation and plot the result:

ClearAll["Global*"]
rin = 10^-30;
sol = NDSolve[{Sqrt[x]  ...

#### 2.31.2 Greatest hits from previous weeks

##### What are the most common pitfalls awaiting new users?

As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ...

##### How to ﬁnd the position of elements in a list satisfying criteria

Say I have a list x={2,4,6,8,10} and I want to find out the positions
of the elements that are greater than 7.

Select[x, #>7&] gives the elements themselves, and Position[x,8] gives the  ...


##### How do I draw a pair of buttocks?

I’m trying to develop a function which 3D plot would have a buttocks like shape.

Several days of searching the web and a dozen my of own attempts to solve the issue have brought nothing but two ...

##### How can I plot a graph of an integral?

I want to plot the following function:

$\int \left (\frac {\Gamma (x+1)}{2}-\frac {\Gamma (x-1)}{2}\right ) \, dx$

##### Make a scatter plot from two lists

I have two lists of values

xx = {0.1, 0.3, 0.35, 0.57, 0.88, 1.0}
yy = {1.2, 3.5, 4.5, 7.8, 9.0, 12.2}

I want to make a scatter plot (list plot) with xx as x axis and yy as y axis. The help ...

##### Are you interested in purchasing David Wagner’s "Power programming with Mathematica"?

I recently contacted McGraw-Hill to see if they have a mechanism in place for printing out-of-print books that are still of interest. Speciﬁcally, I asked about "Power programming with Mathematica" ...

##### Extract real part of a complex expression better than Re does

I have a complex expression with real positive variables only.

Mathematica Input Style:

PP = -(( ( Cosh[y1 ] +  Sinh[y1 ])(- Cosh[(-L +  y2) ] +  Sinh[(-L + y2) ]))
/(s (2   Cosh[L ]  ...

#### 2.31.3 Can you answer these questions?

##### With a Large output, clicking Show all or Show more freezes Mathematica

Running the following code takes about 30 min on my laptop (everything before the Reduce is instant) and produces a Large output that Mathematica does not display, only shows buttons Show more, Show ...

asked by Sander Heinsalu https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=6211 1 vote

##### MathMF Error, Can’t Import VIdeo

I am getting this error HElP....

##### Best parameter for smoothing splines

I am trying to implement a module to determine the best value for the smoothing parameter of a smoothing spline interpolation of a given dataset. To calculate the cross-validation score of a given ...

asked by Daniele Binosi https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=25023 1 vote

### 2.32 Thursday, April 9, 2020

#### 2.32.1 Top new questions this week

##### Adding Regularisation to Built-in Interpolation function

tl;tr; How to improve performance of regularised Interpolation?

Context

Since Version 12, Mathematica now incorporates a range of (underrated IMHO) regularisation methods to Fit and FindFit.

##### How to model diﬀusion through a membrane?

This is a follow-up on How to handle discontinuity in diﬀusion coeﬃcient?

Consider diﬀusion of $$u(t,x)$$ on the domain $$x \in [0,2]$$ with some simple boundary conditions such as $$u(0) = 2, u(2) =$$

##### How to draw a "proper" tree diagram
TreePlot[{
{0 -> "Mr 1", 1/10},
{0 -> "Mr 2", 2/10},
{0 -> "Mr 3", 3/10},
{0 -> "Mr 4", 4/10},
{"Mr 1" -> "A1",  2/10 },
{"Mr 1" -> "B1",  1/10 },
{"Mr 1"  ...

##### How can I list all tech note pages?

It seems since v12.1 a new doc type, tech note, is included in the documentation.

However, I cannot ﬁnd an index page for the tech notes. So how can I list all such tech note pages?

##### Generating long binary lists fast?

Given list $$L$$ consisting only of $$0$$’s and $$1$$’s, we read $$L$$ backwards and construct a new list $$O$$ such that: (we start with $$O=\{1\}$$ and then apply the two rules:)

if we encounter $$n$$ ...

##### Control grain size of stipple shading

Is there a way to control the grain size of StippleShading?

On a standard resolution screen it looks like this:

##### Extracting COVID AdministrativeDivision data from Wolfram Resource

Wolfram makes the COVID-19 case data available in a form that is conveniently formatted for processing in Mathematica.

It can be accessed using:

data2 = ResourceData[ResourceUpdate["Epidemic Data  ...

#### 2.32.2 Greatest hits from previous weeks

##### How to make Jacobian automatically in Mathematica

If we have two vectors, $$a$$ and $$b$$, how can I make Jacobian matrix automatically in Mathematica?

 a=\left(
\begin{array}{c}
x_1^3+2x_2^2 \\
3x_1^4+7x_2
\end{array}
\right);b=\left(

##### LaTeXand Mathematica

I quite often would like to draw graphics in my LaTeXdocuments using Mathematica. I have encountered three problems. I would like to know if there are any workarounds to these problems

I would ...

##### Where can I ﬁnd examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I’m always looking out for ways to either improve my way of doing things in Mathematica, or to see if there’s something nifty that I haven’t ...

##### How can I plot the direction ﬁeld for a diﬀerential equation?

I’d like to plot the graph of the direction ﬁeld for a diﬀerential equation, to get a feel for it. I’m a novice, right now, when it comes to plotting in Mathematica, so I’m hoping that someone can ...

##### Mathematica command that allows it to read my intentions

In version 2.0 of Mathematica there was a command, ReadProgrammerIntentions[ ] which allowed it rapidly compose code that could solve problems simple to complex, based on my requirements. Understand ...

##### Parallel and perpendicular symbol from Mathematica to LaTeX

I want to get the following expression from Mathematica to LaTeX:

$\begin {bmatrix} E_{\parallel } \\ E_{\perp } \end {bmatrix}$

I have tried to use inbuilt ’symbol’ character from the special ...

##### Is there any algorithm that runs faster in Mathematica than in C or Fortran?

I’m just curious. My friend just told me that Mathematica is mostly for symbolic calculation and not eﬃcient for Numerical computations. He told me that’s the reason most of the people don’t use ...

#### 2.32.3 Can you answer these questions?

##### How can I modify the code to speed up the ‘Do‘?

I need to use the following code to do some calculations. But the running speed of this code is too slow. How can I modify this code to improve the running speed?

   Cb = 0.5;
Ch = 5./7;
=  ...

##### Need help with Limit (DirectedInﬁnity)

I tried to compute the following limit:

Limit[Series[
1/(1/x^2) (Sin[y x]/(x^4))^2 - Sin[y x]/y(x^3) + 1/x^2, {x, 0, 5}],
x -> 0, Assumptions -> {y > 0}]

the output :

asked by Johe https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=71663 1 vote

##### How can i use Butterworth ﬁlter written in matlab to Mathematica

i need help to convert this code written in matlab about Butterworth ﬁlter:

 %remove high-frequency components by 0.5-h butterworth filter;
n =2;
Wn =[1/30/0.5];   %30-min low-pass filter (LPF)%

asked by Iman Khaki https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=71671 1 vote

### 2.33 Thursday, April 2, 2020

#### 2.33.1 Top new questions this week

##### How to determine if two mutable data structures are the same?

How can I determine if two mutable data structures (DataStructure) are truly the same? I do not mean checking if they have the same value. I mean checking if they are the same data structure, i.e. ...

##### Is there oﬃcial documentation for oﬃcial documentation and getting help system of Mathematica?

Mathematica has very high quality and extensive documentation and good getting help system (? Solve as an example; there maybe are more too). Is there all including oﬃcial documentation about ...

##### Mottled appearance of ContourPlot3D with transparency

I’m trying to make a ContourPlot3D that needs to be transparent. With transparency, however, something odd happens.

With PerformanceGoal->"Speed", the colors look ﬁne.

With ...

##### Dividing by Zero - Unexpected Result

When I divide this number by zero I get this for an answer.

ans = 2345900/0

What is surprising is that in taking the square root, Mathematica seems to map the entire universe to some town  ...

##### How can I plot a parametric equation with ś?

I want to draw a parametric equation with ś like the figure below:

But I don't get the result I want when I run the following code. What can I do to get it?

ParametricPlot[{x, śx^2}, {x, 0, 1},
...

##### Mathematica numerical "error" for simple multiplication?

In[71]:= 0.6*0.8048780487804877

Out[71]= 0.482927

In[72]:= 0.3*0.8414634146341463

Out[72]= 0.252439

In[74]:= (0.6*0.8048780487804877) + 0.3*0.8414634146341463

Out[74]= 0.735366


##### Why can’t I use Inactive[D] in NDSolve?

I have a 2D rectangular domain with -L/2 < x < L/2 and 0 < y < D0, which is divided into two parts,
with a sinusoidal curve y == 1 +  Cos[2 Pi x/L] separating the two.

I want to solve  ...

##### LaTeX and Mathematica

I quite often would like to draw graphics in my LaTeXdocuments using Mathematica. I have encountered three problems. I would like to know if there are any workarounds to these problems

I would ...

##### How to make a spiroglyphic?]

Some (older) members of this group might remember playing vinyl LP records. Recently, at the Abbey Road studio there was a spiroglyphics coloring book for sale. It looks like a nice programming ...

##### How to graph a sphere with cartesian equations?

I’m new to Mathematica and I need to ask how to graph a sphere, cylinder, etc.. using cartesian equations.

For example in sphere’s case $$x^2+y^2+z^2=1$$

I tried to use Plot3D but it doesn’t ...

##### Mathematica Minecraft

Some time ago I asked myself: with all these great graphics and interactive capabilities of Mathematica, what kinds of 3D games can be implemented in it? And the answer which came to mind is ...

##### Code that generates a mandala

My little brother asked me to print original mandalas for coloring. I would like some idea on how to create them, but without color, so he can color them.

##### Calling Correct Function for Plotting DiracDelta

I am wondering what is the correct function in Mathematica to plot the true impulse function, better known as the DiracDelta[] function. When using this inside of a function or just the function ...

##### Solving $$L=\frac {3}{2} \sqrt {4 \pi ^2 A^2+W^2}-\frac {\sqrt {5 W \sqrt {4 \pi ^2 A^2+W^2}+6 \pi ^2 A^2+3 W^2}}{\sqrt {2}}+\frac {3 W}{2}$$ for $$W$$

When I solve the aforementioned equation for $$W$$ or $$A$$ on Mathematica I get a long and ugly equation in return, namely one of the solutions for $$W$$ is: (attempt to read at your own health)

#### 2.33.2 Can you answer these questions?

##### UnitSimplify rules?

Code as following:

In[1]:= constants = Quantity /@ {"PlanckConstant", "BoltzmannConstant", "MolarGasConstant"};
Print[UnitSimplify[
UnitConvert[Quantity["AvogadroNumber"]*constants[[2]]]] // N];

asked by ( https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=19360 ) 1 vote

##### How to delete random elements with RandomChoice?

I have a list of prices and a list of dates, but I have 154 more prices than dates. So I want to delete random prices to match both lists, however, every time I run the block of code I get a diﬀerent ...

asked by trashparticle https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=71573 1 vote

##### settings elements of matrix of functions

I have a work flow that involves initially specifying a matrix function
(or a matrix of functions), e.g.

f[x_]:={{Exp[x],Sin[x]},{Cos[x],Log[x]}}

This works well for what I am using it for. I can ...

asked by user3353819 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=34650 1 vote