Questions tagged [simulation]

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

Filter by
Sorted by
Tagged with
5
votes
0answers
45 views

Random Number Generation on Parallel Cores [duplicate]

So, I've noticed an odd trend in some of my Mathematica results recently- I'm running large Monte Carlo simulations on a system that involves running several jobs independently, each on a different ...
3
votes
1answer
235 views

Time varying delay differential equations

I would like to know if it is possible in Mathematica to simulate a differential equation with varying delay for example the logistic equation: $$x'(t)=x(t)(1-x(t-\tau(t)))$$ where for example $\tau(...
2
votes
1answer
86 views

How to simulate data points from the following distribution?

I have the random variable $X\sim0.5Normal[2,2]+0.5Normal[20,2]$ and I am trying to use Mathematica to simulate, say, 500 points from this distribution. I briefly looked into Monte Carlo Simulation ...
3
votes
4answers
128 views

Monte Carlo or how to calculate the model several times

follow question: How can I calculate this model several times automatically. ...
2
votes
1answer
171 views

RST controller in Mathematica

I was wondering, if it is possible to simulate an RST controller using Mathematica ? This is what I tried, but the computation of the closed loop does not work: ...
3
votes
0answers
96 views

Why does the domain of an interpolating function not match the corresponding ParametricNDSolve solution range?

Question I had believed - and mostly observed - that when I use ParametricNDSolve the obtained ParametricFunctions given as the ...
5
votes
1answer
826 views

Brownian dynamics simulation

is there any way to improve computational speed of the following Brownian dynamics simulation of a trapped particle in the Markovian case ? I time-discretized the equation of motion and then use a ...
6
votes
1answer
139 views

Rotational Cam and Follower Simulation

I have the following data of a cam profile: ...
4
votes
1answer
533 views

Modeling Antennas

Radio amateurs often use EZNEC to model antennas. I was wondering if anyone knows of a Mathematica code to model and simulate an antenna. I have not found anything with a google search.
24
votes
3answers
1k views

Modeling the spread of an infection in networked computers

I would like to show the iterative stages of infection for problem 2 in this link. In case the link dies, I have copied the text for the problem below: One hundred computers are connected in a ...
8
votes
2answers
240 views

Mosteller's First Ace Problem

[this probably belongs on cross validated ... ] Working through Mosteller's Fifty Challenging Problems in Probability with Mathematica. I am trying to understand Mosteller's answer for The First Ace ...
13
votes
2answers
611 views

How to implement lane-change rules for Nagel Schreckenberg model

I am trying to extend the Nagel-Schreckenberg model for traffic flow to include two lanes of traffic. I have a function that generates information about a random initial road configuration. A road ...
0
votes
1answer
125 views

Calculating minimum potential energies for Thomson problem

I have found a table of values for minimum potential energies up to 470 electrons on Wikipedia. However, the method I used for calculating energies is not efficient enough for configurations that have ...
-1
votes
1answer
42 views

How to perform this operation in Mathematica?

Let S be a vector of 1000 Elements (nonzero elements: output of some calculations). Let T be a vector of 10 elements (nonzero elements: output of some calculations). Let C be a vector of 10 elements ...
2
votes
1answer
404 views

Manipulate initial conditions of a DE

I have a differential equation that I want to solve numerically, $$y''(t)+3H(t)y'(t)+m^2y(t)=0, \quad H(t)^2=\frac{1}{6M_p^2}(y'(t)^2+m^2y(t)^2)$$ $$N=\int H(t)dt$$ I want to plot $y'(t)$ vs $N$ but I ...
4
votes
2answers
332 views

Calculating the current through coil with a flyback diode using NDSolve

I plan to simulate the current through a coil with flyback (or freewheel) diode for an arbitrary voltage signal (square or PWM modulated signal is possible). You can find the circuit diagram over ...
3
votes
1answer
156 views

Need help setting up a numerical simulation and getting output into a table

I would like to set up a simple numerical simulation of a model - but I don't know how to do it in a simple and efficient manner. Here's what I want to do (using a simplified example): I want to ...
1
vote
1answer
92 views

Flatten:flpi message generated with RotationTransform with more points

I am doing a very small job of making points rotate or diffuse randomly on a circle. I generate the particles using positions = RandomPoint[Circle[],100] and ...
1
vote
0answers
115 views

Circular membrane vibration [duplicate]

I'm having a problem in a mathematica code I made to observe the normal modes of a vibrating circular membrane. This is a function I made When d==2, I show a 2D graph of the normal mode. After the ...
1
vote
0answers
105 views

How to avoid unnecessary calculations in a numerical simulation and improve performance? [closed]

Corresponding to the previous question I posted: Discontinuous boundary condition distorts in the numeric solution. ...
0
votes
1answer
197 views

Beginner Simulating Gaussian Process with Correlation

I have no little experience with algorithms. I would like to learn how to simulate a real valued Gaussian process with correlation (e.g., exponentially correlated $\Gamma(t)=e^{-\vert t \vert/2}).$ ...
3
votes
1answer
747 views

How to make a pendulum simulation draw the bob's trajectory?

This is the code for a simple pendulum simulation ...
1
vote
1answer
143 views

Coding a simulation of multi-species population dynamics

I want to code several steps in a recursion equation (in my case, migration, followed by selection, followed by mating, etc in a population). I have seen this done using a lot of copying and pasting ...
-2
votes
1answer
1k views

Random coin toss; toss 10 coins; repeat 100 times

I want to simulate a coin toss game in which 10 coins are tossed. Afterwards, I want to repeat this simulation 100 times. So far I have: ...
2
votes
0answers
441 views

Simulate Geometric Brownian Motion with stochastic drift

I want to simulate a GBM with its drift parameter follows some continuous time Markov chain. For example, \begin{align} dK & =\mu Kdt+\sigma K dW \end{align} where $\mu$ follows continuous-...
17
votes
2answers
1k views

Bouncy Bubbles animation

I want to make a bouncing bubbles animation, looking like this. Here is a start: ...
2
votes
1answer
396 views

How to tell Mathematica do parallel computation?

I am using NDSolve on a workstation with 6 kernels. To speed up the simulation I have used LaunchKernels[] to load all the ...
15
votes
1answer
997 views

Obtaining a 3D animation as a drop in a liquid surface

Someone could get a similar solution like this animation? I believe the solution is useful for demonstrations in class to other users who teach Math. Spreading of a Thin Liquid Drop Under the ...
1
vote
0answers
103 views

How to define inclusions in FEM/NDSolve? [closed]

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

averaging over large number of random realizations

I want to run following for few hundreds of a random variable set. This calculates: generate normal random variable find gain with squaring calculate performance metric find ...
3
votes
1answer
826 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 ...
23
votes
1answer
2k views

Gillespie Stochastic Simulation Algorithm

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

Solve and design “water flow”

In some strategy game I play, I'll have to change the terrain to make the water flow in some specific way to fulfill my goal. The water flow changes with terrain so if I can change the terrain wisely ...
0
votes
0answers
79 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
2answers
307 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 ...
7
votes
1answer
209 views

Issues with modeling pulses in a very simple system of DAEs

Bug introduced in 10.4.1 or earlier and fixed in 11.0.0 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 ...
4
votes
2answers
1k 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 ...
8
votes
3answers
422 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
164 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 ...
-5
votes
1answer
352 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 ...
24
votes
1answer
693 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 can ...
11
votes
1answer
479 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....
1
vote
1answer
791 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 ...
26
votes
1answer
944 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
649 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 ...
3
votes
2answers
559 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
400 views

Simulating a Wave Pulse

How to construct a code that superimpose n=10 one dimensional sinuisodal waves. each with an angular frequency ...
4
votes
0answers
328 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 ...
1
vote
1answer
311 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. ...
12
votes
4answers
3k 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. ...