Semi-Empirical Stellar Equations

I’ve spent a lot of time trying to answer certain questions in astronomy, where I just want a rough approximation for the purpose of a simulation, and don’t need an exact answer. These are some of the equations I’ve come up with.

Temperature (K) → Absolute Magnitude (visual):
Mv = 35.463 * exp(-0.000353 * T)
Roughly accurate between 2000-50000 Kelvin. Probably doesn’t continue accuracy at hotter temperatures.

Absolute Magnitude (visual) → Luminosity (solar luminosities):
Lsun = 100 * exp(-0.944 * Mv)
Accurate between 0-10 Mv. Probably continues accuracy relatively well.

Spectral (UBVRI) Filters:
Ultraviolet, Blue, Visual, Red, Infrared.
Objects are listed in different indexes:
UV for the hottest objects (stellar remnants, galaxies), then BV (the majority of stars), and RI for the coolest (LTY “stars” and below).

B-V index (x) → Temperature (K):
T = -772.2x3 + 3152x2 – 6893x + 9500
Sorta accurate between 0-2. (This equation I am least comfortable with, and don’t plan to use.)

Main Sequence Luminosity/Mass Relation:
Lstar / Lsun = (Mstar / Msun)3.5

Yerkes Classes’ T/Mv Relations

These equations are shown as functions where x is temperature in Kelvin, and f(x) is absolute visual magnitude. Most are valid from 2400 K to a little bit past 30000 K, the exceptions are noted. For the hypergiants and white dwarfs, the range is within an elliptical region, of which these functions define the major axis; for all others, they are a center-point along a Yerkes classification.

Hypergiants (0):
f(x) = -8.9
Supergiants (Ia):
f(x) = -0.00135x3 + 0.0233x2 + 0.0187x – 7.349
Supergiants (Ib):
f(x) = 0.00329x3 – 0.0962x2 + 0.829x – 7.209
Bright Giants (II):
f(x) = 0.00557x3 – 0.166x2 + 1.505x – 6.816
Giants (III):
f(x) = 0.0135x3 – 0.373x2 + 3.019x – 7.233
Subgiants (IV):
f(x) = -0.151x2 + 2.216x – 5.128 (4450-100000 K only)
Dwarfs (V):
f(x) = 0.00193x5 – 0.0615x4 + 0.742x3 – 4.257x2 + 12.439x – 12.996 (note: this one is the least accurate)
Subdwarfs (VI):
f(x) = 0.131x3 – 3.275x2 + 27.576x – 71.7 (3050-6000 K only)
White Dwarfs (VII):
f(x) = 0.489x + 10.01 (4450-30000 K only)

A Journey into λCalculus

I’m playing around in Minetest, and I have an idea. In order to execute this idea, I’m going to need a simple programming language. Asking Google… implementing a simple programming language

7 lines of code, 3 minutes: Implement a programming language from scratch
Sounds good! Ridiculously simple, fast, and gives us a fully usable language. (I would’ve understood brainfuck better..) Let’s see what this language looks like:

(λ v . e)   anonymous function with argument v and returning e
(f v)       call function f with argument v
(λ a . a)   example: identity function (returns its argument)

And the scary one:
(((λ f . (λ x . (f x))) (λ a . a)) (λ b . b))

Seems okay until I get to understanding that last example. If you’re curious about the steps I went through before I finally figured it out, here are my notes. I’m gonna skip to the good part:

(((λ f . (λ x . (f x))) (λ a . a)) (λ b . b))
two identity functions, let's name them I, & remove excess parenthesis
(λ f . (λ x . (f x))) I I
the syntax is still confusing me, let's make an "F" function
F(x) -> return (λ x . (f x))
F I I                          equivalent to ((F I) I)
substituting the function (identity) into our definition gives us
(λ x . (I x))         actually the same as the identity function
I(I)                  all comes to returning the identity function

λ x . x

Now, at this point I’ve learned a few small tricks for my understanding, as well as how lambda calculus works in general.


Solving a lambda calculus program is made of three (or 2.5) steps called reductions:

  • η-conversion (eta): Replace equivalent functions with simpler forms (λ x . f x) -> f
  • β-reduction (beta): Substitution (λ a . a) x -> x (essentially, THIS is solving it)
  • α-conversion (alpha): Rename conflicting names (λ a . a b) (λ a . a) -> (λ a . a b) (λ c . c)


This is where my journey ends for now. I started studying lambda calculus because of a desire to implement a simple programming language, but this will likely not satisfy my least not in this form. Here are additional resources:

My Obsession

(This post has been imported from an old blog of mine.)

For years I’ve been thinking about a rocket construction and flight game. Think 2D Kerbal Space Program, but with part design as well as craft design, and some SciFi aspects to it.

Just started on the project again and ran into a problem with the physics library I’m using (box2d), so for kicks I decided to calculate how many shapes I might need to try to make a planetoid have a variable surface instead of being circular.

Basically, a grandiose expansion of the concepts of KSP while simultaneously stepping backwards by making it 2-dimensional instead of within a 3D universe. I am a bit more realistic with my expectations than I previously was, so I know I’m not going to achieve it for a very long time, if ever, but it still is fun to think about or poke around with code or draw out some ideas from time to time.