You can't construct a star with arbitrary
size: a star is forced to obey the laws of nature.
Divide a star into layers, like an onion. The four laws which
dictate a star's structure tell us what the density, temperature,
pressure, energy generation rate, and so forth must be within
each layer, or shell. The four laws which dictate the structure
can be written in mathematical form, so they can be used to
create mathematical models which give numerical values for the
density, etc. within each shell.
LAW ONE:
The Law of Hydrostatic Equilibrium
This is a law we've encountered before. It simply states that within every layer, the outward force of pressure equals the inward force of gravity.
LAW TWO:
The Law of Energy Transport
Again, a law that we've encountered before. It states that within every layer, energy is transported outward (from the hotter center to the cooler surface) by radiation, convection, or conduction. The rate of energy transport follows known mathematical laws. For instance, the rate of radiation transport depends on the temperature, density, and opacity within a layer.
LAW THREE:
The Continuity of Mass Law
This is the most absurdly simpleminded of the laws. It states that the total mass of a star equals the sum of the masses of the individual layers. Moreover, there are no gaps between layers: each layer rests directly on top of the one below.
LAW FOUR:
The Continuity of Energy Law
This is nearly as simpleminded as the previous law. It states that the total luminosity of a star equals the sum of the luminosities of the individual layers. Every layer in which fusion occurs has a luminosity. Since only the central layers, where the density and temperature is high, have fusion occuring within them, most of a star's luminosity comes from the inner layers.
Since the four laws can be expressed as mathematical equations (which I won't write down, since they involve differential calculus), they can be solved numerically to yield tables of density, temperature, pressure, and so forth, for each layer of the star.
Generally, the equations must be solved on
a computer (too complex to be done with paper and pencil in a
reasonable time). We ought to remember the basic law of
computers:
GIGO - Garbage In, Garbage Out.
The results which we get from out equations are only as good as
the assumptions which go into them. If we assume that the Sun is
powered by an enormous gerbil running on a treadmill, our results
will be garbage, no matter how big the computer, or how fancy the
computer program.
From time to time, it's a good idea to
QUESTION YOUR BASIC ASSUMPTIONS!
Example of a computer model: The Sun
The observed surface temperature is 5800 Kelvin. The computed
central temperature is 14.6 million Kelvin.
The main sequence has a cutoff at the
high mass and low mass end. Very few stars are observed with
masses greater than 50 times that of the Sun or with masses less
than 1/10 that of the Sun. Why?
There exists a high-mass cutoff because very high mass stars cannot attain hydrostatic equilibrium. Very high mass stars produce enormous numbers of high-energy photons (L and T are both large). Photons exert pressure on gas (an effect called radiation pressure.) Ordinarily, the effects of radiation pressure are small, but for stars with M > 60 Msun, models indicate, the radiation pressure is large enough to blow the star apart!
There exists a low-mass cutoff to the main sequence because gaseous spheres with M <0.08sun, models indicate, have central temperatures too low for fusion of hydrogen to helium to take place. These low-mass gaseous spheres are not called ``stars'', but ``brown dwarfs''. (The name ``star'' is reserved for objects which are powered by nuclear fusion.)
Stars shine because they are
hot; brown dwarfs also shine (albeit dimly) because they are hot
(albeit not very hot). Brown dwarfs radiate in the infrared,
powered by their gradual graviational collapse (think of them as
protostars in which fusion has failed to stop the collapse).
Brown dwarfs can be observed. Searching for a brown dwarf at
random locations in the galaxy is like searching for a very dim
needle in a very big haystack. Some success has been attained in
looking for brown dwarfs in binary systems with stars:

The above illustration shows two images of the star Gliese 229A
and its brown dwarf companion, Gliese 229B. (Click on the image
for a larger version). The image on the left was taken from the
ground, using a 60-inch telescope on Mount Palomar, in Southern
California. The higher-resolution image on the right was taken
using the Hubble Space Telescope. Although Gliese 229A is off the
edge of the Space Telescope image to the left, it is so bright
that it floods the telescope's detector. The tiny speck on the
right is the brown dwarf. The diagonal line is a diffraction
spike caused by scattered light in the telescope's optics. The
mass of the brown dwarf Gliese 229B is 0.02 Msun,
or about 20 times the mass of Jupiter.
(Image credit: S. Kulkarni [Caltech], D. Golimowski [Johns
Hopkins], and NASA)
High mass stars require high
central pressures to maintain hydrostatic equilibrium.
High central pressures imply high central density and
temperature.
High central density and temperature imply VERY high fusion
rates.
Very high fusion rates imply short lifetimes, because the star's
fuel supply (its hydrogen) will be rapidly exhausted.
A star's lifetime is:
t = M / L
(when the lifetime t, the mass M, and the luminosity L are all
expressed in solar units)
It is observed that a star's
luminosity depends strongly on its mass:
L = M3.5
Therefore, the dependence of
lifetime on mass is:
t = M / M3.5
= 1 / M2.5
In the example given by the textbook, increasing the mass of a star by a factor of 4 decreases the lifetime by a factor of 1/32.
Examples of main sequence lifetimes:
The Sun:
M = 1 Msun
t = 1 tsun
= 10 billion years
M-type star:
M = 0.2 Msun
t = 1/(0.2)2.5
tsun = 56
tsun = 560
billion years
O-type star:
M = 40 Msun
t = 1/(40)2.5
tsun =
0.0001 tsun
= 1 million years
The main sequence lifetime of an M star is comfortably longer than the age of the universe (about 15 billion years). Thus, every M-type main sequence star that has ever been created is still chugging away, converting hydrogen into helium in its core. On the other hand, every O-type main sequence star in existence must be very young (under a million years old). Massive stars are like James Dean: they live fast, die young in a blaze of glory, and (as we shall see later in the course) leave a badly crushed corpse.