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
1 vote
1 answer
74 views

Value of a function over permutations of two lists

I want to do the sum (in Ising lattice gauge theory) ...
QFTheorist's user avatar
1 vote
1 answer
45 views

Sum on a lattice where variables can only take two values (Ising lattice gauge theory)

I want to study the Ising Gauge Theory which has the Hamiltonian \begin{equation} \mathcal{H} = -J \sum_{n,\mu,\nu} \sigma_3(n,\mu)\sigma_3(n+\mu,\nu)\sigma_3(n+\mu+\nu, -\mu)\sigma_3(n+\nu, -\nu) \...
QFTheorist's user avatar
3 votes
1 answer
540 views

How to simulate a directed acyclic graph?

My goal is to have a code to identify and estimate the regression models associated with a directed acyclic graph (DAG), which is obtained through the reduction of a given weighted, directed graph <...
Tugrul Temel's user avatar
  • 5,470
19 votes
1 answer
2k views

Efficiently Mowing Grass with Mathematica

Recently, I was mowing my yard and was thinking about how to use the least amount of time/fuel and how to simulate. Mowing a yard that is shaped as a convex polygon is not difficult, you can just make ...
Teg Louis's user avatar
  • 383
3 votes
1 answer
147 views

Thermodynamics of the 2D Ising model

I want to study the thermodynamics of the 2D Nearest Neighbour Ising model (calculate the average energy, susceptibility, etc.). I have the Hamiltonian $$\mathcal{H} = J\sum_{\langle i j \rangle} s_i ...
QFTheorist's user avatar
0 votes
1 answer
75 views

Exploring Variability: 100 Stochastic Simulations of Cumulative Incidence

We know $R_0=0.75$ and $\gamma=0.4$. So with the following code I calculate $\beta$ ...
Athanasios Paraskevopoulos's user avatar
3 votes
1 answer
190 views

Simulating the Conduction of Heat on a Metal Rod

Consider the one-dimensional heat equation $$ \frac{\partial u(x,t)}{\partial t}=\alpha\frac{\partial^2 u(x,t)}{\partial x^2}, \quad (x,t)\in (0,L)\times (0,\infty), $$ subject to the ...
Bell's user avatar
  • 249
3 votes
0 answers
70 views

Fast Multipole Methods [closed]

My goal is to model electrostatic containment of point charges (protons). I understand the basic N-body potential calculation is O[N^2}, and a potential of q/|ri-rj| (constant mass and charge, ...
Jim Hargis's user avatar
2 votes
1 answer
99 views

Need an equation for modeling Tytler's Cycle

In all cultures over all time there appears, in different languages for different countries, the maxim "Shirtsleeves to shirtsleeves in three generations." This is a function with three ...
Rogo's user avatar
  • 790
15 votes
1 answer
353 views

Gravitation simulation and interaction of N (1000) massive objects

Is there an implementaion of the Barnes-Hut algorithm running with Mathematica? Thanks a lot
Rémy Galli's user avatar
1 vote
2 answers
113 views

Simulating the card game War with $m$ suits and $n$ values

I am trying to simulate the card game War to find approximations to the stopping time distribution for different types of decks, and study conditional probabilities of winning given a certain deck. (...
Teg Louis's user avatar
  • 383
1 vote
1 answer
162 views

Colored plot with Wolfram Mathematica

I saw this image thus I guess that it is possible to color some regions in a plot. What kind of command can I use to have a similar plot?
Spook82's user avatar
  • 95
2 votes
1 answer
89 views

Simulating a discrete time stochastic process

I would like to simulate and plot many paths of a discrete random variable $\tau_{t}$ that follows the following process: with probability $\tau_{t-1}$, $\tau_{t}$ is either $0.6$ with probability $x$...
Federico's user avatar
0 votes
1 answer
55 views

Evaluating an integral of geometric Brownian motion

I am a Mathematica novice. For an operations research application, I am trying to work with the following wealth process in Mathematica, $$ d W_t = (\rho W_t + P_t) dt\ , $$ where $P_t$ is a stream ...
Anthony's user avatar
  • 155
2 votes
1 answer
82 views

How do I simulate an ItoProcess that is not supposed to become negative?

I have a process that is similar to a Cox Ingersoll Ross process. Like a CIR process this process does not become negative. However, when I define the process with ItoProcess and I simulate it with ...
kef's user avatar
  • 21
3 votes
2 answers
129 views

FEM Capacitor Not Converging with Parallel Plate Model

I am trying to model a 3D electrostatics finite element model of a capacitor to see if I can accurately model the behavior of a parallel plate capacitor before I alter the geometry of the electrodes ...
Dallon Penney's user avatar
0 votes
0 answers
65 views

Non-linear regression simulation

I have a sequence of data: data = {{20, 291}, {21, 440}, {22, 571}, {23, 830}, {24, 1287}, {25, 1975}, {26, 2744}, {27, 4515}, {28, 5974}, {29, 7711}}; The data is ...
yixjia's user avatar
  • 33
0 votes
0 answers
32 views

Change parameter in dynamically updating plot // Manipulate outside of Dynamic // GUI for dynamic plot

I want to dynamically plot the Kuramoto model with the parameter K as an adjustable slider \dot theta_i = omega_i + K/N \sum_j sin(theta_j - theta_i) For fixed K, ...
khev's user avatar
  • 1
1 vote
0 answers
47 views

Plot the graph with two best response functions, Mathematica

I have another doubt regarding Mathematica. This is probably another question that can be easily answered, but since I'm a beginner it's a while that I'm stuck. Since I'm using Mathematica online, the ...
Gabriel T's user avatar
0 votes
2 answers
68 views

Table generation with random variates inside. Mathematica [closed]

I'm new on this forum, and I'm also a new user of the software Mathematica. For this reason, I'm sorry if my question will be unclear and / or dumb. I have to make a numerical simulation with random ...
Gabriel T's user avatar
1 vote
0 answers
36 views

Plotting a parametric function for a given prior distribution of parmaeters

I have a function $f(x, \alpha, \beta)$. The function is piecewise defined and not analytically integrable. I would like to do the following: draw from a distribution on $\alpha$ and $\beta$, compute $...
John Ritz's user avatar
4 votes
1 answer
150 views

Optimizing Code N-Body Simulation

below is my code for a gravitational n-body problem. I know Mathematica has a n-body simulation function however I am programming this to learn Mathematica more and programming numerical techniques. ...
Carlos Villeda's user avatar
1 vote
1 answer
101 views

Simulating network evolution based on common neighbors

I am new to studying networks in Mathematica and I would like to model the following network evolution process: Start with a random graph $g_0$ with $n$ nodes, $n$ even. At each time $t$, ach node $i$...
raving-bandit's user avatar
0 votes
0 answers
92 views

How to set this DAE "ball sliding along a frictionless slope" system initial conditions?

How to set this DAE system initial conditions? I want to find out the trajectory of a particle sliding along a frictionless slope, but my code can't work. What's wrong? How should I fix it? Thank you ...
xingzheshengcun's user avatar
1 vote
0 answers
93 views

Real-time interactive simulation

I would like to know how to use mathematica to make a real-time physics simulation that can be interacted with using a cursor. As an example, consider a classical magnetic dipole in a background field,...
Diffycue's user avatar
  • 1,756
4 votes
1 answer
260 views

How to simulate hysteresis loop for a ferrimagnetic material

I am trying to modify a ferromagnetic hysteresis loop to ferrimagnetic hysteresis loop. Below is the equation I used for ferromagnetic simulation : Below is the code for above equation: ...
Mariam Jacob's user avatar
0 votes
1 answer
212 views

Sticky Collisions (perfectly inelastic)

There is an awesome simulation https://mathematica.stackexchange.com/a/124926/87086 which shows N particles bouncing in a box (with elastic collisions), made by @Feyre https://mathematica....
Zach's user avatar
  • 373
0 votes
1 answer
83 views

Plot two list for differen first list parameter

I have a series of equations based on which I plot final lists of "xA1","yB1". I need to change "xA1 = {0.55}" and "yB1 = {0.6}" between [0,1] with interval 0....
Ahmad's user avatar
  • 77
0 votes
1 answer
135 views

Simulate geometric brownian motion and use generated data for calculations

I want to generate a geometric brownian motion A with mean $MuA$, variance $SA$ and starting value 0.05. I do the following: ...
NC520's user avatar
  • 407
6 votes
1 answer
609 views

Solving 2D Landau-Khalatnikov equation & Poisson equation using finite element approach

I would like to solve Landau-Khalatnikov (LK) equation and Poisson equation using finite element approach to simulate ferroelectric hysteresis loop, electric potential distribution and electric ...
YSP's user avatar
  • 63
5 votes
2 answers
246 views

Speeding up the Kuramoto model on a random graph

I am solving the Kuramoto model on a random graph $G(n,p)$, plotting the synchrony against the coupling parameter, as follows, ...
apg's user avatar
  • 2,027
9 votes
3 answers
520 views

How to make all the balls move until they stop by NBodySimulation

...
yode's user avatar
  • 26.3k
6 votes
1 answer
145 views

How to use the option ExternalForce in NBodySimulation

I want to simulate the movement of a small ball on a curved track like the following: This is my current code: ...
yode's user avatar
  • 26.3k
1 vote
2 answers
730 views

How To Make Monte Carlo Simulation Run Faster

I'm running a Monte Carlo simulation of stocks prices in which the data that is used to define the Skewed Normal Distribution updates after 1,000 simulations. Thus it is crucial that I get this code ...
Daniel Berkowitz's user avatar
0 votes
1 answer
119 views

NBodySimulation softening parameter

I'm simulating the orbit of a binary black hole immersed in some halo of particles and the simulation does not want to continue on for the specified amount of time. It always halts at a seemingly ...
shanedrum's user avatar
  • 557
1 vote
0 answers
157 views

How can I solve the 2D diffusion equation over a region that contains mobile sinks?

I am looking for guidance on how to simulate the following system in 2D. I have a region, assumed to be rectangular for simplicity. A substance is diffusing into this region from its boundary. Again ...
dr_strangeloop's user avatar
0 votes
2 answers
153 views

Antithetic Variates in Monte-Carlo simulations (code taking too long to execute)

I am trying to use the Antithetic Variates method to reduce error in stock price estimates. Essentially, I generate pairs of negatively correlated RV's and use them to simulate stock price. The ...
kymset's user avatar
  • 1
1 vote
0 answers
293 views

Fokker-Planck equation [closed]

Is there any package for simulation of Fokker-Planck equation in Mathematica? Or, in general for stochastic differential equations?
user avatar
0 votes
1 answer
198 views

How can I get the compensated compound Poisson process in Mathematica

Let us consider the following martingale "compensated compound Poisson process" $M_t=\sum_{k=1}^{N_t} Z_k-\lambda t E(Z)$ where $N_t$ is a Poisson process with intensity $\lambda$, $Z_k$ is ...
Ailiy Evan's user avatar
0 votes
1 answer
116 views

Simulating electrons passing through a beam splitter for random number generation

I would like to write a program that would simulate the trajectory of an electron/photon passing through a 50-50% beam splitter and depending on which detector the particle is measured, it would ...
Assassinos's user avatar
0 votes
1 answer
104 views

NDSolve not finding the right solution for a mass hanging of a thread

My NDSolve isn't predicting the right trajectory for one particular case of a problem. System Consider a mass vertically hanging by an almost inelastic thread. The ...
lineage's user avatar
  • 1,114
1 vote
1 answer
190 views

Too slow using Dsolve

I am referring to the accepted answer to the question: Solving n simultaneous differential equation The issue is that the code is running too slow for even N=5! Is there any way to make it faster? I ...
Jasmine's user avatar
  • 1,225
1 vote
1 answer
86 views

Trying to make the animation showing the process of integration using Wolfram Mathematica

I'm pretty new here, I'm trying to make a animation of integration in Wolfram Mathematica, but it's getting me a headache I really don't know how to do this. The point is to ilustrate the process of ...
Trashlife's user avatar
0 votes
1 answer
72 views

How to find estimates and bias from simulated data using method of least square estimation

...
Akhilraj N S's user avatar
2 votes
1 answer
225 views

Simulate spring wire through fixed points

Suppose we have a wire made of an ideal spring steel. If we bend it and then release any external force it will straighten itself into a perfect line. Suppose also that the wire is attached to some ...
azerbajdzan's user avatar
  • 9,653
1 vote
2 answers
140 views

How to find estimators of unknown parameter of a distribution using method of least square estimation

I had defined pdf of distribution, generate data and specify the least square function.I am not aware of the code for finding estimators and bias of this distribution using method of least square ...
Akhilraj N S's user avatar
0 votes
2 answers
92 views

Building up functions from data sheet

I'm trying to use a list of data points from a csv file to perform multiple calculations and plot the end result. Basically I have 3 columns of data in my csv, I need the second and third to be pulled ...
cman22's user avatar
  • 1
4 votes
1 answer
161 views

Trouble iterating my forest fire simulation

I'm having some trouble iterating my simulation of a forest fire. I'm new to Mathematica, so apologies for poor coding. I'm sure there are far neater and more efficient ways of doing this, but I would ...
user77287's user avatar
0 votes
1 answer
97 views

Numerical simulation

I want to generate a numerical simulation in table for an equational output. I have used following code. But somehow I can't get any output. I am very novice to Mathematica. Can anyone please ...
Jui Sen's user avatar
  • 113
8 votes
0 answers
232 views

How can we improve transonic flow visualization?

With this code we can make 2D FEM simulation of transonic flow around airfoil NACA 0012 at Mach number of 0.925. It takes about 5 minutes on the XENIA-15 laptop of 32 GB memory with processor Intel ...
Alex Trounev's user avatar
  • 41.8k

1
2 3 4 5 6