Skip to main content

All Questions

Tagged with
2 votes
1 answer
78 views

How can I make my force calculations better?

I am making a simple physics solver (haven't gotten to collision resolution or detection yet, just finished making it mt'ed), and when I apply forces through "W", "A", "S"...
misInformationSpreader's user avatar
0 votes
1 answer
77 views

Temperature of a Lennard-Jones system

Are the formulas used in getTemperature() and setTemperature() correct? ...
user366312's user avatar
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. ...
user366312's user avatar
3 votes
1 answer
131 views

Improving execution time of physics, data acquisition triggering system simulation

Background I'm attempting to write a physics simulation code, one portion of which involves simulating the triggering system of some equipment. The equipment works as follows: environmental noise (...
MomentumEigenstate's user avatar
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 ...
Pietro Scapolo's user avatar
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 ...
Oliver Schönrock's user avatar
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 ...
Paul Aner's user avatar
  • 131
4 votes
2 answers
432 views

Clebsch-Gordan Coefficients Implementation

In scientific programming I often come into the position of needing to implement a rather obscure and complicated formula. Clebsch-Gordan coefficients are such a thing. I'm mainly seeking advice on ...
infinitezero's user avatar
8 votes
4 answers
2k views

Simulation of a falling ball

I made a simple simulation of a falling ball. Is it possible to somehow improve or optimize this code? What tips can you give for development? ...
TuleKr1s's user avatar
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: ...
David's user avatar
  • 111
13 votes
2 answers
5k views

A Flappy bird Game

Here is a project that I have been working on for the past few days. I have used the SFML library in C++ to make a flappy bird game of my own. I made this as a ...
user avatar
3 votes
1 answer
78 views

Dynamical system animation framework

Introduction I am developing a dynamical system simulation/animation framework, which provides three abstract base classes, DynamicalSystem, ...
Richard Mace's user avatar
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 ...
ad1v7's user avatar
  • 133
4 votes
2 answers
493 views

Modelling solar system, Runge-kutta 4 (n-Body problem)

I have a program that simulations all planets, where the forces due to each planet is considered during each time step.I'm looking to see where I could make some improvements. main.cpp ...
Methodicle's user avatar
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. ...
Gilfoyle's user avatar
  • 1,125

15 30 50 per page