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.)

Functions

setupModelVectorsMatrices

Simulation::setupModelVectorsMatrices() Simulation::setupModelVectorsMatrices()

This is a bigger setup method. In rough lines it sets up

setupConstants

This is method sets up constants derived from input parameters in parameters.yaml.

phi

Returns value of friction law used based on input value.

function_u

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.

function_x

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.

midpointMethod

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.

printMidPointMethod

Print block matrix and pad vector which has to be given as input.

runMidpointMethod

Runs the midpoint method, uses a for-loop and controls saving of the file.

saveToCsv

Saves the logged block and pad position and velocity to files in the "results" folder.