All Questions
Tagged with physics simulation
43
questions
0
votes
1
answer
77
views
Temperature of a Lennard-Jones system
Are the formulas used in getTemperature() and setTemperature() correct?
...
1
vote
2
answers
162
views
Minimalistic implementation of Leapfrog integration algorithm (2)
Please review this C++ listing of an implementation of Leapfrog integration.
This C++ listing is rewritten according to this review.
...
6
votes
2
answers
870
views
Molecular simulation: Minimum Image Convention
Can you review the following code to check to see if the Minimum Image Convention is properly implemented?
...
6
votes
2
answers
482
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 ...
2
votes
1
answer
161
views
Simulation of a real capacitor to calculate its capacitance
The goal is to simulate a real flat plate capacitor in 2D. The potential of the armature is fixed to +V and -V, on the edges of the simulation cell the potential is zero. Between the plates of the ...
11
votes
3
answers
516
views
Membrane protein diffusion in different confinement models
I am a junior Software Engineer, C++ is usually my main jam but I started picking up Python for a research project I am doing in college. I am eager to learn as much Python syntax, tricks, best ...
10
votes
1
answer
922
views
High performance physics simulation - core class design
Below is some stripped down code from a physics simulation. The classes Vector2, Line and ...
3
votes
1
answer
503
views
Barnes-Hut \$n\$-body simulation (3D) in C++
I have implemented the Barnes-Hut algorithm for \$n\$-body-simulations (in this case "sort-of" 3D-gravity - see below). I'd appreciate any comments for improving my code (especially ...
4
votes
1
answer
411
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:
<...
4
votes
2
answers
117
views
Simulate transmission spectrum of extreme ultraviolet laser pulse through laser-dressed finite sample (Python Version)
I am currently participating in research on transient absorption spectroscopy and four wave mixing. In the experimental design, an extreme ultraviolet (XUV) laser pulse and infrared (IR) laser pulse ...
3
votes
0
answers
37
views
MatLab: Plotting Output Electric Field Spectrum
Goal
This code combines two matrices, diagonalizes that matrix, and finds the right and left eigenvectors, right and left eigenvectors are normalized with respect to each other, then it is multiplied ...
1
vote
1
answer
47
views
Optimize narrow phase contact detection for phyiscs simulation code
I'm trying to optimize the narrow phase of the contact detection in my code. I'm using OpenMP for multithreading.
That is the starting code:
...
3
votes
1
answer
216
views
Molecular dynamics simulation
I'm looking for some fresh ideas on how to optimize a couple of functions in my C++ code. I run the code through a profiler and it shows that they take 20% and 40% of the time respectively. The ...
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 ...
33
votes
9
answers
8k
views
Simple n-body class in C++
As part of my training, I implemented a n-body class in C++ to simulate gravitational interaction of bodies and to get more familiar with features that C++ offers such as object oriented programming.
...