Modelling and control of the agitation-sedation cycle