Questions tagged [simulation]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
71 views

Is it possible to create the following simulation in mathematica?

Consider a set of discrete "states" $|1\rangle,|2\rangle,|3\rangle,\dots,|N_{\text{max}}\rangle$). Next, assume that there are 1000 "particles" occupying the state 1 at the initial moment of "time". ...
1
vote
2answers
97 views

Dice Rolling Simulation [closed]

I'm simulating a sequence of dice rolls by choosing a random integer between 1 and 6. I need to use FoldList to generate a function that returns a list which describes how the cumulative total varies ...
0
votes
0answers
26 views

Simulation of a compound renewal process with copula dependency

I'm new to Mathematica and this is brief about my project that I would like to seek advice from this group about my coding. My project is to perform 100 simulations with 1000 iteration each based on ...
3
votes
2answers
140 views

Plotting tens of thousands of functions together on the same axes

I'm trying to plot a large number of functions together on the same axes. Each of these functions is the result from one iteration of a Monte Carlo simulation. Essentially, I'm varying parameters of a ...
8
votes
2answers
2k views

How can I show that a sphere is rolling in a simulation?

I recently wrote code to simulate a table tennis ball rolling on the ground. v0 = 10; w0 = 8; R = 4; mu = 0.2; g = 9.8; δ = (2 (v0 + w0 R))/(5 mu g); This gives ...
0
votes
1answer
92 views

Simulating a poker win rate over time

Poker players start with a fixed bankroll (bankroll) and play with a win-rate winRate (say measured in dollars per hour) and ...
0
votes
0answers
36 views

Simulating a function with no closed form solution

So I am trying to simulate a function in 3d. Suppose our function looks like this: f=k*r*a I am interested in simulating the numerical values of k when r is ...
1
vote
0answers
36 views

Is it possible to speed up SDE simulation?

Is it possible to speed up SDE simulation in Mathematica? I am simulating a large number of Heston processes that look like the following (note this code is only a slight modification of the ...
1
vote
0answers
44 views

Simulating a bicycle going around a circle

I want to simulate a bicycle moving around a circle. Instead of graphs and calculations, I want to almost see an actual simulation of this happening. How could I do this? I tried looking up ...
2
votes
1answer
167 views

Monte Carlo Simulation of a Double Well Potential (Edited)

I am looking for a possible way to simulate the temperature effect on a collection of atoms sitting within a double well potential, say something like ...
1
vote
1answer
126 views

Numerical simulation for density of strings in a ball

I am trying to numerically reproduce the Mathematica result for the density of strings in a sphere as explained here. The program is to generate random, uniformly distributed pair points on a unit ...
2
votes
0answers
110 views

Noise covariance matrix

I am trying to find the noise covariance matrix of a random vector $\mathbf{x}$ with itself. The elements of this vector represent image pixels and are treated as random variables i.e, $\mathbf{x}=\{...
28
votes
2answers
2k views

Animating wave motion in water

Further to this question I found on MSE, I tried to replicate from here this is as far as I got: ...
5
votes
1answer
235 views

Trying to compute the heat capacity for the 2D-Ising model

I'm trying compute the heat capacity $C_v$ out of my simulation for the 2D-Ising model which is given by $C_v = \frac{\langle E^2 \rangle - \langle E \rangle^2}{T^2N^2}$ ($E$: Energy, $T$: ...
3
votes
2answers
134 views

Initial values of position (x) and speed (v) of a particle visualizing using Mathematica

$$\vec{F}(\vec{r})=-m\omega^2\begin{pmatrix}x\\4y\end{pmatrix}$$ I have the force $F$ shown above. How could I specify the initial values of position ($x$) and speed ($v$) in Mathematica using the <...
1
vote
1answer
282 views

Solving Differential Equation System for HIV Treatment Model

I was working on a project about optimal strategies for HIV treatment, models used from [Butler, Kirschner, and Lenhart] 1997. This model explains the spread of HIV viruses in the human body, where ...
1
vote
1answer
63 views

Manual control plots differ from StateResponse and OutputResponse

So In my quest to try to learn some control theory inspired by the following link, I have been modeling an inverse pendulum regulated with a flywheel. The system model is pretty ok I think, and when ...
3
votes
0answers
80 views

Inhomogeneous Compound Poisson process

I need to use a compound Poisson process with time-varying jump intensity. Mathematica has the function of compound Poisson process as well as inhomogeneous Poisson process, but no combination of ...
5
votes
3answers
176 views

Improving the run time of random walk simulation

One of our professors told us that during his thesis he used Mathematica in simulating it since it is about networks, I don't know how he did it but all I know is he said it took about two weeks to ...
6
votes
2answers
286 views

How to simulate a random walk to randomly generated particle to another particle fixed at the center of a grid?

I am new in Mathematica, it is my first program. Many codes of diffusion-limited aggregation are available but, they are too difficult to understand. I basically want to create a simulation of the ...
5
votes
1answer
416 views

Random walk in one dimension — meeting of two particles

I'm new to Mathematica and still teaching all by myself, hope you bear with me. I have the code: ...
1
vote
1answer
82 views

How to plot lines using consecutive points from an array using ParametricPlot3D or so?

I was trying to simulate Gravitational Orbits using Newtonian Gravitation. I did not use NDSolve[] but instead used finite differences; coded myself. The code for ...
3
votes
1answer
343 views

How to directly input calculated Geodesic differential equation into *NDSolve*

I am trying to find the trajectory of a test particle around a relativistic object. Initially, I was trying the Kerr metric as spacetime but the final simulations clearly were not correct as I saw the ...
7
votes
1answer
141 views

Efficiency in calculation on graphs: Compile?

Basic Question I have a looping calculation that I need to perform on some large lists a very large number of times, and as I have written the functions the computational speed is prohibitively slow. ...
5
votes
1answer
71 views

Random normalised variable generation

I want to generate 8 random variables (in reality to form 4 complex numbers) such that the sum of the 8 variables squared is equal to unity. The aim of generating such numbers is to perform a quantum ...
0
votes
1answer
37 views

How to (efficiently) generate and catch some data-set that has similar correlation?

...
1
vote
1answer
71 views

Infinite potential, prevent value to go beyond zero, initial value problem

How do you make a wall potential in Mathematica. Meaning : I want my potential to have a wall at 0 : $ U(x)=\left\{ \begin{split} & x>0 : U(x) = f(x)\\ &x=0: U(x)=U_0 \\ & x<0: U(x)=...
2
votes
1answer
196 views

Including periodic boundary conditions when drawing box of particles

This is essentially a follow-up question to this older post. Given a configuration of tubes (or for simplicity cylinders), we draw them in a box using Graphics3D, ...
2
votes
0answers
83 views

NDSolve can solve two systems of equations separately but not simultaneously

I want to solve a system of coupled equations. After facing problems solving the coupled system, I reduced it to both of the systems uncoupled. Even uncoupled, the equations will not solve ...
0
votes
1answer
456 views

Gross-Pitaevskii equation with NDSolve

I want to solve the Gross-Pitaevskii equation with NDSolve, I tried the following code: ...
1
vote
2answers
477 views

Schrödinger equation with a potential step

I want to simulate a Gaussian wave packet colliding with a potential step. I tried this (it indicates what do I want to solve, however I know it is naive): ...
1
vote
0answers
72 views

How to simulate two coupled birth-death-immigration processes?

I am simulating a birth-death-immigration process for two coupled populations that interact by virtue of the birth-rate in one population being equal to the death-rate in the other population. The two ...
1
vote
2answers
86 views

How do I pull a multiple pieces of data from a while loop and put into a table

I am wanting to pull multiple pieces of data from a while loop and put it in a list. The example I have added below is a table with inputted data that I found. Im pretty sure the syntax is unrelated ...
0
votes
2answers
83 views

How do I get my simulation to run?

I am simulating a birth-death population process. My code is ...
0
votes
1answer
559 views

Using Random walk on a region [duplicate]

I want to simulate a random walk on two dimension equation using module. Checked the input so the path works ...
1
vote
2answers
94 views
3
votes
3answers
506 views

2D Random walk under specific boundary

I try to create the code so that from initial point (that I can set), code runs so that it performs random walk, yet it turns off once the point hits the wall. I tried this method however, I was not ...
1
vote
0answers
51 views

Simulation of aberration in axicon lens system [closed]

Is it possible to simulate axicon in mathematica and analyzed different properties like the aberration?
0
votes
1answer
658 views

Best Mac for Mathematica [closed]

I am looking to buy a new Apple laptop or desktop for running Mathematica. What Mac is best, especially if I want to run numerical simulations in Mathematica? (A similar question was asked a few ...
5
votes
2answers
378 views

Birth Death Process with Delay

I would like to simulate birth process with time delay. Here is a reference ref on page 3. Note there is two species whereas in my case I have one species. So only equation (1) and (2) should be ...
0
votes
0answers
65 views

Evaluating a SeedRandom simulation

I have the following code it runs the model one time with 6000 iterations: ...
4
votes
1answer
566 views

Schemes for nonlinear advection equation

I am working in the traffic flow problem using the Lighthill-Whitham-Richards model together with the Greenshields equation. The equation of that model is this: $$ \frac{\partial\rho}{\partial t}+v_{...
1
vote
3answers
118 views

Number of realizations in NExpectation, Method Monte Carlo

I have been looking in NExpectation about how large the sample size is when Mathematica performs Monte Carlo simulation. For example, if we write ...
5
votes
1answer
174 views

Michaelis–Menten kinetics using Tau-Leaping

I am trying to implement Michaelis–Menten kinetics using Tau-Leaping. It works fine as expected. Only issue here is when substrate reaches zero the algorithm stop since PoissonDistribution[0] gives ...
19
votes
2answers
808 views

Simulation of diffusion in a grid

I want to simulate a diffusive process in a 2D grid, for a central initial value of 1 to the adjacent cells initially at 0. At each time step, the value of the +1 level adjacent cells are increased ...
0
votes
1answer
174 views

Solve simultaneous integral equations [closed]

I am a beginner at mathematica, so I have made huge blunders in my code which gave too many errors so I did not think it would be relevant to post it. I will try and explain my target as well as ...
9
votes
3answers
736 views

Creating random configurations of spherocylinders or cylinders

About the setting: We have a 3D simulation box with side $l$ and our catesian coordinate system is set with its origin at the centre of the box. We have a number $N$ of spherocylinders of aspect ...
0
votes
0answers
75 views

How to organize code for simulating many ODEs?

I have a large model with many variables (about a hundred) and many differential equations (non-linear). What is the best way to handle a system this size in Mathematica? Note that I am not asking ...
11
votes
2answers
913 views

Two bouncing balls in 1 dimension, issues with two different methods?

I'm trying to simulate 2 balls with the same mass and diameter bouncing one on top of another under gravity, see the illustration below (not ideal, but this is the best result I've got so far, the ...
1
vote
2answers
406 views

Michaelis–Menten kinetics using Gillespie Algorithm

I am trying to implement Michaelis–Menten kinetics using Gillespie Algorithm. $$\text{Reaction 1:}\quad E+S\rightarrow C$$ $$\text{Reaction 2:}\quad C\rightarrow E+S$$ $$\text{Reaction 1:}\quad C\...

1
2 3 4 5