All Questions
Tagged with numpy simulation
28 questions
3
votes
5
answers
2k
views
How do I speed up this simulation program
This is a program to solve a differential equation numerically using Euler method. As of now, it is very slow, and I need to run 10000 Monte Carlo simulations.
The differential equation is called ...
6
votes
2
answers
503
views
Means square displacement (MSD)
I have written a code to calculate the MSD of some molecules. The code averages over multiple time origins (sliding time window) and over all the molecules. I have also made it do one extra thing: do ...
4
votes
1
answer
424
views
Path of a particle in a non-uniform B field
I have completed my project which simulates the path of a particle trapped in a device known as a magnetic mirror. I would like your thoughts and improvements on my implementation.
Here is the code:
<...
10
votes
1
answer
336
views
From Hummingbirds to Ornithopters: Simulating the Aerodynamics of Flapping Wings
Ptera Software
A Flapping Wing Aerodynamics Simulator Written in Python
Motivation
About a year ago, I became fascinated by how animals fly. As an aerospace engineering student, it surprised me that ...
3
votes
1
answer
1k
views
N-Body Gravitational Simulation of Point-Masses in Python
I made an n-body gravitational simulation in python. The algorithm does produce an approximate solution, which is shown at the bottom of the post. Additional methods to produce animations (among other ...
3
votes
1
answer
355
views
Particle simulator using Python - Why is the NumPy version slower than pure Python?
This is an interesting example from G.Lanaro's book, Python High Performance. The program is a simple simulator which describes movement of particles based on their positions and angular velocities (<...
8
votes
2
answers
1k
views
Schelling's model of Segregation Python implementation with Geopandas (Follow-up)
This is the repost of the following question as suggested by @HoboProber .
Again, if you don't know what is Schelling's model of segregation, you can read it here.
The Schelling model of ...
6
votes
1
answer
584
views
Schelling's model of Segregation Python implementation with Geopandas
If you don't know what is Schelling's model of segregation, you can read it here.
The Schelling model of segregation is an agent-based model that illustrates how individual tendencies regarding ...
5
votes
1
answer
331
views
Agent based model in Python
My model is based on the Ultimatum Game. I won't go into the intuition behind it but generally speaking it functions as follows:
The game consists of a n × n lattice on which an agent is placed at ...
13
votes
1
answer
342
views
Population dynamic simulation on biological information maintenance 2
This question is the follow-up to this previous question.
Background
Using this simulation I investigate a system in which enzymes proliferate in cells. During the replications of enzymes, ...
9
votes
1
answer
210
views
Population dynamic simulation on biological information maintenance
Background
Using this simulation I investigate a system in which enzymes proliferate in cells. During the replications of enzymes, parasites can come to be due to mutation. They can drive the system ...
5
votes
2
answers
247
views
Birthday paradox simulation
I'm writing a simulator which checks how many balls we need to occupy every box or how many balls we need for any box has at least 2 balls (birthday paradox). I wrote the script in python and it is so ...
8
votes
1
answer
116
views
Python implementation of approximating the chance a particle is at a location after n steps in the cardinal directions
Recently, I became very interested in a probability practice problem in my textbook for my class. I decided to implement it in code and I think I got most of it implemented. Right now, I'm hoping to ...
3
votes
2
answers
169
views
Simulation of an alien population
Background
I've come across a puzzle (Problem 10 from this list of sample interview questions):
One day, an alien comes to Earth. Every day, each alien does one of four things, each with equal ...
1
vote
1
answer
184
views
k-armed bandit problem in Python
I implemented k-armed bandit problem in C#, MATLAB and Python. C# and Matlab code run fairly fast (With same settings of T = 2000 and nRun = 1000 the elapsed time is about 6sec). However, the Python ...