Implement Demo 1 from exercise sheet #2
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.)