My Project
|
Description: In short this code do all parts of the simulation regarding the BK-Pad model. It uses a self implemented 2nd order Runge-Kutta to solve the differential equations. The input from user is stored in a YAML file *parameters.yaml** in "doc/yaml". All functions are attempted described below, if this is unsatisfactory, feel free to ask me. (Assuming you know who I am if you are reading this.)
Simulation::setupModelVectorsMatrices() Simulation::setupModelVectorsMatrices()
This is a bigger setup method. In rough lines it sets up
This is method sets up constants derived from input parameters in parameters.yaml.
Returns value of friction law used based on input value.
Calculate the value of the derivative block matrix based on the equation given in the class documentation. The calculation is done step wise in order to be able to disable parts of the equation and make it more clear.
Calculate the value of the derivative pad vector based on the equation in the class documentation. The calculation is done step wise in order to be able to disable parts of the equation and make it more clear.
Control the steps in the midpoint method. It is a numeric method that works similar to the Euler's method. It used the derivative to calculate the next value of the simulation. Different from the Euler's method, it first calculates halfway to the next time step which promises higher precision. It also logs the position and velocity of the pad and blocks that are logged to be saved at some point.
Print block matrix and pad vector which has to be given as input.
Runs the midpoint method, uses a for-loop and controls saving of the file.
Saves the logged block and pad position and velocity to files in the "results" folder.