{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Tutorial A12" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__1__ How does logging behave when you rerun the script without restarting the kernel? What happens if you delete the log-file before you rerun?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__2__ Play around with the `datefmt` keyword when configuring the logger to omit displaying year and months." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__3__ Below you find a script that propagates a particle in a harmonic potential numerically (using the euler integrator). You do not need to know about details of the scientific background yet. Just note so much: The script monitors the total energy of the particle at every propagation step. Whenever the change in energy is larger than 0.3, the velocity should be rescaled (multiplied) by a factor of 0.9. This part is not yet included in the script below. If this happens a message should be written to a log file, stating the old and the new speed. Your task is it, to setup a logger and insert a logging statement at the right position in the code." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "