# Tag Info

### Gravitation simulation and interaction of N (1000) massive objects

And I was somewhat lying in wait for this kind of question... In I have been working on Barnes-Hut-like code for the so-called tangent-point energies in the last couple of years. This is a family of ...
Accepted

### Thermodynamics of the 2D Ising model

The energy can be calculated exactly as written in the formula using Sum and correct indices: ...

### Colored plot with Wolfram Mathematica

The option Filling can color the space between plotted lines (see documentation). In your case, where lines do not intersect, it is easier to stack the plots inside ...
Accepted

### Simulating the Conduction of Heat on a Metal Rod

This is basic animation using Manipulate. This can be solved analytically by Mathematica. Once you obtain the analytical solution then Manipulate is used to replace $f(x),L,k$ by any other values ...

### Gross-Pitaevskii equation with NDSolve

You can run this with FEM, but it will take a bit of time: ...
Accepted

### Simulating a discrete time stochastic process

You can make use of RandomChoice and NestList. Since $\tau_{t+1}$ may depend not only on $\tau_t$ but also on $\tau_{t-1}$, I ...
Accepted

### Need an equation for modeling Tytler's Cycle

The Logistic Equation is used as a model of population growth, but it may be useful for your simulation. This single equation can simulate dad as he ages and tires, and the decline in the third stage. ...

### Simulating the card game War with $m$ suits and $n$ values

This isn't so much an answer as pedagogy. The main reason you can't get your commenceWarCardGame to work is because most of the code in that block isn't part of the ...

### Solving Differential Equation System for HIV Treatment Model

Cesario's answer is almost there, but I'd like to add a couple points of correction/improvement. The problem formulation has constraints on the control (...
1 vote
Accepted

### Simulating the card game War with $m$ suits and $n$ values

Here is a link to some code I wrote to simulate the game. No guarantees. FWIW, it shows a tally of lengths of games for various shuffled decks. Some of these lead to games without ends. https://www....
1 vote

### Evaluating an integral of geometric Brownian motion

You are not replacing P correctly because you are forgeting the "time" argument. Namely, ...
1 vote

### FEM Capacitor Not Converging with Parallel Plate Model

When modeling capacitors, there are a few things that need to be considered. First, one must decide whether to model the volume and the dielectric region or just the dielectric. By using the first ...
1 vote
Accepted

### FEM Capacitor Not Converging with Parallel Plate Model

In the parallel plate capacitor one plate has a positive electric charge $+q$, and another plate has a negative electric charge $-q$, therefore the total electric charge is zero. To avoid this zero ...
1 vote

### Table generation with random variates inside. Mathematica

I would simply make your table explicit, like this: ...
1 vote

### Optimizing Code N-Body Simulation

Here is a simulation to get you going using the gravitation law without changes. I am using a very simple integration scheme, that fails if the bodies come too close. You may improve this if you like. ...

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