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
9
votes
2answers
3k views

How to set up a simple Monte Carlo simulation?

there is a 1% chance that there will be a scattering event, if there is a scattering event the direction of scattering will be determined by a random sample of the custom[a_] function and if there is ...
37
votes
3answers
3k views

Computational Bayesian analysis in Mathematica: Any plans to develop MCMC?

Does anyone know if there are any plans to develop an MCMC capability in Mathematica? My reasoning for asking is that as it stands, I can't seem to find any 'out-of-the-box' functions/capabilities ...
18
votes
1answer
1k views

How best to simulate n-body systems in a functional way?

I want to simulate a N-body system in the most functional way possible. The system I'm modeling are metallic colloidal particles in a solution of peroxide water, as here http://arxiv.org/pdf/1502....
2
votes
1answer
124 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 ...
28
votes
2answers
1k 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: ...
1
vote
1answer
112 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 ...
1
vote
0answers
59 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}=\{...
0
votes
0answers
24 views

Simulates Timeseries with Table

i need your help again. I would like to calculate EW[k_] with EW[1],EW[2] and EW[3]. My code works only for one calculation from EW (in the code below it is EW[1]) but i would like to calculate the ...
13
votes
1answer
2k views

Is there a free version of the Springer book “Mathematical Statistics with Mathematica”?

Is there a free version of the Springer book: $$\text{Mathematical Statistics with Mathematica}$$ by Rose and Smith ... available on the internet?
0
votes
1answer
255 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 ...
7
votes
1answer
134 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. ...
3
votes
2answers
124 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
43 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 ...
0
votes
0answers
56 views

Evaluate value of pi using monte carlo method. This is to be done for Circle inscribed with in Equilateral triangle [duplicate]

I am to able to solve the problem in the Monte Carlo method, where we have to find out the value of PI when a circle is inscribed with a square. But I am trying solve similar problem , when circle is ...
2
votes
2answers
523 views

Solving coupled first-order autonomous differential equations

I am trying to run a simulation of a circuit to observe chaotic behavior, and have obtained a set of differential equations from an analysis of the circuit. I thought perhaps I could produce a plot ...
3
votes
0answers
54 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
160 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 ...
13
votes
3answers
4k views

How to do System Dynamics simulations / diagrams in Mathematica?

System Dynamics is an approach to understanding the behaviour of complex systems over time. It deals with internal feedback loops and time delays that affect the behaviour of the entire system. What ...
6
votes
2answers
197 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 ...
1
vote
2answers
77 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 ...
5
votes
1answer
398 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
50 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 ...
17
votes
2answers
633 views

Partial Differential Equation in Parallel

is there any native way to implement multi-core parallel solving of PDE in Wolfram Mathematica? WM 10 now supports Finite Elements Method, but it is actually useless without parallelization. Usually ...
33
votes
4answers
7k views

Animation of double pendulum

Sadly, I am a completely newbie. I am studying Physics and in our theoretical physics class we got the task to solve the double pendulum using Mathematica. We just got the program, but no introduction ...
3
votes
1answer
231 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 ...
5
votes
1answer
70 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 ...
1
vote
1answer
66 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)=...
3
votes
1answer
172 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, ...
19
votes
2answers
665 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
341 views

Gross-Pitaevskii equation with NDSolve

I want to solve the Gross-Pitaevskii equation with NDSolve, I tried the following code: ...
2
votes
0answers
74 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 ...
5
votes
2answers
354 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 ...
1
vote
2answers
345 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
55 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 ...
0
votes
2answers
79 views

How do I get my simulation to run?

I am simulating a birth-death population process. My code is ...
0
votes
1answer
252 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 ...
39
votes
6answers
4k views

2D random walk within a bounded area

I want to simulate a random walk in two dimensions within a bounded area, such as a square or a circle. I am thinking of using an If statement to define a boundary. ...
0
votes
0answers
73 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 ...
2
votes
1answer
307 views

Monte Carlo simulation of a financial market

I'm fairly new to Mathematica and i want to review the average prices of this model. In order to do that i need to perform a Monte Carlo simulation on my financial markets model: ...
1
vote
2answers
93 views
18
votes
2answers
1k views

How to simulate the true reflective movement of a particle bouncing around in an ellipse?

Please help me to simulate the movement of a particle inside a region with elliptical walls such that particle is reflected from the walls and continues to move. A friend was able write code to ...
17
votes
2answers
1k views

Bouncy Bubbles animation

I want to make a bouncing bubbles animation, looking like this. Here is a start: ...
1
vote
3answers
111 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 ...
2
votes
1answer
171 views

RST controller in Mathematica

I was wondering, if it is possible to simulate an RST controller using Mathematica ? This is what I tried, but the computation of the closed loop does not work: ...
3
votes
3answers
188 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
45 views

Simulation of aberration in axicon lens system [closed]

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

Interstellar Image Effects

I'd like to know how to create this type of gravitational lensing effect in an image (here are some star fields from the hubble) "I wrote down the equations and I tested them in Mathematica by ...
0
votes
1answer
523 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 ...
0
votes
0answers
62 views

Evaluating a SeedRandom simulation

I have the following code it runs the model one time with 6000 iterations: ...