Tagged Questions

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

learn more… | top users | synonyms

1
vote
0answers
54 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 ...
1
vote
0answers
90 views

Finding the point of best focus for a ball lens

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 ...
0
votes
0answers
26 views

WSMModelData Error

I am getting this error message when I run simulation in Mathematica that makes iterations to a SystemModeler model. ...
0
votes
0answers
79 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}$$ ...
6
votes
1answer
288 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: ...
1
vote
1answer
69 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
54 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
161 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
65 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
votes
1answer
424 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 ...
1
vote
1answer
113 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
229 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
237 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
162 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 ...
0
votes
0answers
131 views

Stochastic Simulation using the Gillespie algorithm

I'm trying to reproduce the simulation with demographic stochasticity in Figure 1 from the paper entitled "Dynamical Resonance Can Account For Seasonality of Influenza Epidemics" ...
5
votes
1answer
472 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
2answers
74 views

Numerical simulation - getting slower the more data I have [closed]

I'm simulating the trajectory of a charged particle. I have the coordinates saved in the list $coor$ ({{0,0,0},{0.1,0.1,0.003}, etc}) as the time goes on this array is getting bigger and the ...
3
votes
1answer
154 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). ...
0
votes
0answers
32 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 ...
3
votes
3answers
130 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 ...
2
votes
1answer
100 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 ...
3
votes
1answer
111 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: ...
5
votes
3answers
231 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: ...
3
votes
1answer
56 views

RandomVariate does not evaluate a Hyperbolic Distribution

Any Idea why I can't get a result from this expression: ...
0
votes
1answer
130 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 ...
1
vote
1answer
65 views

Moving the start of a graph to the right, finding maxima in an oscillator

I have the following code written to simulate a driven damped oscillator ...
1
vote
1answer
132 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 ...
0
votes
1answer
96 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
1answer
287 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 ...
12
votes
3answers
552 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 ...
92
votes
7answers
15k 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 ...
2
votes
0answers
625 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: ...
4
votes
5answers
407 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 ...
8
votes
2answers
311 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 ...
4
votes
4answers
856 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 : ...
15
votes
4answers
1k 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 = 1$ in the first octant: ...
0
votes
0answers
145 views

Approximating a stochastic integral with a Wiener process

I would like some assistance to solve the following: $\sum\limits_{i=0}^{n-1} e^{-k(n\Delta t -i\Delta t)}\Delta z_i$ where $z$ is a Wiener process, $\Delta z_i = z((i+1)\Delta t)-z(i\Delta t)$. ...
11
votes
2answers
626 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 ...
4
votes
1answer
256 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 ...
7
votes
0answers
707 views

Resources on Mathematica and strong AI (a.k.a. AGI)

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 ...
0
votes
1answer
99 views

Random variation inside NMaximize

I am using NMaximize as following code. ...
1
vote
2answers
220 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 ...
1
vote
1answer
192 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 ...
1
vote
1answer
194 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 ...
5
votes
2answers
231 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. ...
-2
votes
1answer
188 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, ...
12
votes
3answers
479 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 ...
13
votes
1answer
489 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 ...
3
votes
2answers
334 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 ...
1
vote
2answers
532 views