Questions tagged [simulation]

Simulation is the imitation of some real thing, state of affairs, or process. The act of simulating something generally entails representing certain key characteristics or behaviours of a selected physical or abstract system.

5194 questions
5
votes
3 answers

Serious performance issue with iterating simulations

I recently stumbled upon a performance problem while implementing a simulation algorithm. I managed to find the bottleneck function (signally, it's the internal call to arrayfun that slows everything down): function sim =…
Tommaso Belluzzo
  • 23,232
  • 8
  • 74
  • 98
5
votes
2 answers

Best algorithm for optimizing the decisions in a simulation

I'm looking for the best algorithm to optimise the decisions made in a simultaion to find a fast result in a reasonable amount of time. The simultaion does a number of "ticks" and occasionaly needs to make a decision. Eventually a goal state is…
5
votes
2 answers

js - simulate key press without specifying an element

I would like to simulate a key press in JavaScript. preferably without specifying any element. The way I would like to do it is to use .focus() on an input and then simulate a key press like the character "a". Just the same thing that would happen…
pls_help
  • 71
  • 1
  • 2
  • 9
5
votes
1 answer

Reset Series index without turning into DataFrame

When I use Series.reset_index() my variable turns into a DataFrame object. Is there any way to reset the index of a series without incurring this result? The context is a simulation of random choices based on probability (monte carlo sim), where…
randyslavage
  • 65
  • 1
  • 5
5
votes
5 answers

Jelly physics 3d

I want to ask about jelly physics ( http://www.youtube.com/watch?v=I74rJFB_W1k ), where I can find some good place to start making things like that ? I want to make simulation of cars crash and I want use this jelly physics, but I can't find a lot…
rodin19
  • 51
  • 1
  • 2
5
votes
1 answer

Troubleshooting R mapper script on Amazon Elastic MapReduce - Results not as expected

I am trying to use Amazon Elastic Map Reduce to run a series of simulations of several million cases. This is an Rscript streaming job with no reducer. I am using the Identity Reducer in my EMR call --reducer…
wahalulu
  • 1,447
  • 2
  • 17
  • 23
5
votes
1 answer

Cache line padding for variables that are a multiple of cache line size

I am creating a very fast multi-threaded discrete event simulation framework. The core of the framework uses atomics and lockless programming techniques to achieve very fast execution across many threads. This requires me to align some variables to…
nic
  • 1,511
  • 2
  • 14
  • 27
5
votes
4 answers

Determinants of huge matrices in MATLAB

from a simulation problem, I want to calculate complex square matrices on the order of 1000x1000 in MATLAB. Since the values refer to those of Bessel functions, the matrices are not at all sparse. Since I am interested in the change of the…
Robert Filter
  • 1,661
  • 3
  • 12
  • 14
5
votes
3 answers

An advice for a design between parent and child classes?

I'm working on a physics simulation. I have an ArrayList that holds all the objects in my simulation. I have a parent class: Shape, and two child classes: Circle and Rectangle. The parent class, of course, doesn't have a draw() method but each of…
Robot0110
  • 191
  • 8
5
votes
2 answers

Connecting Unity simulation with python controller over TCP

for the purpose of a pilot study i try to connect a simple simulated environment in Unity with a python controller based on neural network. The main character in the simulated Unity environment should learn a behavior based on it's experience: The…
thecritter
  • 73
  • 1
  • 6
5
votes
2 answers

Python/Numpy: Conditional simulation from a multivatiate distribution

Using numpy I can simulate unconditionally from a multivariate normal distribution by mean = [0, 0] cov = [[1, 0], [0, 100]] # diagonal covariance x, y = np.random.multivariate_normal(mean, cov, 5000).T How do I simulate y from the same…
dms_quant
  • 85
  • 1
  • 4
  • 10
5
votes
2 answers

Poor sympy linsolve/ solve performance

I'm using sympy to solve a simple linear system of equations. It's a coupled ODE, there are time-derivatives of variables and I need to solve the system of equations for the highest derivatives. Since sympy doesn't allow me to solve for statements…
lhk
  • 27,458
  • 30
  • 122
  • 201
5
votes
2 answers

How to enable message encryption in Contiki / Cooja simulator?

I want to encrypt the messages that are exchanged between sensor nodes. Can I do it without having access to real hardware sensor nodes, such as Tmote Sky? Can software encryption/block ciphers only be simulated on Tmote Sky nodes? If I need to use…
nana
  • 91
  • 1
  • 2
  • 7
5
votes
1 answer

Value-at-Risk (Extreme-Value Theory) using Monte Carlo Simulation in R

I have code that successfully calculates VaR based on Extreme Value Theory using historical data. I'm trying to run this same code on multiple simulated price paths (i.e. calculating a VaR for each path) and then taking the median or average of…
5
votes
1 answer

ODE solver from Lagrangian/Variational Methods in C++

I have a general question which I will phrase in the context of a more concrete situation. If one wants to find the dynamics of a double pendulum, one can mathematically derive the equations of motions, rewrite the ODEs to have a special form useful…
Heidar
  • 159
  • 1