14 votes

How to plot an imaginary number, i, power tower as done in the following way?

Plot the left graph. ...
cvgmt's user avatar
  • 69.2k
13 votes
Accepted

How can I iterate this process?

Here's one way: ...
C. E.'s user avatar
  • 70.4k
13 votes

How to recreate this complex iteration

The theorem is talking about disks and you've plotted a Julia set which doesn't involve transforming any disks, but instead iterates at every point and testing if that point reaches the escape radius. ...
flinty's user avatar
  • 24.7k
12 votes
Accepted

Simple Fractal square

...
kglr's user avatar
  • 392k
12 votes
Accepted

Create a regular polygon with n vertices given two points

AnglePath. For two point {x1,y1} and {x2,y2}, at first we locate at ...
cvgmt's user avatar
  • 69.2k
11 votes
Accepted

Using Nest to build continued fraction

This is what you need: Nest[x/(1 + #) &, x, 3]
Lotus's user avatar
  • 2,671
10 votes
Accepted

Iteration on a matrix

NestList[x \[Function] 2 x + 4, {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, 100]
Henrik Schumacher's user avatar
10 votes

What is the most efficient way to define a Loop until function?

Here's a simpler version: SetAttributes[Until,HoldAll] Until[body_, test_] := While[body; !test]
Carl Woll's user avatar
  • 130k
10 votes
Accepted

FixedPoint not working, despite quick convergence of sequence

$Version (* "13.0.1 for Mac OS X x86 (64-bit) (January 28, 2022)" *) The Possible Issues section of the ...
Bob Hanlon's user avatar
  • 155k
10 votes
Accepted

Using multiple hashtags in NestList

Use Apply. NestList[Apply[{#1 + #2, #1 - #2} &], {100, 75}, 5]
cvgmt's user avatar
  • 69.2k
10 votes

Create a regular polygon with n vertices given two points

You can use CirclePoints. You just need to transform them: ...
flinty's user avatar
  • 24.7k
9 votes

Simple Fractal square

...
Henrik Schumacher's user avatar
9 votes
Accepted

What is the most efficient way to define a Loop until function?

I tend to use While[True, body; If[condition, Break[]] ] but what you show is equally good. This is just an alternative. Try to avoid procedural loops in ...
Szabolcs's user avatar
  • 234k
9 votes
Accepted

What's a functional alternative to nested Do loops?

Defining a function with some side-effect for demonstration purposes. f[i_, j_] := Echo[{i, j}] Here are some more WL-esque options: ...
George Varnavides's user avatar
8 votes
Accepted

Iterate over deepest values in a nested Association

Level[assoc, {-1}] (* {0, "one", 2, 3, 4} *)
Roman's user avatar
  • 46.9k
8 votes

How can I iterate this process?

C.E.'s answer is great already. I would just like to point out that we may exploit here that floating point addition is usually significantly faster than floating point multiplication that ...
Henrik Schumacher's user avatar
8 votes
Accepted

Coding the Mandelbrot Set for Beginners

Something like ...
Roman's user avatar
  • 46.9k
8 votes

Best way to count nest depth in e.g. f[f[f[...[f[x]]...]?

You can define a simple function to do this: fdepth[f[u_]] := 1 + fdepth[u] fdepth[_] = 0; For example ...
mikado's user avatar
  • 16.4k
8 votes
Accepted

Replacing elements at a single level in a nested list

I am sure there are a hundred other solutions, but this one does the job and should be reasonably efficient: ...
a20's user avatar
  • 927
8 votes

Using multiple hashtags in NestList

The argument being supplied to the function is a list. It's a single argument with head List. So, #2 cannot be bound to anything. You can either use Apply (per cvgmt's answer) or use Part: ...
lericr's user avatar
  • 26.4k
8 votes

How to plot an imaginary number, i, power tower as done in the following way?

Plotting the real part on the horizontal and the imaginary part on the vertical axis, as is common: ...
Roman's user avatar
  • 46.9k
7 votes

Delete repeating elements across sublists

You may use a pattern approach with ReplaceRepeated using RandomChoice and Nothing to ...
Edmund's user avatar
  • 42k
7 votes

Iteration on a matrix

Another possibility is to write the problem via a recursion: f[n_] := 2 f[n - 1] + 4; f[1] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; To get any power, you then ask ...
bill s's user avatar
  • 68.8k
7 votes
Accepted

NestList: How to have a parameter that is changing as a function of nest index, n?

You can use FoldList: FoldList[STEP[#, #2] &, m0, Table[ii/NT, {ii, 1, NT}] ]
kglr's user avatar
  • 392k
7 votes
Accepted

How to create a nested list of variable depth with indexed elements

You can try Array: Array[c, {3, 3, 3, 3}] ...
kglr's user avatar
  • 392k
7 votes
Accepted

Heat transfer with functions defined on different domains

As I understood the question, the polymer is cooled on two sides by the mold. This implies a symmetry condition at the center of the polymer as shown in the image below. Create mesh In multi-material ...
Tim Laska's user avatar
  • 16.3k
7 votes

Using the Fold function with multiple parameter inputs

You could use Nest instead: Nest[f[a, b, c, #]&, x, 6] f[a, b, c, f[a, b, c, f[a, b, c, f[a, b, c, f[a, b, c, f[a, b, c, x]...
Carl Woll's user avatar
  • 130k
7 votes
Accepted

Defining a function iteratively without Mathematica getting stuck in a recursion loop

You can define the function(s) recursively: ...
bill s's user avatar
  • 68.8k
7 votes
Accepted

Better way to do such iteration

Based on your update with the fractal demo, I think I may have a solution. The basic idea is that a triangle is split into two smaller triangles based on a parameter that determines how long the new ...
lericr's user avatar
  • 26.4k
6 votes

Simple Birth Death Process

I just did this in class today using @IstvánZachar's GillespieSSA function from this answer. Load that, then: ...
Chris K's user avatar
  • 20.1k

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