document: the cataclysmic variable hu aqr currently consists of a 0.80 white dwarf that accretes from a 0.18 main - sequence companion star . 
   the transfer of mass in the tight @xmath12 orbit is mediate by the emission of gravitational waves and the strong magnetic field of the accreting star . since its discovery 
   , irregularities of the observed - calculated variations have led to a range of explanations , including the presence of circum - binary planets . 
   detailed timing analysis has eventually led to the conclusion that the cv is orbited by two planets @xcite , a 5.7 planet in a @xmath13 orbit with an eccentricity of @xmath14 and a somewhat more massive ( 7.6 ) planet in a wider @xmath15 and eccentric @xmath16 orbit @xcite . 
   although , the two - planet configuration turned out to be dynamically unstable on a 100010,000  year time scale ( * ? ? ? * see also  [ sect : stability ] ) , a small fraction of the numerical simulations exhibit long term dynamical stability ( for model b2 in * ? ? ? 
   * see tab.[tab : huaqr ] for the parameters ) . 
   it is peculiar to find a planet orbiting a binary , in particular around a cv . while planets may be a natural consequence of the formation of binaries @xcite , planetary systems orbiting cvs 
   could also be quite common . 
   in particular because of recently timing residual in nn  serpentis , dp leonis and qs virgo @xcite were also interpreted is being caused by circum - cv planets . 
   although the verdict on the planets around hu aqr ( and the other cvs ) remains debated ( tom marsh private communication , and * ? ? ? 
   * ) , we here demonstrate how a planet in orbit around a cv , and in particular two planets , can constrain the cv evolution and be used to reconstruct the history of the inner binary . 
   we will use the planets to perform a precision reconstruction of the binary history , and for the remaining paper we assume the planets to be real . 
   because of their catastrophic evolutionary history , cvs seem to be the last place to find planets . 
   the original binary lost probably more than half its mass in the common - envelope phase , which causes the reduction of the binary separation by more than an order of magnitude . 
   it is hard to imagine how a planet ( let alone two ) can survive such turbulent past , but it could be a rather natural consequence of the evolution of cvs , and its survival offers unique diagnostics to constrain the origin and the evolution of the system . 
   after the birth of the binary , the primary star evolved until it overflowed it roche lobe , which initiated a common - envelope phase . 
   the hydrogen envelope of the primary was ejected quite suddenly in this episode @xcite , and the white dwarf still bears the imprint of its progenitor : the mass and composition of the white dwarf limits the mass and evolutionary phase of its progenitor star at the moment of roche - lobe overflow ( rlof ) . for an isolated binary the degeneracy between the donor mass at the moment of rlof ( @xmath17 ) , its radius @xmath18 and the mass of its core @xmath19 can not be broken . 
   the presence of the inner planet in orbit around hu aqr @xcite allows us to break this degeneracy and derive the rate of mass loss in the common - envelope phase . 
   the outer planet allows us to validate this calculation and in addition to determine the conditions under which the cv was born . 
   the requirement that the initial binary must have been dynamically stable further constrains the masses of the two stars and their orbital separation .      during the cv phase little mass 
   is lost from the binary system @xmath20constant ( but see * ? ? ? 
   * ) , and the current total binary mass ( @xmath21 ) was not affected by the past ( and current ) cv evolution @xcite . 
   the observed white dwarf mass then provides an upper limit to the mass of the core of the primary star at the moment of roche - lobe contact , and therefore also provides a minimum to the companion mass via @xmath22 .    with the mass of the companion not being affected by the common envelope phase , we constrain the orbital parameters at the moment of rlof by calculating stellar evolution tracks to measure the core mass @xmath19 and the corresponding radius @xmath23 for stars with zero - age main - sequence mass @xmath24 . in fig.[fig : amcoreformzams3msun ] we present the evolution of the radius of a 3 star as a function of @xmath19 , which is a measure of time 
   we adopted the henyey stellar evolution code mesa @xcite to calculate evolutionary track of stars from @xmath25 to 8 using amuse @xcite to run mesa and determine the mass of the stellar core . 
   the latter is measured by searching for the mass - shell in the stellar evolution code for which the relative hydrogen fraction @xmath26 .    at the moment of rlof 
   the core mass is @xmath19 and the stellar radius @xmath27 . via the relation for the roche radius  @xcite 
   , we can now calculate the orbital separation at the moment of rlof @xmath28 as a function of @xmath17 . 
   this separation is slightly larger than the initial ( zero - age ) binary separation @xmath29 due to the mass lost by the primary star since its birth @xmath30 . 
   the long ( main - sequence ) time scale in which this mass is lost guarantees an adiabatic response to the orbital separation , i.e. @xmath31  constant .    for each @xmath24 
   we now have a range of possible solutions for @xmath28 as a function of @xmath19 and @xmath32 . 
   this reflects the assumption that the total mass ( @xmath33 ) in the observed binary with mass @xmath34 is conserved throughout the evolution of the cv . in fig.[fig : 
   amcoreformzams3msun ] we present the corresponding stellar radius @xmath18 and @xmath35 as a function of @xmath19 for @xmath36 . this curve for @xmath28 is interrupted when rlof would already have been initiated earlier for that particular orbital separation . 
   we calculate this curve by first measuring the size of the donor for core mass @xmath19 , and assuming that the primary fills its roche - lobe we calculate the orbital separation at which this happens .      during the common envelope phase the primary s mantle 
   is blown away beyond the orbit of the planets . 
   the latter responds to this by migrating from the orbits in which they were born ( semi - major axis @xmath37 and eccentricity @xmath38 , the subscript @xmath39 indicates the inner planet , we adopt a @xmath40 to indicate the outer planet ) to the currently observed orbits . using first order analysis 
   we recognize two regimes of mass loss : fast and slow . in the latter case 
   the orbit expands adiabatically without affecting the eccentricity : the minimum possible expansion of the planet s orbit is achieved when the common envelope is lost adiabatically . 
   fast mass loss leads to an increase in the eccentricity as well and may even cause the planet to escape @xcite . 
   a planet born at the shortest possible orbital separation to be dynamically stable will have @xmath41 @xcite , which is slightly smaller than the distance at which circum binary planets tend to form @xcite . 
   in fig.[fig : amcoreformzams3msun ] we present a minimum to the semi - major axis for a planet that was born at @xmath42 and migrated by the adiabatic loss of the hydrogen envelope from the primary star in the common - envelope phase . 
   the planet can have migrated to a wider orbit , but not to an orbit smaller than the solid black curve ( indicated with @xmath43 ) in fig.[fig : amcoreformzams3msun ] . for the 3 star , presented in fig.[fig : amcoreformzams3msun ] 
   , rlof can successfully result in the migration of the planet to the observed separation in hu aqr for @xmath44 , which occurs for @xmath45 . a core mass @xmath46 would , for a 3 primary star , result in an orbital separation that exceeds that of the inner planet in hu aqr ; in this case the core mass of the primary star must have been smaller than 0.521 . 
   another constraint on the initial binary orbit is provided by the requirement that the mass transfer in the post common - envelope binary should be stable when the companion starts to overfill its roche lobe . to guarantee stable mass transfer 
   we require that @xmath47 . 
   the thick part of the red curve in fig.[fig : amcoreformzams3msun ] indicates the valid range for the initial orbital separation and core - mass for which the observed planet can be explained ; the thin parts indicate where these criteria fail . 
   we repeat the calculation presented in fig.[fig : amcoreformzams3msun ] for a range of masses from @xmath48 to 8 with steps of 0.02 , the results are presented as the shaded region in fig.[fig : am0_distribution_hu ] . 
   the response of the orbit of the planet to the mass loss depends on the total amount of mass lost in the common envelope and the rate at which it is lost . 
   numerical common - envelope studies indicate that for an in - spiraling binary @xmath49 @xcite . at this rate 
   the entire envelope @xmath505.8 is expelled well within one orbital period of the inner planet , which leads to an impulsive response and the possible loss ( for @xmath51 ) of the planet . 
   the fact that the hu aqr is orbited by a planet indicates that at the distance of the planet @xmath52 . 
   the eccentricity of the inner planet in hu aqr ( see tab.[tab : huaqr ] ) can be used to further constrain the rate at which the common - envelope was lost from the planetary orbit . 
   the higher eccentricity of the outer planet indicates a more impulsive response , which is a natural consequence of its wider orbits with the same @xmath53 . 
   this regime between adiabatic and impulsive mass loss is hard to study analytically @xcite .    [ cols="<,<,<,<,<,<,<,<",options="header " , ]      we calculate the effect of the mass loss on the orbital parameters by numerically integrating the planet orbit . 
   the calculations are started by selecting initial conditions for the zero - age binary hu aqr @xmath24 , @xmath29 and consequently @xmath19 from the available parameter space ( shaded area ) in fig.[fig : am0_distribution_hu ] , and integrate the equations of motion of the inner planet with time . 
   planets ware assumed to be born in a circular orbit ( @xmath54 ) in the binary plane with semi - major axis @xmath37 . 
   the equations of motions are integrated using the high - order symplectic integrator huayno @xcite via the amuse framework . during the integration 
   we adopt a constant mass - loss rate @xmath53 applied at every 1/100th of an orbit , and we continued the calculation until the entire envelope is lost ( see  [ sect : ce ] and fig.[fig : am0_distribution_hu ] ) , at which time we measure the final semi - major axis and eccentricity of the planetary orbit . during the integration 
   we allow the energy error to increase up to at most @xmath55 .    by repeating this calculation while varying @xmath37 and @xmath56 we iterate ( by bisection ) until the result is within 1% of the observed @xmath57 and @xmath58 of the inner planet observed in hu aqr . 
   the converged results of these simulations are presented in fig.[fig : am0_distribution_hu ] ( circles ) , and these represent the range of consistent values for the inner planet s orbital separation @xmath59752 as a function of @xmath608 and consistently reproduce the observed inner planet when adopting @xmath610.267/yr . 
   the highest value for @xmath53 is reached for @xmath62 at an initial orbital separation of @xmath63 . 
   the orbital solution for the inner planet is insensitive to the semi - major axis of the zero - age binary @xmath29 ( for a fixed @xmath24 ) , and each of these solutions were tested for dynamical stability , which turned out to be the case irrespective of the initial binary semi - major axis ( as discussed in  [ sect : stability ] ) . 
   we now adopt the in  [ sect : innerplanet ] measured value of @xmath53 to integrate the orbit of the outer planet . 
   the effect of the mass outflow on the planet is proportional to the square of the density in the wind at the location of the planet . 
   we correct for this effect by reducing the mass loss rate in the common envelope that affects the outer planet by a factor @xmath64 . 
   we use the same integrator and assumptions about the initial orbits as in  [ sect : innerplanet ] , but we adopt the value of @xmath53 from our reconstruction of the inner planet ( see  [ sect : innerplanet ] ) . to reconstruct the initial orbital separation of the outer planet @xmath65 
   , we vary this value ( by bisection ) until the final semi - major axis is within 1% of the observed orbit ( see tab.[tab : huaqr ] ) . 
   the results are presented in fig.[fig : am0_distribution_hu ] ( triangles ) . 
   the post common - envelope eccentricity of the outer planet then turn out to be @xmath66 . 
   after having reconstructed the initial conditions of the binary system with its two planets we test its dynamical stability by integrating the entire system numerically for 1myr using the huayno integrator @xcite . to test the stability we check the semi - major axis and eccentricity of both planets every 100years . 
   if any of these parameters change by a factor of two compared to the initial values or if the orbits cross we declare the system unstable , otherwise they are considered stable . 
   the calculations are repeated with the 4th order hermite predictor - corrector integrator ph4 @xcite within amuse to verify that the results are robust , which turned out to be the case . 
   we then repeated this calculation ten times with random inital orbital phases and again with a 1% gaussian variation in the initial planetary semi - major axes . in fig.[fig : am0_distribution_hu ] we present the resulting stable systems by coloring them red ( circled ) and blue ( triangles ) , the unstable systems are represented by open symbols .    from the wide range of possible systems that can produce hu aqr only a small range around @xmath67 turns out to be dynamically stable . 
   the eccentricity of the outer orbit of the stable systems ( which ware stable for initial conditions within 1% ) @xmath68 , which is somewhat smaller than the observed value for hu aqr ( * ? ? ? * @xmath69 ) . 
   these values are obtained with @xmath70 . 
   the small uncertainty in the derived value of @xmath53 is a direct consequence of its sensitivity to @xmath38 and the small error on @xmath24 from the requirement that the initial system is dynamically stable . 
   we have adopted the suggestive results from the timing analysis of hu aqr , that the cv is orbited by two planets , to reconstruct the evolution of this complex system . a word of caution is well placed in that these observations are not confirmed , and currently under debate ( tom marsh private communication , and comments by the referee ) 
   . however , the predictive power that such an observation would entail is interesting . 
   the possibility to reconstruct the initial conditions of a cv by measuring the orbital parameters of two circum binary planets is a general result that can be applied to other binaries . for cvs in particular 
   it enables us to constrain the value of fundamental parameters in the common - envelope evolution . 
   this in itself makes it interesting to perform this theoretical exercise , irrespective of the uncertainty in the observations . 
   on the other hand , the consistency between the observations and the theoretical analysis give some trust to the correctness of these observations . 
   the presence of one planet in an eccentric orbit around a cv allow us to calculate the rate at which the common - envelope was lost from the inner binary . 
   a single planet provides insufficient information to derive the initial mass of the primary star , but allows us to derive the initial binary separation and planetary orbital separation to within about factor of 5 , and the initial rate of mass loss from the common envelope to about a factor 2 . 
   a second planet can be used to further constrain these parameters to a few per cent accuracy and allows us to make a precision reconstruction of the evolution of the cv . 
   we have used the observed two planets in orbit around the cv hu aqr to reconstruct its evolution , to derived its initial conditions ( primary mass , secondary mass , orbital separation , and the orbital separations of both planets ) and to measure the rate of mass lost in the common - envelope parameters @xmath53 . by comparing the binary parameters at birth with those after the common - envelope phase we subsequently calculate the two parameters @xmath71 and @xmath72 .    the measured rate of mass loss for hu aqr of @xmath73 from the inner planetary orbit , which from the binary system itself would entail a mass - loss rate of @xmath74 , when we adopt the initial binary to have a semi - major axis of @xmath75 , which is bracketed by our derived range of @xmath76160 . 
   this is consistent with a mass - loss rate of @xmath77 from numerical common - envelope studies @xcite .    by adopting that the binary survives its common envelope at a separation between @xmath78 ( at which separation the secondary star will just fill it s roche - lobe to the white dwarf ) and @xmath79 ( for gravitational wave radiation to drive the binary into roche - lobe overflow within 10gyr ) , 
   we derive the value of @xmath802.0 ( for @xmath75 we arrive at @xmath81 ) . 
   this value is a bit small compared to numerous earlier studies , which tend to suggest @xmath82 . 
   the alternative @xmath72-formalism for common - envelope ejection gives a value of @xmath831.80 ( for @xmath75 we arrive at @xmath84 ) , which is consistent with the determination of @xmath72 in 30 other cvs @xcite . 
   the inner planet in hu aqr formed at @xmath85@xmath86 , with a best value of @xmath87 , which is consistent with the planets found to orbit other binaries , like kepler 16 @xcite and for kepler 34 and 35 @xcite , although these systems have lower primary mass and secondary mass stars . 
   it seems unlikely that more planets were formed inside the orbit of the inner most planet , even though currently there is sufficient parameter space for many more stable planets ; in the zero - age binary there has not been much room for forming additional planets further in . 
   it is however possible that additional planets formed further out and those , we predict , will have even higher eccentricity than those already found . 
   * acknowledgements * it is a pleasure to thank edward p.j . 
   van den heuvel , tom marsh , inti pelupessy , nathan de vries , arjen van elteren and the anonymous referee for comments on the manuscript and discussions . 
   this work was supported by the netherlands research council nwo ( grants # 612.071.305 [ lgm ] , # 639.073.803 [ vici ] and # 614.061.608 [ amuse ] ) and by the netherlands research school for astronomy ( nova ) .
summary: cataclysmic variables ( cvs ) are binaries in which a compact white dwarf accretes material from a low - mass companion star . 
   the discovery of two planets in orbit around the cv hu aquarii opens unusual opportunities for understanding the formation and evolution of this system . 
   in particular the orbital parameters of the planets constrains the past and enables us to reconstruct the evolution of the system through the common - envelope phase . during this dramatic event the entire hydrogen envelope of the primary star 
   is ejected , passing the two planets on the way . 
   the observed eccentricities and orbital separations of the planets in hu  aqr enable us to limit the common - envelope parameter @xmath0 or @xmath1 and measure the rate at which the common envelope is ejected , which turns out to be copious . 
   the mass in the common envelope is ejected from the binary system at a rate of @xmath2 . 
   the reconstruction of the initial conditions for hu  aqr indicates that the primary star had a mass of @xmath3 and a @xmath4 companion in a @xmath5160 ( best value @xmath6 ) binary . 
   the two planets were born with an orbital separation of @xmath7 and @xmath8 respectively . after the common envelope , the primary star turns into a @xmath9 helium white dwarf , which subsequently accreted @xmath10 from its roche - lobe filling companion star , grinding it down to its current observed mass of @xmath11 . 
   methods : numerical planets and satellites : dynamical evolution and stability planet  star interactions planets and satellites : 
   formation stars : individual : hu aquarius stars : binaries : evolution