# Tag Info

Accepted

### Modeling the spread of an infection in networked computers

If it is at all an option to represent the grid as a 2D list instead of a list of infected coordinates, I would model this is a cellular automaton. What you've essentially got is an outer totalistic ...
• 8,584

### Unexpected behaviour from Table[]

This is just a long comment trying to shed light on where the problem may be coming from. Since version 10.2, the following is valid syntax: Table[x, 5] Before ...
• 227k
Accepted

### multiple reflections of a laser beam in a triangle

Based on some geometric operations such as reflection and line-line intersection (LLI), I wrote up a small code. Hope this could be a starting point to build a more compact ...
Accepted

### How to programmatically specify multiple iterators?

What you actually want is to create a Sequence from the Table to be used as your iterators. You can do this with ...
• 7,076
Accepted

### Why can't I create {a,a,a,b,b,b,b,b,c,c} from x={a,b,c}; f={3,5,2}; Thread@Table[x,f]?

This is an evaluation order issue. x and f need to expand (evaluate) to {a, b, c} and ...
• 265k

### RecurrenceTable iteration variable not localized? Bug or user error?

As Bob Hanlon's answer points out, RecurrenceTable does not hold its arguments, but most especially, it does not hold its iterator arguments. This must surely be ...
• 67.3k

### Modeling the spread of an infection in networked computers

Non CellularAutomaton solution, using @MartinEnder's suggestion of FixedPointList as opposed to ...
• 7,769

### How can I use a loop with an iterator in order to evaluate a function?

x = {1, 2, 3, 4}; y = {0, 1, 2, 5}; Listable >> Properties and Relations: "A function implemented in terms of a listable operation may not need the Listable ...
• 350k
Accepted

### How to iterate over the columns of a Dataset?

Here an approach that uses some Dataset related functionality. Doesn't look too readable to me, but in its core it uses the column names to access the data-set and ...
• 111k

### RecurrenceTable iteration variable not localized? Bug or user error?

Unlike many other functions that use an iterator, RecurrenceTable does not have the attribute HoldAll. Presumably, this ...
• 123k

### multiple reflections of a laser beam in a triangle

Instead of thinking too hard, we can let NDSolve take care of it, using WhenEvent to handle the reflections. First, set up 3 ...
• 18.1k

### What is the correct way to perform the Gram-Schmidt process?

Well, as others have said, you could use Orthogonalize to solve this problem, and it will likely be the fastest way to do so, but let's assume that (for whatever ...
• 687

### Changing iterator inside a Table?

Use the correct iterator for the job, in this case use While instead of Table: ...
• 63.5k
Accepted

...
• 114k

### How to get the current index during a Scan iteration?

A scan operation doesn't really have an index, but you can get the effect you want by introducing a counter. ...
• 106k
Accepted

### Basins of attraction of equilibrium points

I think there maybe be a sign error in the maths, bear with me. Given your V[x_, y_] := 1/2 (x^2 + y^2) - y (1/3 y^2 - x^2) we can find the partial ...
• 7,704

### What is the correct way to perform the Gram-Schmidt process?

As Michael Witt has mentioned this is mainly interesting as a learning exercise as there is Orthogonalize. As such, I think it is worth mentioning that it is quite ...
• 23.1k
Accepted

### Calculating the Feigenbaum Constants

Several changes are required to obtain the desired results. First, the syntax error mu[n] == mu must be replaced by mu[n] = mu. ...
• 58.6k
Accepted

### Applying loop functions with input list of iterators

You need to use SlotSequence (##) in place of Slot (#). # refers to the first element (in your case to {a, 0, 4}) in a ...
• 350k
Accepted

• 350k
Accepted

### Trouble iterating my forest fire simulation

I found your simulation idea interesting, so I decided to look into the problem. What I found was that your implementation of nextState is mostly where the fault ...
• 106k
Accepted

### Iterating Log infinitely

You can use FixedPoint: FixedPoint[Log[3.5 #] &, 3.5] == -ProductLog[-1, -1/3.5] True ...
• 33.3k
Accepted

### Skipping over iterator values in a Table

You can do this without Table: g[k_] := k^2 + 1 Map[If[# != 6, f[#] = g[#], f[#] = 1] &, Range[10]] {2, 5, 10, 17, 26, ...
• 32.5k

### How to iterate over the columns of a Dataset?

To get the data arranged for use in ListPlot, you'll have to use 'Normal - e.g. like this: ...
• 95.3k
Accepted

### ReplaceRepeated as a Looping construct?

Using the shortcut //. together with a MaxIterations options ...
• 27.1k
Accepted

### Do-Command around entire Notebook (by iterating it from another notebook?)

Indeed, the existing notebook can be called repeatedly from another notebook, which iterates over the desired parameters, passing them to the existing notebook, which then passes the answers back to ...
• 58.6k

### Modeling the spread of an infection in networked computers

The demonstration of CellularAutomaton is impressive but it is far from necessary for this problem. I propose ListCorrelate ...
• 265k

### How to programmatically specify multiple iterators?

Perhaps you can avoid Do and instead use Tuples: Tuples @ Range[0, {0, 1, 2}] {{0, 0, 0}...
• 124k
Accepted

### Incorrect syntax highlighting? "Variables made special by use in arguments" not working

Welcome to MMA SE! (Note that I think you shouldn't be using Evaluate there: consider i=3; Do2[Print[i], {i,5}].) Syntax ...
• 8,418