https://ajitdevkota.github.io//posts/PEM/
Step-by-step piece-wise exact method for linear SDOF systems using Python - Ajit Devkota