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

learn more… | top users | synonyms

1
vote
0answers
27 views

How to define inclusions in FEM/NDSolve?

I am trying to simulate the compaction process of hot mix asphalts and want to do this with mathematica's FEM libraries. How can I define inclusions in meshes (i.e aggregate particles in the binder) ...
2
votes
1answer
64 views

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

I have a large simulation (1500 lines of code in different sections) and I would like to run the file using different combinations of input parameters without manually changing the parameters. Say my ...
0
votes
0answers
92 views

Need help with very complex mechanical system of equations

I have three equations as follows: $A_p=F \cos(\alpha+ \phi) - \mu N^{'}_{S_1} - \mu N_{S_1} - W \sin \theta = m ( \ddot x - r \ddot \theta (\sin (\gamma+ \phi)) )$ $B_p=F \cos(\alpha+ \phi) - \mu ...
14
votes
1answer
505 views

Gillespie Stochastic Simulation Algorithm

The Gillespie SSA is a Monte Carlo stochastic simulation algorithm to find the trajectory a dynamic system described by a reaction (or interaction) network, e.g. chemical reactions or ecological ...
4
votes
1answer
100 views

Issues with modeling pulses in a very simple system of DAEs

Bug introduced in 10.4.1 or earlier Bug has been confirmed by WRI [Case:3594387]: It does appear that the NDSolve function is not behaving properly in this case and an incident report has been ...
0
votes
0answers
65 views

What code can I use to calculate, integrate, and visualize the electric field for an arbitrary shape? [duplicate]

I'm looking for a Mathematica program/function with which I'd be able to specify two objects in 3D space, each at a different surface potential, and then the program would calculate (using Finite ...
4
votes
1answer
103 views

How can I choose a suitable refresh rate to make a good animation of the wagon-wheel effect?

I'm trying to make an animation of a rotating wheel to show the effect of aliasing in sampled systems. Here is my code, where I use Manipulate to adjust ...
20
votes
1answer
271 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
0answers
58 views

Animation of the wavefield

I was trying to animate contour plot as a function of time. Basically, it is contour plot of wavefield that is changing throughout the time. Here is my attempt: ...
4
votes
2answers
256 views

Calculate $\pi$ using Monte Carlo methods

I know that we can have an estimate of $\pi$ using Monte Carlo methods. I know that we make a huge loop and each time we take randomly two numbers in the range [0,1] and calculate the number of ...
7
votes
3answers
244 views

Simulation with two random walkers on a lattice with periodic boundaries

I am having some difficulties implementing a Monte Carlo simulation in order to compare the results to analytical calculations. The following code simulates a case with one random walker and a ...
-1
votes
1answer
129 views

Periodic boundary conditions for two walkers

For some reason I'm getting infinite loops most of the time i run this. Perhaps the periodic boundary conditions are wrong. Seems like the probability of the two positions to be the same is extremely ...
-6
votes
1answer
119 views

Simulating a “Coin Tossing” Game

i was wondering if i could simulate the following Coin-tossing-game in Mathematica: Two Persons are playing "Coin-tossing" against each other. If one wins, he gives one Dollar to the other. Game ...
22
votes
1answer
290 views

How to model wooden joints with mathematica's FEM?

This is a dovetail joint: and I'd like to see the stresses and deformation on the joint.I haven't seen any modeling of disconnected regions with FEM, only connected regions, so I'm curious if you ...
10
votes
1answer
158 views

Beam deformation due to localized force distribution

I would like to simulate the deformation of a beam which is fixed on one end and has some localized forces applied along the top. I have been inspired by this Mathematica example: http://www....
0
votes
1answer
133 views

How to add moon to orbit Earth that Orbit Sun

I want to add moon(Blue) that orbiting earth(Red). while Earth is orbiting Sun. this is my code so far that consist of earth, sun and moon. how to write a code so that Moon is orbiting earth instead ...
5
votes
2answers
276 views

How to see phase difference of two pendulum

i want to see the simulation of two uncoupled Simple Harmonic Motion (SHM) pendulum with different Lengths and released at different initial displacement angles. in this case adding one more pendulum ...
2
votes
2answers
91 views

How to make A simulation of 2-Dimensional Projectiles

Lets say two cannon is fired at different initial position, initial angle and initial speed. let say initial speed,angle and position for projectile 1= ...
7
votes
0answers
136 views

3D orbits of moons around their respective planets

I have seen a lot of solar system models (both animated and not), but I am trying to replicate the same thing with moons. Either just one planet and its lunar system or the our whole solar system with ...
-2
votes
1answer
95 views

Simulating a Wave Pulse

How to construct a code that superimpose n=10 one dimensional sinuisodal waves. each with an angular frequency ...
3
votes
0answers
55 views

How to do multi-agent modeling?

There are tons of examples here: http://demonstrations.wolfram.com/topic.html?topic=multi-agent+modeling&limit=20 But I been unable to find a good guide explaining what is the recommended ...
5
votes
2answers
1k 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 ...
3
votes
0answers
204 views

How to solve the Tsunami model and animate the shallow water wave?

Recently when I was learning differential equations, I noticed there is a shallow water wave equation to model the tsunami propagation. How to establish and solve the initial and boundary conditions ...
2
votes
1answer
317 views

NDSolve with arrays and Tables of Equations and WhenEvent

I've been toying around with NDSolve for a while, and read through the website. By doing so I discovered that I could use it for vectors and arrays with much pleasure. So I wanted to write a simple ...
3
votes
2answers
168 views

Roulette simulator for a particular series of events

I'm new to Mathematica, and I would like to simulate the game of roulette. I want to bet like \$1 on the opposite color every time four reds or four blacks come up. I would like to know if I will ...
11
votes
4answers
2k views

How to make a Cahn–Hilliard model GIF

The question derived from @Jason B 's answer.I wanna make it but don't how to do.But we can get some rule about the GIF The change of the total pixel is very small. ...
1
vote
1answer
226 views

Ball rotating in a Turntable

I made a turntable to make some experiments and make some studies about Coriolis and Euler forces acting in different frames of reference. ...
10
votes
1answer
322 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 ...
10
votes
0answers
180 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....
1
vote
1answer
62 views

Generate a simulated covariance matrix

I am working on a problem where one of the input variables is the level of covariance between the entries in a particular matrix. To simulate this problem in Mathematica, I will need to feed my code ...
4
votes
2answers
156 views

Confining/Periodic boundary conditions implementation for 2D Random Walker

I am new to Mathematica, and am having trouble implementing confining boundary conditions for a random walk simulation confining the walker to a pre-defined region (periodic boundary conditions would ...
6
votes
1answer
326 views

Battery charge simulation not clipping properly as it iterates

My code for simulating a batterylevel-state throughout a year in 15min-steps doesn't work. There is a certain list-inputs which simulates the charge state and the batterylevel-state, additionally ...
8
votes
2answers
203 views

Evolution of a trait in an asexual population (performance tuning)

I just coded a simple simulation module that looks at the evolution of a continuous trait in a haploid asexually reproducing population under density dependent competition in discrete time (i.e. non-...
4
votes
1answer
928 views

Circular membrane vibration simulation

I'm new in Mathematica and I'm trying to simulate the vibration of a circular membrane for math project but I don't even know how to start. The wave equation describes the displacement of the ...
5
votes
2answers
857 views

Simple Monte Carlo simulation

I want to find the Monte Carlo simulation of the integral $$\int_0^1 \sqrt{1-x^2}\mathrm dx$$ The CesĂ ro mean is $$I_n=\frac1n\sum_{k=1}^{n} f(U_k) $$ I want to plot the scatter plot ((1,$I_1$)(2,$...
4
votes
1answer
116 views

Impact Crater Sim. with added criteria

I have been trying with out success to edit this impact crater simulation script into producing a variable which calculates crater density. In addition I have been trying to figure out how to ...
40
votes
1answer
582 views

Random polyhedra walk

I would like to recreate ssch's random polyhedra random walk, which he posted in the chat. For convenience here it is again: This is my best attempt so far: You can download the notebook with ...
7
votes
1answer
817 views
1
vote
0answers
63 views

Multivariate Path Construction using Sobol numbers

I am sharing my code,which I have tried to perform as per the instruction mentioned below. Please correct it so that I could get my output. Instruction: Use the first m dimensions of the Sobol vector ...
8
votes
7answers
1k views

How to model rolling a pair of dice 100 times (Monte Carlo)

Like the title says, I'm having trouble trying to write out a function that will find the probability of finding the sum of a pair of dice 100 times to find the probability of each sum of 2,3,4,5...up ...
10
votes
2answers
435 views

Impact Crater Simulation

I have been trying to model crater formation on a given planetary surface - $500\,\textrm{km}^2$. The locations of impacts are random, however, if an impact is within $30\,\textrm{km}$ of another, the ...
1
vote
1answer
155 views

How to simulate Multifractional Brownian Motion?

The maximum I would ask, is hints, how to model MFBMotion. Link to paper Firstly, i wanted to simulate in MATLAB that code: ...
35
votes
7answers
1k views

Nice formatting for the results of a dice game simulation

One of my Mathematica interests is in problems related to the formatting of output. Getting nice formatting from Mathematica is often frustrating, but occasionally Mathematica will delight me by ...
1
vote
2answers
203 views

Simulation Beta Distribution

Suppose a function such as: $\phi^{\alpha} (x,y) = \left\{ \begin{array}{l l} \alpha x & \quad \text{if $x < y$}\\ x & \quad \text{if $x = y$}\\ \alpha x + (1 -\alpha) & ...
6
votes
1answer
249 views

Simulation Sample Paths for Stochastic Approximation Algorithm

Let $X_t$ be IID random variables in $[0,1]$ and CDF $F(\cdot)$. Suppose there exists a variable $Y_t$ given by: $Y_1 = X_1$ and $Y_t = \phi(X_t, \overline{Y}_{t-1}), \forall t >1$, where $\...
2
votes
0answers
148 views

Creating an orrery

I am interested in creating an orrery, ideally with SystemModeler. I have been experimenting with the MultiBody library since that allows you to do animations. The most relevant example seems to be ...
8
votes
3answers
310 views

When does a list contain only ones?

I am starting with a list of length n that contains all -1's. For instance, when n = 6 the list is {-1, -1, -1, -1, -1, -1}. I ...
2
votes
2answers
113 views

How to create a bar graph that evolves in time to monitor a simulation

I imagine a random process that proceeds as follows: Suppose there are $n$ dice. ($n$ is pretty big). They exist in an arena. They are all bouncing around. They start in a random configuration. If ...
8
votes
1answer
482 views

Optimizing Monte Carlo simulation of a Pred-Prey model

My assignment and code As part of an assignment for one of my classes, I'm trying to run a "massive" Monte Carlo simulation in Parallel on the follow model: ...
4
votes
1answer
98 views

Adding extinction factor to Monte Carlo analysis

I'm looking to add an absorption component to this Monte Carlo analysis, essentially I want there to be a 1% chance that a photon gets absorbed at each event as it travels through the medium, once the ...