Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 6358

Simulation is the imitation of the operation of a real-world process or system over time.

7 votes
Accepted

Michaelis–Menten kinetics using Tau-Leaping

Hack #1: add 10^-100 to the argument of PoissonDistribution. This won't appreciably affect the rates, but will prevent PoissonDistribution[0] from occurring. This reveals another potential problem: …
Chris K's user avatar
  • 20.4k
6 votes

Speeding up the Kuramoto model on a random graph

There are probably other improvements to be had, but the first thing I noticed is passing a bunch of InterpolatingFunctions out from a[l,t] seems inefficient. This calculates more in a[l,t] and speed …
Chris K's user avatar
  • 20.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: ClearAll[n]; reactions = {n -> 2 n, n -> Null}; b0 = 3; d0 = 2; rates = {b0, d0}; init = …
Chris K's user avatar
  • 20.4k
12 votes

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 lines to define the arena: {m1, b1} = {2, 0}; {m2, b2} = {-1, 1}; {m3, b …
Chris K's user avatar
  • 20.4k