Modeling the dynamics of recovery in robot-assisted rehabilitation