Hello. I am Enrique. I am studying at my university a first course of 1D Particle Motion Acelerated Movement.
I want to be able to simulate it into my computer. How can I get done this?? I know how to implement it to calculate the values associated to each one, but i don't know how to treat it as a simulation.
I have read before about timestep, i have also seen it into Electronics Circuits Simulator the word Timestep.
For example. I am a car, running into road, and always stay updated with my position and associated data, and also to be able to handle many problems like predicting behaviour.
I want to tell to you that i have also a Github, github.com/enriquemesa8080 . I have many projects availables, if you tried some one, let me know, and share with your colleages.
constdouble acceleration = 1; // m/s^2
constdouble timestep = 1e-3; // 1 ms
double speed = 0; // m/s
double position = 0; // m from origin
for (double t = 0;; t += timestep){
std::cout << "At t = " << t << ", x = "
<< position << ", v = "
<< speed << std::endl;
speed += acceleration * timestep;
position += speed * timestep;
}