How to simulate a Particle Motion 1D Acelerated Movement??

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.
1
2
3
4
5
6
7
8
9
10
11
const double acceleration = 1; // m/s^2
const double 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;
}
Topic archived. No new replies allowed.