/// <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); }
/// <summary> /// Copy constructor /// </summary> /// <param name="s">The StarAgeLine object being copied</param> public StarAgeLine(StarAgeLine s) { initList(); foreach (double d in s.points) { this.points.Add(d); } }
/// <summary> /// Update the display based on a mass update /// </summary> /// <param name="sender">The object sending you here</param> /// <param name="e">Event arguments</param> private void numCurrMass_Leave(object sender, EventArgs e) { //first, initial luminosity txtInitLumin.Text = Star.getMinLumin((double)numCurrMass.Value).ToString(); //now we need to get an updated timeline this.currAgeChart.addMainLimit(Star.findMainLimit((double)numCurrMass.Value)); this.currAgeChart.addSubLimit(Star.findSubLimit((double)numCurrMass.Value)); this.currAgeChart.addGiantLimit(Star.findGiantLimit((double)numCurrMass.Value)); //now we need to get what stage we are and push the details to the field. lblEndMain.Text = "End of Main Sequence: " + this.currAgeChart.getMainLimit() + " GYr"; lblEndSubGiant.Text = "End of the Sub Giant Sequence: " + this.currAgeChart.getSubLimit() + " GYr"; lblEndGiantPhase.Text = "End of the Giant Phase: " + this.currAgeChart.getGiantLimit() + " GYr"; this.currAgeStatus = this.currAgeChart.findCurrentAgeGroup((double)numAge.Value); lblCurrentStage.Text = "Current Status: " + StarAgeLine.descBranch(this.currAgeStatus); //now we can get the current luminosity, figure out what the intial mass is. //and fill in the effective temperature if it's no longer in range. numInitMass.Value = numCurrMass.Value; txtCurrLumin.Text = Math.Round(Star.getCurrLumin(this.currAgeChart, (double)numAge.Value, (double)numCurrMass.Value), 3).ToString(); double temp; temp = Star.getCurrentTemp(this.currAgeChart, Convert.ToDouble(txtCurrLumin.Text), (double)numAge.Value, (double)numCurrMass.Value, this.myDice); txtEffTemp.Text = Convert.ToString(temp); //set good ranges createAcceptRanges(Star.getCurrLumin(this.currAgeChart, (double)numAge.Value, (double)numCurrMass.Value), temp); //display information for users benefits (formation zones, colors) this.color = Star.setColor(this.myDice, temp); lblStellarColor.Text = "Stellar Color: " + color; lblStellarRadius.Text = "Stellar Radius: " + Star.getRadius((double)numCurrMass.Value, temp, Star.getCurrLumin(this.currAgeChart, (double)numAge.Value, (double)numCurrMass.Value), this.currAgeChart.findCurrentAgeGroup((double)numAge.Value)) + " AU"; lblInnerFormation.Text = "Inner Formation Range: " + Star.innerRadius(Convert.ToDouble(txtInitLumin.Text), (double)numInitMass.Value) + " AU"; lblOuterFormation.Text = "Outer Formation Range: " + Star.outerRadius((double)numInitMass.Value) + " AU"; lblSnowLine.Text = "Snow Line: " + Star.snowLine(Convert.ToDouble(txtInitLumin.Text)) + " AU"; if ((double)numCurrMass.Value > .525) { chkFlareStar.Checked = false; chkFlareStar.Enabled = false; } }
/// <summary> /// Display the star's details /// </summary> private void displayFromStar() { txtName.Text = this.ourSystem.sysStars[this.starID].name; numInitMass.Value = (decimal)this.ourSystem.sysStars[this.starID].initMass; numCurrMass.Value = (decimal)this.ourSystem.sysStars[this.starID].currMass; txtInitLumin.Text = this.ourSystem.sysStars[this.starID].initLumin.ToString(); txtCurrLumin.Text = this.ourSystem.sysStars[this.starID].currLumin.ToString(); txtEffTemp.Text = this.ourSystem.sysStars[this.starID].effTemp.ToString(); createAcceptRanges(this.ourSystem.sysStars[this.starID].currLumin, this.ourSystem.sysStars[this.starID].effTemp); numAge.Value = (decimal)this.ourSystem.sysStars[this.starID].starAge; if ((double)numCurrMass.Value > .525) { chkFlareStar.Enabled = false; } if (this.ourSystem.sysStars[this.starID].isFlareStar) { chkFlareStar.Checked = true; } txtOrbitalParent.Text = this.ourSystem.sysStars[this.starID].parentName; txtRadius.Text = this.ourSystem.sysStars[this.starID].orbitalRadius.ToString(); numEccent.Value = (decimal)this.ourSystem.sysStars[this.starID].orbitalEccent; lblStellarColor.Text = "Stellar Color: " + this.ourSystem.sysStars[this.starID].starColor; this.currAgeStatus = this.ourSystem.sysStars[this.starID].evoLine.findCurrentAgeGroup((double)numAge.Value); lblCurrentStage.Text = "Current Status: " + StarAgeLine.descBranch(this.currAgeStatus); //MessageBox.Show(Star.getRadius(this.ourSystem.sysStars[this.starID].currMass, this.ourSystem.sysStars[this.starID].effTemp, this.ourSystem.sysStars[this.starID].currLumin, this.currAgeStatus).ToString()); lblStellarRadius.Text = "Star Radius: " + this.ourSystem.sysStars[this.starID].radius + " AU"; lblInnerFormation.Text = "Inner Radius of Formation Zone: " + Star.innerRadius(this.ourSystem.sysStars[this.starID].initLumin, this.ourSystem.sysStars[this.starID].initMass) + " AU"; lblOuterFormation.Text = "Outer Radius of Formation Zone: " + Star.outerRadius(this.ourSystem.sysStars[this.starID].initMass) + " AU"; lblSnowLine.Text = "Snow Line: " + Star.snowLine(this.ourSystem.sysStars[this.starID].initLumin) + " AU"; lblPeriapsis.Text = "Periapsis: " + Star.getPeriapsis((double)numEccent.Value, Convert.ToDouble(txtRadius.Text)) + " AU"; lblApapsis.Text = "Apapsis: " + Star.getApapsis((double)numEccent.Value, Convert.ToDouble(txtRadius.Text)) + " AU"; lblEndMain.Text = "End of Main Sequence: " + this.ourSystem.sysStars[this.starID].evoLine.getMainLimit() + " GYr"; lblEndSubGiant.Text = "End of the Sub Giant Sequence: " + this.ourSystem.sysStars[this.starID].evoLine.getSubLimit() + " GYr"; lblEndGiantPhase.Text = "End of the Giant Phase: " + this.ourSystem.sysStars[this.starID].evoLine.getGiantLimit() + " GYr"; this.currAgeStatus = this.ourSystem.sysStars[this.starID].evoLine.findCurrentAgeGroup((double)numAge.Value); lblCurrentStage.Text = "Current Status: " + StarAgeLine.descBranch(this.currAgeStatus); }
/// <summary> /// Update the display when you change the age of the star /// </summary> /// <param name="sender">The object sending you here</param> /// <param name="e">Event arguments</param> private void numAge_Leave(object sender, EventArgs e) { this.currAgeStatus = this.currAgeChart.findCurrentAgeGroup((double)numAge.Value); lblCurrentStage.Text = "Current Status: " + StarAgeLine.descBranch(this.currAgeStatus); txtCurrLumin.Text = Math.Round(Star.getCurrLumin(this.currAgeChart, (double)numAge.Value, (double)numCurrMass.Value), 3).ToString(); double temp; temp = Star.getCurrentTemp(this.currAgeChart, Convert.ToDouble(txtCurrLumin.Text), (double)numAge.Value, (double)numCurrMass.Value, this.myDice); txtEffTemp.Text = Convert.ToString(temp); createAcceptRanges(Star.getCurrLumin(this.currAgeChart, (double)numAge.Value, (double)numCurrMass.Value), temp); lblStellarColor.Text = "Stellar Color: " + Star.setColor(this.myDice, temp); lblStellarRadius.Text = Star.getRadius((double)numCurrMass.Value, temp, Star.getCurrLumin(this.currAgeChart, (double)numAge.Value, (double)numCurrMass.Value), this.currAgeChart.findCurrentAgeGroup((double)numAge.Value)) + " AU"; }
/// <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); }
/// <summary> /// This returns the current branch description for this star /// </summary> /// <returns>A string containing the branch description</returns> public string returnCurrentBranchDesc() { return(StarAgeLine.descBranch(this.evoLine.findCurrentAgeGroup(this.starAge))); }