예제 #1
0
        /// <summary>
        /// This updates the star to what the current should be given no alterations.
        /// </summary>
        /// <param name="ageL">the age line of the star</param>
        /// <param name="age">The age of the star</param>
        /// <param name="mass">The current mass of the star</param>
        /// <returns>The current lumonsity of the star</returns>
        public static double getCurrLumin(StarAgeLine ageL, double age, double mass)
        {
            int ageGroup = ageL.findCurrentAgeGroup(age);

            if (ageGroup == StarAgeLine.RET_MAINBRANCH && mass < .45) //if it's under .45 solar masses, it'll always be the minimum luminosity.
            {
                return(Star.getMinLumin(mass));
            }
            if (ageGroup == StarAgeLine.RET_MAINBRANCH && mass >= .45)  // now it's going to be somewhere between the minimum and maximum, given it's age.
            {
                return(Star.getMinLumin(mass) + ((age / ageL.getMainLimit()) * (Star.getMaxLumin(mass) - Star.getMinLumin(mass))));
            }
            if (ageGroup == StarAgeLine.RET_SUBBRANCH) //simply maxmium luminsoity
            {
                return(Star.getMaxLumin(mass));
            }
            if (ageGroup == StarAgeLine.RET_GIANTBRANCH)
            {
                return(Star.getMaxLumin(mass) * 10000); //IMPLEMENTED HOUSE RULE. Yeah. Uh.. Yeah.
            }
            if (ageGroup == StarAgeLine.RET_COLLASPEDSTAR)
            {
                return(1611047115.0 * mass * Math.Pow((ageL.getAgeFromCollapse(age) * 100000000), (-7.0 / 5.0))); //corrected from report.
            }
            return(0);
        }
예제 #2
0
        /// <summary>
        /// This updates the star to the current surface temperature given no alterations
        /// </summary>
        /// <param name="ageL">the age line of the star</param>
        /// <param name="lumin">The current luminosity of the star (used for White Dwarfs)</param>
        /// <param name="age">The age of the star</param>
        /// <param name="mass">The current mass of the star</param>
        /// <param name="ourDice">Dice (due to randomization of the temperature)</param>
        /// <returns>The current temperature of the star</returns>
        public static double getCurrentTemp(StarAgeLine ageL, double lumin, double age, double mass, Dice ourDice)
        {
            if (ageL.findCurrentAgeGroup(age) == StarAgeLine.RET_MAINBRANCH)
            {
                return(Star.getInitTemp(mass));
            }
            if (ageL.findCurrentAgeGroup(age) == StarAgeLine.RET_SUBBRANCH)
            {
                return(Star.getInitTemp(mass) - ageL.calcWithInSubLimit(age) * (Star.getInitTemp(mass) - 4800));
            }
            if (ageL.findCurrentAgeGroup(age) == StarAgeLine.RET_GIANTBRANCH)
            {
                return(3000 + ourDice.rng(2, 6, -2) * 200);
            }
            if (ageL.findCurrentAgeGroup(age) == StarAgeLine.RET_COLLASPEDSTAR)
            {
                return(Math.Pow((lumin / Math.Pow(Star.getRadius(mass, 0, lumin, StarAgeLine.RET_COLLASPEDSTAR), 2)) * (5.38937375 * Math.Pow(10, 26)), 1 / 4));
            }

            return(0);
        }