Implement Demo 1 from exercise sheet #2

Open
opened 2023-10-30 16:39:02 +01:00 by kookroach · 0 comments
Owner

Get yourself familiar with cpp and try to implement demo 1

  • Demo 1, a simple one-step test:

  • Manually calculate the solution to the 2-point mass-spring setup above, with the parameters given
    there for Euler and midpoint (no need to submit this) for a time step h = 0.1.

  • According to the class definition in “MassSpringSystemSimulator.h” file, implement your “MassSpringSystemSimulator” class. Your class should have the two integration methods.

  • In Visual Studio, set the “simulationsRunner” as the startup project. In addition, in main.cpp, replace “#define TEMPLATE_DEMO” with “#define MASS_SPRING_SYSTEM” at line 23. Then you can run and test your MassSpringSystemSimulator class.

  • Build and run the basic test case, and print the solution (i.e., new position and velocity for both points) after one time step to the command line. (Hint: don’t be surprised if the differences between both methods are quite small – the important thing is to note how they’re different.)

Get yourself familiar with cpp and try to implement demo 1 - **Demo 1, a simple one-step test:** - [x] Manually calculate the solution to the 2-point mass-spring setup above, with the parameters given there for Euler and midpoint (no need to submit this) for a time step h = 0.1. - [x] According to the class definition in “MassSpringSystemSimulator.h” file, implement your “MassSpringSystemSimulator” class. Your class should have the two integration methods. - [x] In Visual Studio, set the “simulationsRunner” as the startup project. In addition, in main.cpp, replace “#define TEMPLATE_DEMO” with “#define MASS_SPRING_SYSTEM” at line 23. Then you can run and test your MassSpringSystemSimulator class. - [x] Build and run the basic test case, and print the solution (i.e., new position and velocity for both points) after one time step to the command line. (Hint: don’t be surprised if the differences between both methods are quite small – the important thing is to note how they’re different.)
Mingqi was assigned by kookroach 2023-10-30 16:39:02 +01:00
kookroach added this to the Game Physics project 2023-10-30 22:25:14 +01:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kookroach/game-physics#2
No description provided.