Is there any worked examples in calculating the mechanical spring life (energy storing device)
Eg: springs in computer keyboard's
springs in writing pen.
There are a lot of calculators out there, so implementing one in Mathcad is certainly possible. To estimate the fatigue life of a particular spring you would need to know details of the spring (material, dimensions, number of coils), and details of the installation (installed length, compressed length, etc.
Generally keyboard designers target a specific life; 50 million key presses seems to be a common goal.