1.6 Thursday, April 15, 2021

1.6.1 Top new questions this week
1.6.2 Greatest hits from previous weeks
1.6.3 Can you answer these questions?

1.6.1 Top new questions this week

Is there a neat code to swap elements of a list?
Stokes equations in 2D with traction boundary conditions
Transform a number to a factorial
Stopping condition for FindMinimum / FindMaximum
Efficiently compute Minkowski sum of a 2D Region and a Disc of radius r?
Random orthogonal matrix
Detecting patterns in a graph network

Is there a neat code to swap elements of a list?

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

I want to swap the list to make a new list as follows. The code works but I’m wondering if there is a neat code, or an elegant way to do this.

asked by anhnha https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=18805 9 votes

answered by kirma https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=3056 10 votes

Stokes equations in 2D with traction boundary conditions

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

This is a follow-up to a previous question (see here). We would like to solve the two-dimensional Stokes equations using the FEM package in Mathematica, when we prescribe traction boundary conditions. ...

asked by Alex R https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=78043 7 votes

answered by Oleksii Semenov https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=63028 3 votes

Transform a number to a factorial

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

I came across the need to transform a number into a factorial n, with positive integer n. I have searched in the MMA information but I can’t find anything like that. I imagine an input, which verifies ...

asked by zeros https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=26849 7 votes

answered by Bob Hanlon https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=9362 6 votes

Stopping condition for FindMinimum / FindMaximum

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

This seems like it should be a simple question – but I am looking to use a "home made" stopping condition with FindMaximum, while evaluating a very complex function. Printing out the ...

asked by Richard E https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=79342 7 votes

answered by Daniel Huber https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=46318 8 votes

Efficiently compute Minkowski sum of a 2D Region and a Disc of radius r?

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

Given a 2D Mathematica Region, e.g. A = Region[RegionDifference[Disk[{0, 0}, 2], Disk[{2, 0}, 1]]], how can I grow the region by an arbitrary radius r? For example, ...

asked by Aaron T. Becker https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=76690 6 votes

answered by cvgmt https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72111 5 votes

Random orthogonal matrix

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

Is there a way to generate real random orthogonal matrices in mathematica? If Q is an orthogonal matrix, it’s properties are

asked by Jasmine https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73364 6 votes

answered by Henrik Schumacher https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=38178 9 votes

Detecting patterns in a graph network

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

If we create a random graph

Chop[LowerTriangularize[RandomReal[{-1, 1}, {10, 10}], -1], 0.6] /.0 -> \[Infinity] // MatrixForm 
WeightedAdjacencyGraph[%]

How can ...

asked by Teabelly https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=56986 5 votes

answered by Szabolcs https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=12 6 votes

1.6.2 Greatest hits from previous weeks

What do the X and Y axis stand for in the Fourier transform domain?
Plot, extract data to a file
Get a "step-by-step" evaluation in Mathematica
How to add a vertical line to a plot
Selecting every n-th element from a list
How to graph a sphere with cartesian equations?
Conversion of Sine to Cosine

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

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

In Wolfram Mathematica the function Fourier has the following declaration

Fourier[list]

And after a list is given to the ...

asked by user253956 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=29958 27 votes

answered by Hugh https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=12558 61 votes

Plot, extract data to a file

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

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

asked by molkee https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=5097 30 votes

answered by Mr.Wizard https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=121 47 votes

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

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

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?

asked by Cydonia7 https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=44 131 votes

answered by J. M.’s ennui https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=50 109 votes

How to add a vertical line to a plot

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

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?

asked by sjdh https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=515 64 votes

answered by Ajasja https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=745 83 votes

Selecting every n-th element from a list

https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=64003 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 ...

asked by Suro https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=20003 37 votes

answered by Szabolcs https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=12 34 votes

How to graph a sphere with cartesian equations?

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

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

asked by German https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=7145 7 votes

answered by Dr. belisarius https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=193 13 votes

Conversion of Sine to Cosine

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

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?

asked by YongCheol Kwon https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=23041 4 votes

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

1.6.3 Can you answer these questions?

RandomInstance of GeometricScene producing unexpected result
Solving an ordinary differential equation with boundary condition at infinity
How to use ScalingFunctions with Graphics ChartElements

RandomInstance of GeometricScene producing unexpected result

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

Consider the following scene as an example:

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

Solving an ordinary differential equation with boundary condition at infinity

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

I want to solve the following differential equation  f''[z] + (1/z)*f'[z] - f[z] + f[z]^3 == 0

subject to the boundary conditions

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

answered by Mariusz Iwaniuk https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=26828 0 votes

How to use ScalingFunctions with Graphics ChartElements

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

How to draw spheres with BubbleChart with a reversed vertical axis? The 3rd example shows the problem (empty plot), likely caused by the transformation, but how to correct it?

asked by HuibH https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=70256 3 votes