# Questions tagged [simulation]

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

201 questions
Filter by
Sorted by
Tagged with
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?
1answer
455 views

### Simulating a bounded continuous random walk in $n$-dimensions

You're given three $n$-dimensional real vectors, $\mathbf{x_0}$, $\mathbf{a}$ and $\mathbf{b}$, with $\mathbf{a} \le \mathbf{x_0} \le \mathbf{b}$ (vector inequality means component-wise inequality). ...
0answers
41 views

### Works in mathematica but not as cdf preview or web embedded cdf [duplicate]

I have a curvature simulation with the help of m_goldberg that works in mathematica but does not work as a cdf in cdf preview. In mathematica it says nothing while in cdf preview or while web embedded ...
2answers
166 views

### how can I make a control for my vector equation in my simulation?

I'm trying to build a control selector or menu for equations to put into my curvature simulations. However all the code I've tried hasn't worked.Does anyone know how I could make a control selector or ...
1answer
190 views

### Randomly generated polymer with certain spatial density

For simplicity's sake, let the polymer's composing particle be integer 3-tuples (on 3D Cartesian grid), such that: Polymer-ness -- for all particle there is an directly adjacent neighbor. i.e in ...
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 ...
1answer
281 views

### How to simulate the 1-D motion of a particle under constant acceleration? [duplicate]

I am trying to represent the position of an object under freefall, but am completely lost. Here is my attempt so far: ...
3answers
285 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: ...
1answer
81 views

### RandomVariate does not evaluate a Hyperbolic Distribution

Any Idea why I can't get a result from this expression: ...
2answers
1k 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 ...
1answer
207 views

### Simulation code performance tuning

The following simulation takes over 20 seconds for evaluation. I have difficulty re-coding it with Nest and Map or Compile functions to make it more efficient. Can some one help with this? The ...
1answer
560 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 ...
1answer
1k views

### Simulating a quick return mechanism

Last time, I got a satisfying answer for simulating a toggle mechanism, just as expected. NDSolve is great. I tried playing with it (as a matter of fact, @MichaelE2 ...
3answers
323 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 ...
3answers
1k views

### How can I simulate this toggle mechanism?

I've been introduced to Mathematica very recently. Basically, I haven't actually "solved" anything in my Mathematica lifetime, but I've done some simulations. With my fractional knowledge, I tried ...
7answers
28k 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 ...
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 ...
1answer
1k views

### Detecting a collision in n-body simulation with NDSolve

Consider this three-body system: ...
0answers
2k 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: http://www.wolfram.com/mathematica/new-in-8/cuda-and-opencl-support/simulate-thousands-of-particles-...
5answers
900 views

### Problem using WhenEvent to constrain solution

Note: This question has also been posted at the Wolfram Community Problem: Simulate pressure in volume 1 and 2 for 1 second. The circuit is as follows: From this I set up the governing DE for both ...
2answers
529 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 ...
4answers
4k views

### Finding the area of a circle using monte carlo simulation [duplicate]

I wrote the following code to find the area of the circle $x^2+y^2=1$ using monte carlo simulation : ...
4answers
5k 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: ...
7answers
2k 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 ...
2answers
2k views

### How to improve the accuracy of this Monte Carlo simulation

A friend of mine went on an interview and he was asked to calculate the angle between the hour hand and minute hand of an analog clock when the time was 3:15. Arguably, this is a trivial problem that ...
1answer
589 views

### Changing a wave simulation

I want to adjust some code that I found on this Wolfram Demonstration: http://demonstrations.wolfram.com/WaterRipplesPassingThroughASlit/ Basically it shows a wave passing through a single slit. I ...
0answers
1k views

### Resources on Mathematica and strong AI (a.k.a. AGI) [closed]

David Deutsch (physicist / quantum computing theorist) wrote an article for Aeon Magazine last year: On Artificial Intelligence that got me thinking. The article assesses and critiques the ...
1answer
117 views

### Random variation inside NMaximize

I am using NMaximize as following code. ...
2answers
352 views

### Problem in simulating discrete time stochastic

I have been playing with some stochastic questions and specially the problem here.It seems no matter for the first time in bet, gambler is going to lose the first bet.Am I right?How can we correct the ...
1answer
332 views

### Making an animated simulation without procedural loops

I'm still new to Mathematica and this is the first time I've wanted to do something more complicated than plotting and changing parameters of mathematical functions. I want to make a simple ...
1answer
259 views

### Calculating mean of multiple stochastic processes and setting a lower threshold

Thanks to “Rod Lm” I got some very nice input for the following problem. My intention is to simulate within a Manipulate function a given number of possible stock ...
2answers
449 views

### Simulating a Stochastic Process within certain bounds

I would like to simulate paths of a Geometric Brownian Motion till it hits one of two barriers, say 10 or 200. ...
1answer
228 views

### Symbolic Simulations

I have 9 nonlinear equations and 10 unknowns. It is not possible to obtain a numeric solution but I do get a parametric solution. It is useful in my case because I want to observe how parameters (p1, ...
3answers
925 views

### Simulate a simple spinner

I'm teaching some simple ideas in probability to students in grade 7. The "spinner" below works, but I'm wondering how I could make it just a bit more realistic by having it actually "spin" around a ...
1answer
1k views

### Simulating discrete time stochastic dynamic systems

What is the canonical way of simulating discrete time stochastic dynamical systems in Mathematica using the new functionality of Random processes? To take a concrete example, lets consider the ...
2answers
800 views

### How do I represent a system dynamics feedback loop?

In System Dynamics, if I want represent the relationship between Speed and Distances, I create a Flow (Speed) and a Stock (Distance) as you can see in this Insight Maker Sample . Heres an Image of how ...
2answers
1k views

### Running a Numerical Simulation on a System of Differential Equations with unique initial conditions

I have a system of differential equations as follows: ...
2answers
804 views

### Efficient GeometricBrownianMotionProcess Monte Carlo simulation

Following the answers in this post, I'm trying to implement something similar. If the GBM stays inside the corridor [L, U] between predefined times it should return ...
2answers
9k 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 ...
1answer
2k views

### Monte Carlo simulation using geometric Brownian motion

I'm relatively new to Mathematica programming, so forgive my rather unsophisticated question: I'm trying to do a Monte Carlo simulation using geometric Brownian motion (GBM). I want to write a ...
1answer
1k views

### How to start simulating physical problems?

I'm quite new to Mathematica, I have version 9. I need to use it to simulate some physical problems. I know the equations (like Maxwell's equations and Newton's laws and so on), but I have no real ...
1answer
406 views

### 1D Random Walk with Excluded Sites and Variable Time-Step

Here is the physical problem I would like to simulate: Consider the following variations to the 1d random walk: allow for certain, random sites to be excluded with probability 1/2. allow for the ...
1answer
630 views

### Simulating Theatre puzzle

I have been trying to simulate the process of the theatre puzzle from the Joy of X (Strogatz). The puzzle, and some relevant material are here. My simplistic coding for this process follows: ...
2answers
782 views

### Fast Simulations with Compile

this post relates to another post that I didn't follow up propely. If I wanted to simulate a system of stochastic proesses like the following, and loop over this run many many times would writing the ...
2answers
815 views

### Fluorescence Correlation Spectroscopy Simulation

I am simulating Fluorescence Correlation Spectroscopy which basically involves tracking the random motion of particles in a box with periodic boundary conditions and then calculating their intensity ...
0answers
371 views

### How to save (large) data generated from simulations

The following is a simple example of a much larger simulation that I want to run Define some processes ...
1answer
340 views

### Speed up iterated manipulations of a graph / table

I am trying to generate a version of Watts' model of cascading shocks to a network following the discussion on p. 20-25 of this article. The basic premise is to use the ...
4answers
2k 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 ...
1answer
909 views

### Simulating Stochastic Processes the MMA way

This question is really a specific problem and a methodological one concerning MMA best practices. I want to simulate a system of stochastic processes. If this were a geometric Brownian motion or ...
2answers
7k views

### Making mathematical animations with Mathematica

I recently stumbled upon the Cycloid and was working on finding its length and such when I found this animation on Wikipedia. Strikingly pretty and small in size too (66KB) So on searching how he ...