A mathematical model of the sleep/wake cycle