All Questions
Tagged with numpy simulation
29 questions
0
votes
0
answers
14
views
Split-step Fourier method for ultrashort pulse propagation predicts everything, but not the spectral phase
I'm implementing in Python the split-step Fourier method (SSFM) to solve the non-linear envelope propagation equation (NEE), and I'm including second and third order dispersion (GDD, TOD), self-phase ...
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
512
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
425
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
341
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
589
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
334
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
347
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
220
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
256
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
178
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 ...