Nonlinear model of the firefly flash