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

learn more… | top users | synonyms

0
votes
0answers
61 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
94 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 ...
0
votes
0answers
55 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
1answer
73 views

Issues with modeling pulses in a very simple system of DAEs

Some time ago I had asked this question about evaluation difficulties using Euler Integration to solve a system of ODE where discrete pulses occur. While I have now abandoned Euler integration and ...
4
votes
2answers
245 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
229 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
126 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
110 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
271 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 ...
8
votes
1answer
130 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: ...
0
votes
1answer
124 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 ...
19
votes
1answer
253 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 ...
5
votes
2answers
252 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
88 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= ...
-2
votes
1answer
92 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
50 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 ...
3
votes
0answers
177 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 ...
1
vote
1answer
206 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. ...
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. ...
7
votes
0answers
135 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 ...
10
votes
0answers
159 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 ...
1
vote
1answer
54 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
142 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
324 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 ...
3
votes
2answers
154 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 ...
8
votes
2answers
194 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. ...
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 ...
4
votes
1answer
115 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 ...
1
vote
1answer
137 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: ...
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 ...
2
votes
2answers
261 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 ...
5
votes
2answers
821 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 ...
4
votes
2answers
325 views

Evaluation problems with NDSolve using the fixed step ExplicitEuler-Method

Motivation I am using Mathematica to implement System Dynamics (SD) models, e.g. differential equation models as applied to management/economic problems following the "methodology" of Jay W. ...
1
vote
2answers
166 views

Simulation of LogNormal process for an asset pricing

I'm new to Mathematica programming, so forgive my rather unsophisticated question. I need to simulate 5000 "walks" of a process value (of a stock) that starts from its current value, at ...
3
votes
1answer
94 views

How to deal with Part in a function?

I need to iterate several functions such as {3 x[[1]]^2 + x[[2]], x[[2]], x[[3]]}, {Exp[x[[4]]], x[[2]], x[[3]], x[[4]]},etc. ...
0
votes
1answer
91 views

My simulation is not never finishing and it is taking so much time?

I am running simple code which involves calculation of two first order differential equations.It is taking so much time and i am unable to get the results as the simulation is never finishing. ...
2
votes
2answers
137 views

How to speed up a system simulation?

I need to simulate a series of nonlinear (and linear) with thousands of state variables. Here is a simple linear example ...
1
vote
1answer
76 views

How would I go about simulating conditional random birth 100 times?

So I have the following scenario: Assume you have this organism that reproduces by itself. An organism either reproduces 0, 1, 2, or 3 organisms at a time. Assume they're asexual and reproduce only ...
40
votes
1answer
568 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 ...
5
votes
3answers
1k views

How to define a distribution that 90% of the time gives me 0?

This maybe a simple question, but I am just stuck with it. I want to do some simulation, say with 0.9 probability, I get a 1, and 0.1 probability get a 0. How would I do that? Where should I start? ...
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 ...
1
vote
2answers
124 views

Random walk using Module [closed]

I want to create a random walk using Module. The walk start at {0, 0}. At every step, x ...
9
votes
3answers
449 views

Simulate random data with correlation

I would like to simulate some random data e.g. between 0 and 1, but with a given correlation. In other words some data where the correlation between two datasets is e.g. a constant or within a give ...
0
votes
0answers
84 views

Simulation of the semicircle Wigner Theorem

Let's begin with some termes: For $1\le i<j<\infty$ let $X_{i,j}$ be independant and indentically distributed (i.i.d) real random variables with mean $0$ and variance $1$ and set ...
5
votes
2answers
927 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 ...
1
vote
1answer
99 views
6
votes
0answers
364 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 ...
1
vote
0answers
186 views

Simulate a polygon bouncing with collision detection inside a circle/polygon

Simulate a polygon bouncing with collision detection inside a circle/polygon. the example can be see in help page by searching WhenEvent; ...
3
votes
0answers
150 views

How to control pedestrians to enter the simulation region with random functions?

I am working on simulating crowds of a cross-typed region, given that pedestrians entering from 4 gates of north, east, west and south, ...