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

learn more… | top users | synonyms

2
votes
0answers
116 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 ...
0
votes
1answer
91 views

WSMModelData Error

I am getting this error message when I run simulation in Mathematica that makes iterations to a SystemModeler model. ...
8
votes
3answers
298 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
93 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
415 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
85 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 ...
4
votes
2answers
362 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 ...
12
votes
4answers
1k views

3D Random Walk with Periodic Boundary Conditions

I am working on a 3D random walk with periodic boundary conditions and have written a program that will do this for me, but it is extremely slow. Does anyone have any suggestions on how I could speed ...
4
votes
1answer
70 views
1
vote
0answers
164 views

Finding the point of best focus for a ball lens [closed]

This is my project (simulation): A set of parallel rays goes trough a ball lens (circular lens). Because of spherical aberration, refracted rays will not meet in a single point. Find the distance ...
19
votes
2answers
4k views

Creating a simulation of our Solar System

As the title says, my objective is to create a simulation of the motion of the planets in our Solar System using Mathematica. All the theoretical background regarding the equations of motion of ...
1
vote
2answers
121 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 ...
2
votes
2answers
183 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 ...
17
votes
4answers
2k views

Finding the volume of a sphere using the Monte Carlo algorithm

I used the following code to find the volume of the sphere $x^2+y^2+z^2 \leq 1$ in the first octant: ...
1
vote
1answer
246 views

Marking the points of x-intercept on a plot

OK, I have a nice plot of some oscillating motion. I can read some stuff off the graph, but I thought it would be cool to show a dot where the curve hits the x-axis and a little label showing the ...
19
votes
2answers
2k 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 ...
4
votes
2answers
181 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. ...
5
votes
2answers
428 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 ...
3
votes
1answer
93 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. ...
5
votes
3answers
257 views

Split list of states by run lengths and discontinuous changes in state

I was asked to look into writing some simulation code for a user, where the simulation output (x) would oscillate between three possible states: ...
0
votes
1answer
87 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
120 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 ...
3
votes
1answer
990 views

Solar system simulation (n-body physics) with OpenCL

I would like to simulate a n-body solar system in Mathematica. I have found the following example: ...
28
votes
1answer
349 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: Since it's been one and a half year since then I've certainly had time ...
1
vote
1answer
69 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 ...
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? ...
1
vote
2answers
102 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 ...
6
votes
3answers
374 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
52 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 ...
2
votes
0answers
159 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
138 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; ...
0
votes
1answer
77 views

How can I use manipulate on multiple lists within a function?

So I have my N-Body Problem set up like so, and I can plot it in ListPointPlot3D, but I cannot figure out how to stick this into a manipulate function. ...
2
votes
0answers
137 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, ...
4
votes
1answer
251 views

Monte Carlo Volume Calculation and Speed Up

I am trying to do a Monte Carlo area calculation for an irregular area defined by: $$0 \le x \le 1, 10 \le y \le 13, y \ge 12 \cos(x), y \ge 10 + x^3$$ I used the code with modifications (so I can ...
0
votes
1answer
41 views

Repeating a Function [closed]

I have created a function transitions[x_] that takes in a value of x but the output is a different vector each time as I have used the RandomVariate function. I ...
0
votes
1answer
45 views

Simulating from Custom Function

I am going through an old research paper and I am stuck in one area of the coding. I'll spare you with most of the details but the function I want to simulate from is a complicated multivariate beta ...
-1
votes
1answer
131 views

Making animations with Mathematica [duplicate]

I want to export an animation for polar plot $r=\cos 2\theta$, instead of directly using Animate. But I want a table of snapshots: movie = ParallelTable[...] and a point that produce its animations ...
2
votes
0answers
176 views

Mathematica + System Modeler or Matlab + Simulink [closed]

I want to learn control systems(Using Ogata Modern Control Systems Book) and I am not sure in which should I invest : Matlab+Simulink+Control systems = aprox 220 euro Mathematica + Workbench + ...
2
votes
1answer
829 views

Test a wooden board's vibration mode

Here is a wooden board, with dimensions shown on the picture below. How we can use Mathematica's newly build-in finite element analysis features to show the different modes of its vibrations. Assuming ...
104
votes
7answers
18k views

How to generate a random snowflake

'Tis the season... And it's about time I posed my first question on Mathematica Stack Exchange. So, here's an holiday quest for you Graphics (and P-Chem?) gurus. What is your best code for generating ...
0
votes
0answers
94 views

How do I perform the following numerical integration

I have the following integral to evaluate numerically: $$x(t) = \frac{1}{f(t)}\int_0^{t_b} t^m (t + n)^o \sin(pt) \mathrm{d}t \quad m,n,o,p \in \mathbb{R}$$ ...
2
votes
1answer
82 views

Stochastic Approximation and Simulation using Running Median

I have a function $$F(X_{t+1},Y_{t}^{med})= \alpha X_{t+1} + (1-\alpha) Y_{t}^{med},$$ where $$Y_{t}^{med} = Median(Y_1, Y_2,... Y_t).$$ Moreover, $Y_1 = X_1$ and $Y_t = F(X_{t},Y_{t-1}^{med})$ ...
0
votes
0answers
60 views

How to set the boundary fixed and apply the Young's modulus in Mathematica's FEM? [duplicate]

Provided the drawing .stl is given, and the Young's modulus is know, how to start a FEM vibration mode test in Mathematica? The boundary is required to be fixed and the interested focus is on the ...
5
votes
1answer
200 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
71 views

Determining the total illumination of a polygon

Is it possible to determine the total illumination of a particular polygon with the given light sources? I truly acknowledge that Mathematica is not supposed to do this modeling, but it is what ...
1
vote
1answer
150 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) & ...
1
vote
1answer
245 views

Potential hill simulation

I attempted to simulate the motion of a particle approaching to a potential hill. The particle should experience a force of -1/r^2, if the equation for the ...
3
votes
1answer
490 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 ...
7
votes
0answers
220 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 ...