Modelling mass spring system using equations