Transient response in optical bistability