A mathematical model of the dynamics of the inner ear