2.25 Thursday, June 4, 2020

2.25.1 Top new questions this week
2.25.2 Greatest hits from previous weeks
2.25.3 Can you answer these questions?

2.25.1 Top new questions this week

Find if there are consecutive 1s in a binary representation of a number
Why do some PlotThemes not work with Mesh as expected? What can be done about it?
How can I replace a set of Nested For Loops with a Functional Code Alternative?
How to construct this matrix in Mathematica
Rewriting partitions using exponents
What is the difference between a variable and a "slot variable"?
Efficiently populate sparse matrix with band structure

Find if there are consecutive 1s in a binary representation of a number

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=223087

Given a list of numbers in decimal form, what is the most efficient 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?

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=223159

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?

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=223023

Despite having looked over various posts concerning optimizing nested For loop expressions into a functional programming equivalent I still can not figure 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

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=222895

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

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=222950

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 difference between a variable and a "slot variable"?

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=222964

Investigating Function[] , I found:

What is the difference 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

Efficiently populate sparse matrix with band structure

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=222924

I’m trying to efficiently 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 defined ...

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?
How to find integer solutions?
How can I plot the direction field for a differential equation?
Calculate the 2D Fourier transform of an Image
How do I draw a pair of buttocks?
Elegant operations on matrix rows and columns
Finding Limits in several variables

Is there something like DensityPlot3D to visualize atomic orbitals?

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=32378

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 find integer solutions?

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=42359

Following is the equation:

Need to solve for integer values of x,y when a,b lies between -1000 and 1000. Problem is to find 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 field for a differential equation?

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=8841

I’d like to plot the graph of the direction field for a differential 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 Groff 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

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=29203

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?

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=66538

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

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=3069

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

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=21544

Is there a way to find 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
GetProcessMemoryInfo
Solving PDE IVP with inequalities in domains

How to plot a characteristic curve for silicon diode

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=223212

There is a figure 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

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=223025

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

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=223155

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