Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addon Development
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addon Development Developers post news, updates, & discussions here about your projects in development.

Reply
 
Thread Tools
Old 11-05-2009, 02:13 PM   #46
Linguofreak
Orbinaut
Default

Quote:
Originally Posted by jedidia View Post
 [/COLOR]Ok, I looked at the IMF. I understand that the function will return the probability of a star with a Mass between a minimum and a maximum being formed, so it's exactly what I need.

Unfortunately, I suck at math, and I couldn't decipher the whole thing, because I can't read the mathematical syntax. so I see the function N(M)dM, but I don't see for example a "=" in there...

let's say I have a mass between 10 and 20 SM, could someone give an example how I have to enter this into my computer that I get the probability on the left side of the "="?
Basically, the easiest way that occurs to me is to assume that stars in your lowest mass band (say 0.08 to .1 solar masses) form with a density of 1. Then use the exponent to determine the number of stars that form in the next highest mass band (say .1 to .12 solar masses), and so on until you reach your highest mass band. Then normalize the densities so that the total of the densities for all mass bands is 1. This will give you your probabilities. Keep in mind that the IMF doesn't take into account stellar evolution (remnants are typically less massive than the original star, and every star in a mass band over a certain age will be a remnant), nor does it take into account mixing between areas with different average ages, nor the possibility that different areas might possibly have different IMFs.
Linguofreak is offline   Reply With Quote
Old 11-05-2009, 04:34 PM   #47
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

Uh, I'm afraid I still don't get it... I thought I knew what proportional means, but obviously I don't...

let's say I take a star with a Mass of 0.1 and take the value for Alpha from Miller/Scale (found here: http://webast.ast.obs-mip.fr/hyperz/...al1/node7.html), then I get M^-alpha = 17.783, and for 125 SM I get 0.00000012. Now what on earth do these numbers mean exactly? That I get 0.00000012 Stars with a mass of 125 per 17.783 stars with a mass of 0.1?

Quote:
Keep in mind that the IMF doesn't take into account stellar evolution (remnants are typically less massive than the original star, and every star in a mass band over a certain age will be a remnant),
Don't worry, I only need the initial mass. The star will then be walked though an evolution process according to its age, and may still become a remnant like a neutron star or even a black hole, depending on its initial mass.

Last edited by jedidia; 11-05-2009 at 04:39 PM.
jedidia is offline   Reply With Quote
Old 11-05-2009, 08:50 PM   #48
Linguofreak
Orbinaut
Default

Quote:
Originally Posted by jedidia View Post
 Uh, I'm afraid I still don't get it... I thought I knew what proportional means, but obviously I don't...

let's say I take a star with a Mass of 0.1 and take the value for Alpha from Miller/Scale (found here: http://webast.ast.obs-mip.fr/hyperz/...al1/node7.html), then I get M^-alpha = 17.783, and for 125 SM I get 0.00000012. Now what on earth do these numbers mean exactly? That I get 0.00000012 Stars with a mass of 125 per 17.783 stars with a mass of 0.1?
Yes, though I think you may have to scale things each time the exponent changes to keep the function smooth. For example, 2 solar masses is the border point in the Miller/Scalo function where the x term (be careful, they use M^-(1+x) instead of the 1^-alpha mentioned in the Wikipedia. You have to add one to their x to get alpha) goes from 2.0 to 2.3. 2^-2 is 0.25, whereas 2^-2.3 is approximately 0.2. You'll have to adjust the c term (which is a multiplier constant) in their equation so that the two equations have the same value at M=2 solar masses.

As far as figuring out the probability of any given mass, I think there's a way of doing it with calculus that's a bit more accurate than what I'm going to outline, but that's above my pay grade. Those who understand calculus can explain it. I may also be overthinking myself, and there may be a simple way of doing it precisely without calculus.

The first thing you need to do is chop your 0.1 to 125 solar mass range up into smaller ranges. You'll probably want each one to be fairly small (say, for instance, a percent or tenth of a percent of a solar mass). You may want to divide the ranges up by the logarithm of the mass rather than the mass, since a percent of a solar mass is a lot more compared to 0.1 solar masses than compared to 125 solar masses.

You then take the middle number of each mass range and assume all stars in that mass range have exactly that mass. (In other words, you round each mass to the mass of the nearest mass range). For instance, if I've decided that I'll have mass ranges spaced every tenth of a solar mass (for example, you'll want to use smaller mass ranges in practice), then stars with masses of .57, .59, and .61 solar masses would all be rounded to .6 solar masses.

You then apply the function to the center of each mass range, add the results for all the mass ranges together, and normalize the result to one.

For example: If I have mass ranges centered at .5, .75, and 1.0, and my function has a=-2, then it will return 4, 1.77, and 1. Added together, these total up to 6.77. I then divide the result of the function for each mass range so that the total adds up to 1, ie, (4/6.77) + (1.77/6.77) + (1/6.77) ~= .59 + .26 + .15 ~= 1.

Once you've got the whole list adding up to one, you have you're probabilities for each mass range. In the above example, stars in the .5 solar mass range account for a fraction of 0.59, or 59 percent of all stars, stars in the .75 solar mass range account for 0.26, or 26 percent, and stars in the 1 solar mass range account for .15, or 15 percent. You'll of course want more, and finer divisions than in my example (otherwise you'll have too many stars at the upper end of each mass range and too few at the lower end) and may want to divide your ranges up as a function of log M rather than M (otherwise you'll have less precision in the lower ranges than the higher ones).
Linguofreak is offline   Reply With Quote
Old 11-06-2009, 07:29 AM   #49
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

Thanks a lot! I'll give this a shot this evening and see if I get a working solution.

Quote:
You'll have to adjust the c term (which is a multiplier constant) in their equation so that the two equations have the same value at M=2 solar masses.
It's a good thing you mention c, since I didn't even see it the last time I looked at the page. now I'm not sure about what it does (just multiplying the result, I guess, but to what purpose?)
jedidia is offline   Reply With Quote
Old 11-06-2009, 02:33 PM   #50
Linguofreak
Orbinaut
Default

Quote:
Originally Posted by jedidia View Post
 Thanks a lot! I'll give this a shot this evening and see if I get a working solution.



It's a good thing you mention c, since I didn't even see it the last time I looked at the page. now I'm not sure about what it does (just multiplying the result, I guess, but to what purpose?)
Your equation is divided up into sections, with each section having a constant exponent. Certain masses form the boundary between two sections, and are part of both sections. For the Miller/Scalo equation, an example is at 2 solar masses where x changes from 1 to 1.3 (and thus a changes from 2 to 2.3). If you don't use c to scale things, then the equation will give two values at each boundary mass, one for the section that the mass is the lower boundary for, and one for the section it's the upper boundary for. You need to adjust c for each section so that the function returns the same value at each boundary mass for both sections it's a part of.

Once you have c values at which everything matches up, you should be able to scale them up and down as long as you keep the ratios the same (for example, if your three sections have c values of 1, 2, and 4, you should be able to change that to .5, 1, and 2, and have the border masses still line up). You can use this to make the function return a certain value at a certain mass (say, 1, at 1 solar mass, or at your minimum or maximum mass).
Linguofreak is offline   Reply With Quote
Old 11-06-2009, 07:08 PM   #51
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

Thanks a lot. Unfortunately, a load of wood got in my way today, I'll have to figure it all out tomorrow.
jedidia is offline   Reply With Quote
Old 11-06-2009, 07:39 PM   #52
Linguofreak
Orbinaut
Default

Quote:
Originally Posted by jedidia View Post
 Thanks a lot. Unfortunately, a load of wood got in my way today, I'll have to figure it all out tomorrow.
No problem.
Linguofreak is offline   Reply With Quote
Old 11-08-2009, 01:15 PM   #53
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

Allright, I got a working solution!

thanks a lot Linguofreak, probably wouldn't have understood it all without your explanation, allthough my solution looks a bit different from the one you proposed.

First I searched for c-values, as you suggested, and then I summed up all results for cM^-alpha from 0.1 to 125 SM with 0.01 SM steps. That gave me a value to use for 100%.
The random generator then produces a random number between 0 and this value. The mass of a star is iterated in 0.01 steps until cM^-alpha > random probability. This left me with something like 10 million potentially empty iterations, so the random value is evaluated first and the star gets a starting mass somewhere up on the ladder (got it split at 1, 2, 10, 20, 35, 60 and 90 SM) to keep the iterations down to a sensible amount. The result should be pretty precise.
jedidia is offline   Reply With Quote
Old 11-08-2009, 01:44 PM   #54
Linguofreak
Orbinaut
Default

Quote:
Originally Posted by jedidia View Post
 Allright, I got a working solution!

thanks a lot Linguofreak, probably wouldn't have understood it all without your explanation, allthough my solution looks a bit different from the one you proposed.

First I searched for c-values, as you suggested, and then I summed up all results for cM^-alpha from 0.1 to 125 SM with 0.01 SM steps. That gave me a value to use for 100%.
Works either way.

Quote:
The random generator then produces a random number between 0 and this value. The mass of a star is iterated in 0.01 steps until cM^-alpha > random probability. This left me with something like 10 million potentially empty iterations, so the random value is evaluated first and the star gets a starting mass somewhere up on the ladder (got it split at 1, 2, 10, 20, 35, 60 and 90 SM) to keep the iterations down to a sensible amount. The result should be pretty precise.
Sounds good. I might add a few starting points below one solar mass, and use smaller iterations (say .001 solar masses) towards the smaller end and larger iterations (.1 or maybe even 1 solar masses) towards the larger end. For a minimal mass star of 0.08 solar masses, 0.01 solar masses is more than 10 percent of its mass, but for a maximal mass star of 125 solar masses, 0.01 solar masses is less than a percent of a percent of its mass.
Linguofreak is offline   Reply With Quote
Old 11-08-2009, 07:24 PM   #55
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

Quote:
I might add a few starting points below one solar mass, and use smaller iterations
good point, and only 5 minutes to implement

---------- Post added at 07:34 PM ---------- Previous post was at 03:03 PM ----------

programing means solving a problem to get several other problems, right?

Now that I have a decently realistic distribution of masses, I have to put a spectral class to the stars (only main sequence, the rest will be processed separately), which seems a bit hard to do. Calculating the luminosity is easy, and if I'd had a diameter I could use it to calculate the surface temperature, hence placing the stars into the apropriate spectral class. Does anyone know a not too complicated formula that allows a ballpark estimate of the diameter based on the mass? I can't find a function relating the two together...

Edit: Never mind, I just found a function. Had to search for "mass-radius relation" instead of "mass-diameter relation". Now all I need is to put luminosity and radius together... Haven't found a formula for that yet, but I hopefully will.

---------- Post added at 08:24 PM ---------- Previous post was at 07:34 PM ----------

Found and implemented

just a question to make sure: are Luminosity and absolute magnitude the same thing?

Last edited by jedidia; 11-08-2009 at 07:23 PM.
jedidia is offline   Reply With Quote
Old 11-08-2009, 10:30 PM   #56
Linguofreak
Orbinaut
Default

Quote:
Originally Posted by jedidia View Post
 good point, and only 5 minutes to implement

---------- Post added at 07:34 PM ---------- Previous post was at 03:03 PM ----------

programing means solving a problem to get several other problems, right?

Now that I have a decently realistic distribution of masses, I have to put a spectral class to the stars (only main sequence, the rest will be processed separately), which seems a bit hard to do. Calculating the luminosity is easy, and if I'd had a diameter I could use it to calculate the surface temperature, hence placing the stars into the apropriate spectral class. Does anyone know a not too complicated formula that allows a ballpark estimate of the diameter based on the mass? I can't find a function relating the two together...

Edit: Never mind, I just found a function. Had to search for "mass-radius relation" instead of "mass-diameter relation". Now all I need is to put luminosity and radius together... Haven't found a formula for that yet, but I hopefully will.

---------- Post added at 08:24 PM ---------- Previous post was at 07:34 PM ----------

Found and implemented

just a question to make sure: are Luminosity and absolute magnitude the same thing?
Yes and no. Luminosity is simply the raw power the star puts out in the electromagnetic spectrum. It is given in units of power, such as solar luminosities or watts (or horsepower ), and most often given in solar luminosities. Absolute magnitude *measures* the same thing (the raw electromagnetic output of the star), but it is a *dimensionless* number determined by a *logarithm* of the luminosity (and a logarithm to a really weird base, too). A *lower* number means *brighter,* and you can find stars with *negative* absolute magnitudes. You also need to distinguish between visible and bolometric magnitude/luminosity. Bolometric magnitude is the luminosity of the star on all wavelengths, while visible magnitude is the magnitude within the human visible spectrum. For very hot or very cool stars (where most of the radiation is in the ultraviolet or infrared), the bolometric and visible magnitudes can be quite different, and authors will often use the terms "magnitude" and "luminosity" without qualifying whether they're talking bolometric or visible.

You can check out the Wikipedia articles on these topics, but at the moment Wikipedia is giving me trouble, or I'd provide a link.
Linguofreak is offline   Reply With Quote
Old 11-09-2009, 07:28 AM   #57
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

ok, thanks. Funy thing is, in bosnian "bol" means "pain"... So, what I basically have to find out is wheather the star database I'm using expresses absolute magnitude in visible or "painometric" magnitude. shouldn't be hard.
jedidia is offline   Reply With Quote
Old 11-10-2009, 04:32 PM   #58
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

I started the probably long and tedious process of adapting StarGen to create solar systems for Orbiter Galaxy. It currently only works reliable for the creation of Systems around stars of 0.2 to 1.5 SM. I overcame the first few obstacles, but there's a long way ahead of me, I'm afraid.

Currently I'm working on the problem that it creates increasingly massive planets around increasingly massive stars, the top I saw was a rocky planet (not a gas giant) with over 3100 earthmasses and barely 2 times its radius. While this is clearly due to the accretion model used by stargen, It got me wondering: How large can solid bodies actually get?
jedidia is offline   Reply With Quote
Old 11-11-2009, 12:42 AM   #59
tgep
Tutorial Publisher
 
tgep's Avatar
Exclamation

Two little problems we've overlooked and that's the distance factor from Orbiters universal center ( Sol ) and Active-X lighting in Orbiter.

Orbiter 2006 lets you pilot a vessel quite a large distance from sol ( we're talking many many parsecs here folks ) but inevitably you hit an unseen barrier and get a CTD because the engine doesn't seem to be able to handle the numbers involved. ( RTF Admin found this out playing with the JumpDrive MFD ). The parent center for the programing will need to be moved to the new universal center at the galactic core to overcome this and the range from the center greatly expanded to at least 150,000 light years.

The other issue is the single light source being Sol. Changes will need to be made in the core programing that allows for multiple light sources around more than 1 star. I would suppose that the effective distance for a solar system light source would be 2 light years. Moving beyond this range would result in an all around shadow setting until you get within range of another star system.
tgep is offline   Reply With Quote
Old 11-11-2009, 07:40 AM   #60
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

Well, crossing the whole distance in real flight would be something only hardcore people might want to do anyways, since we don't have more than 100,000 times timeacceleration. Also, you won't see the stars move, which will make it even more boring. The current plan looks like this: switch scenario when reaching a certain distance from the major body (e.g. leaving its SOI, not sure yet about that), switch scenario and propagate time according to distance and current velocity. Most people will want to use a kind of "Jump drive" anyways. That should omit both problems.
jedidia is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Addons > Addon Development


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 08:50 PM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.