Numerical study of energy loss by a nanomechanical oscillator coupled to a Cooper-pair box