I want to describe the dynamics of atmospheric entry by means of orbit elements. However, because of the drag of atmosphere, the orbit of spacecraft changes from hyperbola to ellipse. Therefore, the semimajor axis diverges and the dynamic system can not be propagated. I want to know if anybody encountered a similar problem? What can I do to handle this problem?