The dynamic behavior of the H-rich envelope (0.101 solar mass) of an evolved star (1.1 solar mass) as the luminosity rises to 19000 solar luminosity during the second ascent of the red giant branch. For luminosities in the range 3100 L 19000 solar luminosity the H-rich envelope pulsates like a long-period variable (LPV) with periods of the order of a year. As L reaches 19000 solar luminosity, the entire H-rich envelope is ejected as a shell with speeds of a few 10 km/s. The ejection occurs on a timescale of a few LPV pulsation periods. This ejection is associated with the formation of a planetary nebula. The computations are based on an implicit hydrodynamic computer code. T- and RHO-dependent opacities and excitation and ionization energies are included. As the H-rich envelope is accelerated off the stellar core, the gap between envelope and core is approximated by a vacuum, filled with radiation. Across the vacuum, the luminosity is conserved and the anisotropy of the radiation is considered as well as the solid angle subtended by the remnant star at the inner surface of the H-rich envelope. Spherical symmetry and the diffusion approximation are assumed.