Pseudo Code for Numerical Integration (2 of 2) // update physics void doPhysicsSimulationStep(delta_t) { copy cur_S to prior_S; // calculate state der
{"Image DocumentName": "Pseudo Code for Numerical Integration (2 of 2)", "Image ImageDescription": "// update physics. void doPhysicsSimulationStep(delta_t) { copy cur_S to prior_S; // calculate state derivative vector. for (i=0; i<N; i++) { S_deriv[2 i] = CalcForce(i); // could be just gravity. S_deriv[2 i+1] = prior_S[2 i]/mass[i]; // since S[2 i] is // mV \uf0e0 divide by m. } // integrate equations of motion. ExplicitEuler(2 N, cur_S, prior_S, S_deriv, delta_t); // by integrating, effectively moved. // simulation time forward by delta_t. t = t + delta_t;", "Image XResolution": "37", "Image YResolution": "37", "Image ResolutionUnit": "Pixels/Centimeter", "Image Software": "SlidePlayer", "Image YCbCrPositioning": "Centered"}