Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Refactor/calc doas with irf (#839)
* ♻️ Start of refactor calculate_damped_oscillation_matrix_gaussian_irf 🔧 Add debug plotting code to evaluate doas matrix calculation Some temporary debug plotting code to evaluate the changes in implementation during the evolution of the code during the refactor. * ♻️👌Fix for reversed oscillations (negative rates) To accommodate time-reversed oscillations the sqwidth constant is manipulated so that negative rates have a -1 sign causing a flip of the erf when this constant is used in the calculation of 'b'. Co-authored-by: Ivo <ism200@users.noreply.github.com> Co-authored-by: Sebastian Weigand <s.weigand.phy@gmail.com> * ♻️ Refactored calc doas matrix function to be more numerically stable Results of refactoring so far; 2 iterations, same stating values: 1. 🤔 Start - Starting cost: 6.3345e+04 - End cost: 6.3345e+04 - rmse: 9.75e-01 - variable `a` going up to 1e106 - variable `osc` going up to 1e106 2. 🩹 Fix for reversed osciallations - Starting cost: 3.0537e+04 - End cost: 3.0006e+04 - rmse: 7.02e-01 - variable `osc` bounded to [-2, 2] - variable `a` going up to 1e106 3. 👌 More numerically stable and efficient calculation of a and b - Starting cost: 3.0537e+04 - End cost: 3.0006e+04 - rmse: 7.02e-01 - variable `osc` bounded to [-2, 2] - variable `a` bounded to [-1.5, 1.1] * 🧹 Clean up debug plotting code * 📚 Add comment explaining origin of 0.03 scaling factor Used in frequency conversion * 📚 Add docs for calculate_damped_oscillation_matrix_gaussian_irf * 👌 Fix typo parameter, parameter, parameter * 📚 Improved code comments * ♻️ Refactored by Sourcery This code wasn't touched by this PR, but will clean up the code for the future. Co-authored-by: Ivo <ism200@users.noreply.github.com> Co-authored-by: Sebastian Weigand <s.weigand.phy@gmail.com> Co-authored-by: Sourcery AI <>
- Loading branch information