//Wagon strikes bumper post //refer fig. 16.19 W=500 //Component of weight down the plane Wd Wd=W/100 //kN //Track resistance Rt Rt=2.5 //kN //u=0 s=30 //m //Let the velocity of wagon while striking be v m/sec //Applying work energy equation v=1.716 //m/sec //Let spring compresion be x k=15000 //kN/m //Applying work energy equation and solving quadratic equation x=100.2 //mm printf("\nThe spring will be compressed by %.1f mm",x)