```Date: Mar 11, 2014 1:07 PM
Author: Shane Richardson
Subject: mass spring system

I am trying to write a program that takes inputs n, M, d, k and outputs the loaded position of the platform , x and the number of the springs that are engaged or if it's bottomed out.k = spring constantn =  spring pairsM =  mass of loaded platformd = difference in height of springsThe arrangement shows 11 springs:  One that touches the platform and 5 pairs of springs with d meters difference in heights.  When the mass, M, is supported by the platform, the platform will move through a distance x until the weight is balanced by the force of some number of springs.  The number of springs that it takes to balance the weight depends on the mass being supported.For a single spring, when g = 9.81 m/s^2:  Mg = kx  if x<=dIf the mass being supported requires the center spring and the first spring pair out from the center to support it, then the balance of forces gives the following:Mg = kx + 2k(x - d)   if d < x <= 2dI need to generalize the solution to n pairs of springs, with spring pair n = 0  to mean the single center spring and then count pairs of springs out from the center.  Find a formula when spring pair n is supporting the platform for the loaded position x, of the platform.  That is, with      nd <  x <= (n +1)d.Any help or advice would be greatly appreciated.
```