Skip to content

Commit 00fee33

Browse files
committed
adding a few comments for the c++ implementation.
1 parent ab089b7 commit 00fee33

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

chapters/computational_physics/verlet.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ void stormer_verlet(double pos, double acc, double dt){
153153
// Simple function for velocity-verlet
154154
void velocity_verlet(double pos, double acc, double dt){
155155

156-
// Note that we are using a temp variable for the previous position
157156
double time, vel;
158157
vel = 0;
159158
time = 0;
@@ -169,6 +168,12 @@ void velocity_verlet(double pos, double acc, double dt){
169168

170169
int main(){
171170

171+
// Note that depending on the simulation, you might want to have the verlet
172+
// loop outside.
173+
174+
// For example, if your acceleration chages as a function of time, you might
175+
// need to also change the acceleration to be read into each of these
176+
// functions
172177
verlet(5.0, -10, 0.01);
173178
stormer_verlet(5.0, -10, 0.01);
174179
velocity_verlet(5.0, -10, 0.01);

0 commit comments

Comments
 (0)