Human use of Heat 
 ---------------
    Human society developed from its ability to convert prime sources 
of energy into useful work. The prime source could be wind, sunlight, 
flowing water, animal muscle. 
    These, while helpful to further human society, were catch-as-can, 
erratic, unreliable, presented undesirable side effects. A horse, for 
example, may take sick or spontaneously go wild. Wind mya fall calm 
or blow too weakly. The river may overflow and flood its shoreline. 
    Early in human history we learned that fire contained energy, 
mostly for light at night and heat in cold times. It was also a weapon 
to fend off predators. Fire had domestic uses like cooking, curing, 
drying, crafts. It was available more or less on demand and was 
supplied by a wide variety of natural combustible materials. 
    For most of history fire was a passive energy source, used as is. 
We used it to start more fires, like lighting street lamps or torching 
an enemy fort. Little effort was made to improve the ability to make 
and keep fire since  it was an limitless resource, given the cast 
amount of combustile materials to hand. 
    In the mid 1700s we learned that fire could boil water into steam 
and the steam could do mechanical work.        This was the birth of 
the industrial revolution. The steam engine was vastly more reliable, 
available, dependible, and orders stronger than other energy sources. 
    Steam engines improved rapidly in the 1700s but a nasty 
realization came into society. No matter how well we made and worked 
the engines, we lost a major portion of the input heat. It was 
discarded as waste heat. At first we thought this wasted heat, from 
the fuel we paid good money for, was poor insulation, excessive 
friction, loose fittings, leaks. But even the best efforts to extract 
a greater portion of  useful work failed. 
    This irritating feature of throwing away large portions of the 
ingredient heat was present in other heat-based machines. A gasoline 
motor receives energy from the detonated fuel and rejects heat thru 
the exhaust pipe. 
    Such machines are called 'heat engines'. They take in energy from 
a source at high temperature, perform work from this energy, and 
discard much of it into a sink at low temperature. 

Temperature 
 --------
    The common conception of 'heat' is its temperature, as read from a 
thermometer placed in the heat source. The higher the temperature, the 
more heat there is. 
    This is actually not all true. Temperature does not state the 
amount of heat, a quantity of energy. It's a potential for heat, like 
an elevation in mechanics or voltage in   electricity. Neither of 
these tell directly the amount of energy they can deliver. A large vat 
and a teacup filled with boiling water have the same temperature, that 
of the water in boil.  the vat has far more heat energy in it than the 
cup. 
    We have two main temperature scales. Celsius is based on two 
defined degrees of heat, water-ice as 0 degrees and water-steam as 100 
degrees. This is under one atmosphere of pressure. On this scale, the 
one for everyday use, is also called by its older name 'centigrade'. 
Nominal comfortable temperature for office of home is 20C; a really 
cold day is -20C; a really hot day is +40C. 
    Historicly this scale was the centigrade scale, for its interval 
of 100 degrees between its defining points. In 1954 it was renamed to 
celsius. By luck both names begin with 'C' so older thermometers are 
still usable. 
    The other scale has the same size degree, 100 to the internal of 
freezing and boiling water.  It starts at the coldest possible 
temperature, -273C, rounded. This is the kelvin scale, or for older 
scientists, absolute celsius. It has no negative readings, starting at 
0K. Room comfort is 293K; colder day, 253K; hotter day, 313K. 
    Thermometers for civil use are dimensioned in celsius. Those for 
scientific use may have both kelvin and celsius scales. 
    Kelvin is the preferred scale in physics but for very high 
temperatures it doesn't matter which is stated. The Sun is about 
6,000K or 6,000C, the 273 degree offset being only about 4%. 
        The 'o' symbol, for 'degree', is no longer part of the 
specification of temperature, like '24oC', the letter 'C' or 'K' by 
itself states the unit of measure. The 'o' is still in common use, for 
civil use. 

    +-----------------------+ 
    | TEMPERATURE RELATIONS  | 
    |                        | 
    | kelvin = celsius + 273 | 
   |                         | 
    | celsius = kelvin - 273 | 
    +------------------------+ 

Nature of heat 
 -----------
    Until the 18th century heat was considered as a product of fire or 
strong sunlight. In 1744 duChatelet experimented with heat and found 
it shared many properties with light. She suggested that since, in her 
day, light and heat are often produced together, maybe heat and light 
were somehow phases of a one emanation. under the French word 'feu'. 
    In the late 19th century we learned that heat is the energy within 
agitated molecules. The more molecules, the more heat. The intensity 
of the agitation is the temperature. 
    The molecules agitate, vibrate, pscillate within their host 
material's structure. If the vibration is too vigorous the structure 
falls apart and the material changes phase, such as ice to water or 
water to steam. For lower temperatures the molecules may settle into 
the lower-energy state, steam to water or water to ice. 
    We humans have no means to control the vibration of individual 
molecules in a body. If there are 'loose' ones in vibration, they are 
sources of loose heat that usually can not be captured. This 
fundamental nature of heat makes the science of heat energy so 
frustrating. We can work only with the overall properties of matter, 
with its agitated molecules, and try to transfer and transform its 
energy into useful work while keeping the lost energy at tolerable 
levels.
    Thermodynamics involves capturing energy from the agitated 
molecules in a source of heat and turning it into work for human 
society. There arose two schools of thermodynamic, the study of heat. 
One works with the macroscopic behavior of eat as a bulk flow of 
energy, the scheme for industry and engineering. 
    The other works with the microscopic behavior of the molecules 
themselfs. This is used in statistical  mechanics and quantum physics. 
    Radiant 'heat', like from a fire or the Sun, is itself not heat 
energy. It is electromagnetic radiation that imparts energy io the 
receiving body in the agitation of its molecules. The body's 
temperature is raised. In humans the radiation evaporates moisture 
from the skin, inducing the burn sensation. 
    To carry heat, the hot body is physicly moved from place to place 
or put in contact with other objects. The former method is convection 
and the hot object is usually a fluid like water or air. The latter 
method is conduction, like a soldering iron or laundry press. 

Laws of Thermodynamics
 --------------------
    Thermodynamics is described by four laws, zero thru three. Until 
the late 20th century they had weak underlying theory but were a;ways 
followed by experience and experiment. Today, as odd as it seems, they 
are under vigorous study banking off of blackhole physics. 
    = = = = = 
    ZEROTH LAW:  A body in thermal equilibrium with its surrounds has 
the temperature of the surrounds. A pie taken from an oven and put in 
open air to cool delivers energy into the air until it stops doing so. 
The pie then has the temperature of the open air. 
    This is law #0 because it was recognized after the other three 
were known. By history it was numbered '0' rather than '4'. 
    = = = = = 
    FIRST LAW: Energy can be changed from one form to an other but can 
not be created from noting or destroyed to nothing. This is the 
conservation of energy. 
    Mass can be turned into energy by the E=mc2 process, as the Sun 
does. Some 4 million tons of the Sun's mass are turned into energy 
every second. This energy did not come from 'nothing'. It was created 
from mass. 
    In human experience the mass turned into energy is infinitesimal, 
usually beyond detection. The mass 'has energy in it' that is 
released, like the chemicals in a battery or gasoline in a car. 
    A fascinating instance of energy turned into mass is the 
blackhole. Energy, like irradiation and energetic material, fall into 
the blackhole and become part of its mass. 

    = = = = = 
    SECOND LAW: A body taking energy from a high temperature reservoir 
and converting it to useful work must discard some of the energy into 
a reservoir of lower temperature. In common terms it is not possible 
to turn ingredient heat entirely into work. 
    The second law has many meanings, Some relate to the concept of 
'entropy', a measure of the worth or value of energy processed within 
a body. 
    So much of human production of energy is extraction from heat, 
like fuel combustion. This causes the loss of some of the input energy 
is a crucial concern. 

    = = = = = 
    THIRD LAW: A body with no heat energy in it has a temperature of 
absolute zero. Since heat is the motion of molecules, if this motion 
is somehow arrested, the body can have no lower temperature. 
    The third law defines the absolute temperature scale, with 0 
kelvin as the zero point. 
    By this law we can not actually achieve a temperature of 0K. We 
have no means what so ever to completely stop molecular motion in a 
body. and other reason, based on the second law, is that reaching 
absolute zero means we did work, stopping the molecules, from a single 
temperature, 0K, without discarding heat to a lower, nonexistent, 
temperature. 

Second Law of Thermodynamics 
 --------------------------
    The realization of work from heat is stated as the second law of 
thermodynamics. There are many expressions and corollaries of the law. 
Here we phrase it that work can be extracted only when heat is 
received by a heat engine at a  reservoir of high temperature and some 
of that heat is released into a low-temperature reservoir.  

    Not all energy from the high temperature ends up in work, typicly 
mechanical movement and force. The rejected heat comes from a genuine 
limitation and not just from deficiencies in the build or operation or 
upkeep of the heat engine. Even in a perfect machine some input heat 
is lost. This is a superset of the first law, which allows that in 
general all ingredient energy could be converted into work. The second 
law put out the exception for input energy in the form of heat. 
    The second law can be stated as 

    work = Qhi - Qlo 

where Qlo can not be zero. 
    The second law is sometimes stated as 'heat always flows from the 
higher to the lower temperature'. In most situations this is true. The 
second law and other principles of thermodynamics apply to large 
sources and sinks of heat, not small amounts. An incandescent light 
bulb in front of an open window will not stop cold air from outside 
from passing by the hot bulb. 
    An astronomy example is the heat from the Sun's photosphere. it 
flows thru the corona. The photosphere temperature is 6,000K but the 
corona is a couple million kelvin. There is no violation of the second 
law because there is so little material in the corona compared to in 
the photosphere. It's the bulb against the open window. 

Carnot Limit for Work 
  ------------------ 
    In early days of thermophysics we believed that the rejected heat 
resulted from imperfections in the machines, typicly excess friction 
and deficient insulation. Carnot in 1824 demonstrated that in all 
heat-based machines there is a maximum portion of the input heat that 
can be turned into work. The rest of it must be thrown away into the 
low-temperature reservoir, usually open water or air. 
    A typical heat engine is shown here in a simplified sketch. 


    ^      Thi--3 +----------+ 4 
    |             |          | 
    |             |          | 
  T |      Tlo--2 +----------+ 1 
    |             +          + 
    |             +          +  
    |             +          +  
 0K +-----------5-+----------+-6---> 
                     V         

    The engine is an idealized piston pushed by heated air and 
connected to a crank to run machinery. The spent air is vented into 
open air. Fresh air enters the engine at ambient temperature. This is 
all-new air, not the actual slug that left the motor. 
    T is temperature with the y-axis origin at absolute zero. V is   
volume, that of the cylinder. 
    At step 1 the piston is fully retracted from the previous stroke 
and air is let into the cylinder. The air is at maximum volume and 
lowest temperature for the instant stroke. 
    From 1 to 2 the piston compresses the air to its minimum volume. 
The piston does work on the air  by inertia from the previous stroke 
and rotation of the crank. 
   At 2 gasoline vapor is injected into the cylinder and ignited by 
the spark plug. 
    From 2 to 3 the air temperature is increased by the combustion of 
the gasoline. 
    From 3 to 4 the air, mixed with spent gasoline, shoves the piston 
and turns the crank. The air does work on the machinery attached to 
the crank. The volume increases to the full capacity of the cylinder. 
    At step 4 the air is released into the open air, still hotter than 
the ambient temperature. In a actual engine this hot air is dissipated 
and does not return to the cylinder for the next stroke. New air at 
ambient temperature enters the cylinder. 
    From 4 to 1 for this example we pretend the open air is a cooling 
stage. It bringing the hot air back to ambient temperature. The cooled 
air returns to the cylinder. 
    Note that there is a high temperature in steps 3 and 4 and a low 
temperature at steps 1 and 2. The work realized is the area bounded by 
points 1 thru 4. I do know that this is not stricta mente all the 
detail, but it serves to bring out the principles of getting useful 
work out of heat energy. 
    Note well that the energy put into the engine is the area 3-4-6-5. 
This came from the gasoline, which we paid to acquire and handle. The 
portion of the fuel's energy content that is not turned into work, 
area 1-2-5-6. We paid for this energy and must throw it away! 
    Carnot discovered that there is a maximum fraction of the input 
heat energy that can be turned into work. The rest must be wasted. 

    Wmax = Qhi * (Thi - Tlo) / Thi 

 +---------------------------------+ 
  | MAXIMUM POSSIBLE WORK FROM     | 
  | FROM cARNOT HEAT ENGINE        | 
  |                                | 
  |                                | 
  | Wmax = Qhi * (Thi - Tlo) / Thi | 
  +--------------------------------+ 

    Qhi is the energy taken in at the high temperature, the are 3-4-6-
5, from the combustion of fuel. 
    Thi and Tlo are the high and low temperatures in kelvin, at 3-4 
and 1-2.
   We examine the particular kind of heat engine, the Carnot engine. 
Other kinds of heat engine were devised, mostly constrained by 
engineering and mechanical factors. These are usually named for their 
inventors, such as otto, Stirling, Diesel, Rankine. They process heat 
thru a series of pressure, volume, phase changes, temperatures. 

 No Work from a Single Temperature 
 ----------------------------- 
    The second law shows that work can not be continuously extracted 
from a single reservoir of heat energy. By setting Tlo = Thi in the 
Carnot equation 

 Wmax = Qhi * (Thi - Tlo) / Thi 
      = Qhi * (Thi - Thi) / Thi 
      = Qhi * 0 / Thi 
/      = 0 / Thi 
      = 0 

    It is the hope and dream of inventors to build a machine that does 
generate work from a single reservoir of heat with no discharge of 
heat to a lower reservoir. All attempts totally failed. The ship that 
sails  by sipping up heat from the ocean or the plane that flies by 
sucking in heat from the air is impossible. 
    Be careful. There are ways to convert energy from a prime source 
into work with high efficiency. A hydroelectric station turns some 90% 
of the energy passing thru it into electric.  The station takes energy 
from the mechanical elevation of the water, not from the heat 
contained in the water. 
    Such machines are not heat engines. The prime source is not a 
reservoir of heat. The huge discharge of usable heat imposed by the 
Catnot limit applies only to true heat engines. 

Clausius Emtropy 
 -----   ------
    Entropy is a concept for the part of ingredient  energy that could 
not be turned into work. It is tossed with the rest of the heat within 
the Carnot limit. It was first described by Clausius in 1855, who 
named it 'entropy'. It is measured in joule/kelvin. 
     From the Carnot equation 

   Wmax = Q    hi * (Thi - Tlo) / Thi 

    Qhi - Qlo = Qhi * (Thi - Tlo) / Thi 

    (Qhi - Qlo) * Thi = Qhi * (Thi - Tlo)  

    Qhi * Thi - Qlo * Thi = Qhi * Thi - Qhi * Tlo 

    - Qlo * Thi = - Qhi * Tlo 

    Qlo * Thi = Qhi * Tlo 

    Qlo / Tlo = Qhi / Thi 

    Shi = Slo 

    Shi - Slo = 0 

    Thi and Tlo are the high and low temperatures; Qhi and Qlo, heat 
energies at the two temperatures; Shi and Slo, the associated 
entropies. 
    In a perfect Carnot heat engine the entropy taken in at the high 
temperature equals the entropy passed out at the low temperature. 
There is no change in the engine's entropy by processing heat energy 
into work. While the ingredient heat is greater than the egredient 
heat, it is the same 'worth' per kelvin degree of temperature. 

    +-----------------------+ 
    | CLAUSIUS ENTROPY      |                        | 
    | Qhi / Thi = Qlo / Tlo | 
   |                        | 
    | Shi = Slo             |  
    |                       | 
   | Shi - slo = 0          | 
    +-----------------------+ 

    Clausius flourished before the molecular structure of matter was 
known. e studied the mass flow of heat in industrial machines. These 
usually moved heat thru them by water and steam in large amounts. 
    Other scientists looked at entropy with slightly different 
interpretations but it wasn't until the 1870s, after molecules were 
recognized, that a radicly different inquiry occurred into entropy. 
This is the statistical method, as first worked out by Boltzmann. 

Actual Heat Engines 
 -------------- 
    A Carnot heat engine realizes all the maximum work between its 
high and low temperatures. A real heat engine always loses some energy 
to friction, mechanical wear, radiation, conduction,, other factors. 
The work realized is always LESS than the Carnot limit The energy that 
would have gone into work is discarded to the lower reservoire. 
    Such a machine is an 'irreversible heat engine'. If it is run in 
reverse, as a heat pump, the effects of friction and other losses are 
NOT undone. In fact, MORE loss is generated. 
    The energy balance becomes 

    (Qhi / Thi) - (Qlo / Tlo - Qloss / Tlo 
      < (Qhi / T)hi - (Qlo / T)lo 
                                       <  0 
    del(Q / T) < 0 

    delS < 0 

    This is the Clausius Inequality, 
 
    +----------------------+ 
    | CLAUSIUS INEQUALITY  | 
    | FOR REAL HEAT ENGINE | 
    |                      | 
    | del(Q / T) < 0       | 
    |                      | 
    | delS < 0             | 
    +----------------------+ 

    The Qloss/Tlo is the portion of ingredient heat that could have 
been turned into actual work. In the stead it is lost. This Qloss/Tlo 
is not available for the production of work and is dumped into the 
surrounds as waste. 
    The inability to convert the ingredient heat into the Carnot 
maximum output comes from the nature of heat. As the machine runs, 
parts within it absorb some of the heat flowing thru it. Atoms in 
these parts are agitated to become heat sinks. 
    Unless there is a way to prevent such diversion of heat away from 
performing useful work, the change in entropy high-to-low is always 
less than zero. The Clausius inequality is a built-in feature of the 
world. 
    A make-do effort to reduce the heat loss is cascading heat 
engines. The rejected heat from one is the input heat of the next. The 
high temperature is lower than for the first engine but it can be 
adequate for low-grade work. 
    Older electric power plants make high temperature steam for their 
turbines. In the stead of recycling the exhaust steam back to the 
boiler,s, the steam is sent thru surrounding streets as an other 
energy service. Customers take the steam, as a cascade heat source, to 
do useful work. Examples are clothes cleaning, chemical mixing, wood 
curing,, food cooking, plastics molding, space heating. The exhaust 
steam from t cascade engine is generally too cold for further use and 
is discharged into storm drains. 

Boltzmann Entropy 
 ---------------
       Boltzmann flourished in the 1870s, with the newly accepted 
molecular theory of matter. He discovered that the macrostate property 
of material comes from combinations of microdtate molecules. 
    Boltzmann found that the behavior of systems is the result of the 
behavior of its microstates, like a body and its molecules. The 
measure of this relationship ends up very similar to that of Clausius 
entropy, altho it does not directly derive from action of heat energy.  
    Since heat energy is stored in the vibrations and agitation of 
molecules, the statistics of this motion sare a measure of the heat. 
This ties Boltzmann and other related entropies to thermodynamics. 
    We play with two dice whose pips display a count from two to 
twelve. The dice are in the left and right cells of a shuffling box. 
after shuffle we examine the cells and read the pip values.  
    The overall property of the two dice is the number displayed, say, 
five. Boltzmann called this a 'state'. The microstate property is the 
many ways five can be shown on the dice, as 1-4, 2-3, 3-2, 4-1. Out of 
all the ways two dice can be thrown, four of them present dice by 
their pips. Boltzmann called the individual ways to make a state a 
'complexion'. The state '5'e has four complexions. 
    A table of states and complexions for two dice is given here. the 
complexion is the reading of the left and right die. 

    -------------------------------------------------------
    state | complexions
    ------+------------
       2  | 1-1
       3  | 1-2  2-1 
      4   | 1-3  2-2  3-1 
      5   | 1-4  2-3  3-2  4-1 
      6   | 1-5  2-4  3-3  4-2  5-1 
      7   | 1-6  2-5  3-4  4-3  5-2  6-1 
      8   | 2-6  3-5  4-4  5-3  6-2 
      9   | 3-6  4-5  5-4- 6-3 
     10   | 4-6  5-5  6-4
     11   | 5-6 6-5
     12   | 6-6 
    -----------
  
The possible states of the dice have different complexions, from 1 for 
states 2 and 12 to 6 for state 7. Boltzmann reasoned that for a random 
throw of the dice the state 7 would turn up most frequently because 
there are more ways to make that state. states 12 and 12 come up with 
lowest frequency because there is only one way to make thee states. 
    The most frequent states represent the most disordered, random, 
disorganized complexions while the rarer states have the neatest 
organized complexions.. In this sense Boltzmann described entropy as a 
measure of disorder. He noted that in nature activity left to itself 
tends toward disorder and higher entropy. 
    He at first defined entropy as the number of complexions that make 
that instant state of the material. The entropy of the two ice in 
state 5 is 4. 
    As the number of states and complexions increases the value of 
entropy rises to immense values. Boltzmann in the stead defined the 
entropy as the natural logarithm, ln, to keep the numerical value to 
manageable levels. He introduced a proportion constant k to fix up the 
units, as determined from experiments and comparison with Clausius's 
work. 

    +-------------------+ 
    | BOLTZMANN ENTROPY | 
    | FOR A GIVEN STATE | 
    |                   | 
    | S = k * ln(N)     | 
    |                   | 
    | k = 1.381e-23 J/K | 
    +-------------------+ 

    The numerical value of Clausius and Boltzmann entropy for a given 
situation are different and can not easily be translated between them.  

Arrow of Time 
 -----------
    In our world time flows in one direction with no possibility of 
modifying it. We can only passively use time as it comes to us, else 
lose it forever. The other dimensiions of our world are freely 
modified, these being X, Y, and Z directions of length.
    We speculate that inside a blackhole we can freely move around in 
time but are trapped in the one-directional flow of space. This is 
toward the singularity. 
    Staying in our world, the study of entropy suggests that it 
defines the direction of time flow. Entropy continuously increases, 
from less in past time to more in future time. 
    We neffer-effer see a natural process that decreases entropy on a 
large scale. On the small scale we can and do decreases entropy. When 
we build a wall of bricks we organize and arrange the bricks against 
their natural tendency to fall into a random heap.  we purposely do 
work on the bricks opposing the natural forces toward disorder. 
    Entropy, by Boltzmann, is a measure of disorder, randomness, 
disorganization. These qualities grow on their own in nature. Examples 
are rotting, SPalling, crumbling, erosion, corrosion, cracking. 
    Natural disasters are disorganizing events, like earthquakes, 
tornados, floods, conflagrations. All of these turn order into 
disorder. There is no 'natural proaster' that somehow spontaneously 
arranges the world into an orderly state. 
    Philosophers and scientists try to concoct situations where 
entropy on its own decreases in nature with utterly no success. The 
best effort is on a minuscule scale, while he rest of the universe 
goes its merry way toward ever-growing entropy, flying with the arrow 
of time. 

Sun as a Heat Engine 
 ------------------
    The Sun is a heat engine running between the central temperature 
of about 15,000,000K and the photosphere of about 6,000K. Because the 
Sun is a stable quiet star the power radiated off of the photosphere 
equals the power generated in the core, Qhi = Qlo. 
    The Sun as a machine produces no work! Except for the minimal 
amount of matter heaved up in solar wind, flares, convection cells, &c 
all of the input heat is sent to the lower reservoir as waste heat. 
    Certain other stars, like pulsating stars and cataclysmic stars , 
do actual work. They shove against gravity substantial amounts of 
mass. 
     For the Sun 
 
    delS = del(Q / T) 
         = (Q / T)hi - (Q / T)lo 
         = ((3.82e26 J/s) / (15e6 K)) - ((3.82e26 J/s) / (6e3 K)) 
         = (2.547e19 J/s.K) - (6.367e22  J/s.K) 
         = -6.364e22 J/s.K 

    The universe receives this energy, as a positive input, and 
increases its own entropy. The input of entropy to the universe from 
the Sun is +6.364e22 J/s.K. 
    If the Sun somehow converted the  heat energy from its core into 
the Carnot maximum work, that work would be 

    W = Qhi * (Thi - Tlo) / Thi 
      = (3.82e26 J/s) * ((15e6 K) - (6e3K) / (15e6 K)) 
      = (3.82e26 J/s) * (0.9996) 

      = 3.818e26 J/s 

This stays inside the Sun, not radiated away. No, I have no idea what 
can be the 'useful work' performed by this energy. 

    Qlo = Qhi - W 
        = (3.82e26 J/s) - (3.18e26 J/d) 
         = 1.52e23 J/s

    This is about the amount from a cool red dwarf star! Or it is the 
amount from the real Sun as received from about 50 AU, deep in the 
Kuiper Belt. 

Entropy from Starlight 
 --------------------
    Taking the Sun as a typical star we can estimate the contribution 
from starlight into the entropy of the universe. The Sun's rate of 
entropy injection into space is, from above, 6.364e22J/s.K. 
Normalizing this to the matter density of the universe and the 
lifetime of the Sun we have 

  Sstar = SSun * lifeSun * densityMass * 10% / massSun 
        = (6.364e22J/s.K) * (3.156e17s) * (4e-28kg/m^3) * (0.10) / 
        (1.989e30kg) 
        = 4.039e-19J/K.m^3 

    The 10% factor recognizes that only  about 10% of the mass of the 
universe actually produces starlight. The rest is inert, outside 
stellar cores and in disorganized clouds of gas and dust. 

    Sstar / Scmb = (4.039e-19J/K.m^3) / (2.063e-14J/K.m^3) 
                  = 1.958e-5 
 
                 -> 0.1958%% 

    The universe started out with an entropy of quite its present 
amoount and added the remaining 0.2% over its 13-odd billion years of 
its life. 

Energy and Entropy in CMB 
 -----------------------
    The cosmic microwave background is a pure blackbody radiation with 
temperature .2.73K. Its entropy is easy to compute because we avail of 
the standard blackbody formulae. 
    The energy density of blackbody radiation is 

     density = 4 * sigma * T^4 / c 
  
    I went directly to the blackbody formula for energy density in the 
stead of first getting the irradiation 
 
 density = 4 * sigma * T^4 / c 

sigma is the Stefan-Boltzmann constant,  5.670e-8J/s.m2.K4.T is the 
CMB temperature, 2.73K. c is lightspeed, 2.998e8m/s 

   density = 4 * (5.670e-8 J/s.m2.K4) * (2.73 K)^4 / (2.998e8 m/s) 
           = 4.256e-14 J/m3 

This value is for the entire spectral range of blackbody radiation, not 
for a particular band. 'Microwave' in the name comes from the 
discovery and initial measurements done in the microwave band. The CMB 
peak radiation is at about 1 miilimeter wavelength. 
    Entropy implies that heat is exchanged from the heat engine and 
its surrounds. The universe in the whole has to surrounds. No heat is 
exchanged into or out of the universe. Any entropy dumped from objects 
within the universe like stars, supernovae, merging neutron stars, 
earthly machines stays 'inside; and continuously increase the entropy 
of the universe. 
    We also have no simple notion of size or volume for the universe 
to sum up the contributions of entropy. We work with a representative 
volume  where we can be free of local energy floes thru it. For the 
moment we ignore any local floes and let this volume be penetrated 
only by radiation from the cosmic microwave background. That's why we 
worked out the energy density, joule/neter3, and not energy for the 
whole universe in joule. 
    Continuing with blackbody rulees, the entropy of the CMB is 

    entropy = = (4 / 3) * density / T 
              = (4 / 3) * (4.256e-14 J/m3) / (2.73 K) 
              = 2.018e-14 J/m3.K 

        These equations are a bit different from the ones for other 
kinds of radiation, notably the factors '4' and '4/3'. I skipped their 
derivations for this article. 
    According as many cosmology theories, the entropy of the cosmic 
background radiation was constant since it was created, some 350,000 
years after the Bigbang. 

    entropyBB = entropyNOw 

    (Q / T)BB = (Q / T)Now 

    Qbb = Qnow * Tbb / Tow 
        = (4.256e-14 J/m3) * (3,000 K) / (2.73 K) 
        =  4.677e-11 J/m3 

The temperature of the universe when the CMB emerged was around 
3,000K, that of a red dwarf star. This temperature is when the plasma 
was cool enough to let electrons and ions unite into atoms and become 
transparent to radiation. It's like the photosphere os a star and the 
era of CMB release is sometimes called the photospheric era. 
    This isn't an impressive result, the energy density is a thousand 
times greater near the Bigbang than now. But we must recall that while 
the radiation from CMB was flowing into space, space was undergoing 
Hubble expansion. the cubic meter of today was far 'smaller' back 
then. The Hubble redshift, the ratio of the universe scale factor now 
to that when the radiation was emitted, is quite 1000. We today are a 
thousand times 'larger' than at the photospheric time. 
    A meter now was only a millimeter, by our meterstick, so a cubic 
meter now was a cubic millimeter, on billionth as large. 
   The energy density was packed into a cubic millimeter, ot to fill 
today's cubic meter we need one billion time more energy. The 
equivalent energy density, measure by today's meterstick, in more like 

   densityBB/Now = densityBB * (m3Now / m3BB) 
                 = 4.677e-11 J/m3 * (1000  / 1)^3 
                 = 4.677e-2 J/m3 

And the irradiation for an observer in the CMB right after the 
universe turned transparent is 

    irradiation = density * c 
                = (4.677E-2  J/m3) * (2.998e8 m/s) 
                = 1.402e3 J/s.m3 

This approximates the energy output from the photosphere of a red 
dwarf star. 

CMB versus starlight 
 ------------------
    Eddington in 1925 worked up the amount of energy in the universe 
by summing the light from stars. He observed in the optical waveband 
within the Milky Way. Astronomy then was constrained to only the 
visual waveband and obscuring by interstellar medium. Interstellar 
medium was poorly studied and the cosmic microwave  background was a 
far-future discovery. He came up with a 'cosmic  temperature' of some 
3,000K. 
    Firm estimates of the energy density due to the stars are hard to 
find. By starlight we mean  detectable radiation, except the CMB 
itself, over the entire spectrum. 
    Because the CMB is pure blackbodybody radiation it spans all 
wavelengths and contaminates the measurements. Until the cMB was 
discovered this contamination was not properly recognized. 
    An estimate can be made by taking the Sun as a typical star and 
normalizing its radiation for the mass density of the universe. 

    energy of Sun = (power of Sun) * (life of Sun) / (mass of Sun) 
                      = (3.82e26 J/s) * (3.156e17 s) / (1.989e30 kg) 
                      = 6.063e13 J/kg 

    Note how minuscule this is compared to the ultimate E = mc2 
converting mass into energy. One kilogram equals 9e16 joule. The Sun 
in its lifetime converts only (6.063e13J)/(9e16J) = 6.74e-4 of its 
mass -- barely 7% of 1%! Recall that in a star only about 10% of the 
mass is ever involved in generating radiation. The rest is outside of 
the core, too 'cold' to undergo nuclear reactions. 
    Of this 10%, only 0.7% turns into energy by E = mc2. Our 7% of 1% 
is very close to the value obtained by stellar evolution theory. 
    We next reduce this unit energy production to the mass density of 
the universe. This density includes matter  outside of stars, like 
extended gas and dust. A good estimate for the matter engaged in 
energy production is 10% of the total observed mass. This does not 
consider the 'missing mass' or 'dark matter', which may be as much as 
30 times the observable mass. 

    starlight  density = (mass density) * (10%) * (energy/mass) 
                       = (4e-28 kg/m^3) * (0.10) * (6.063e13 J/kg) 
                       = 2.425e-15 J/m^3 

    (starlight / CMB) = (starlight density) / (CMB energy density) 
                        = (2.425e-15 J/m^3) / (4.235e-14 J/m^3) 
                      = 0.0573 
                     -> 6% 

    We should allow for other energy processes, like supernovation and 
quasars, blackhole activity.  We still get only a couple more 
percentage points. Essentially all of the energy ever produced in the 
universe comes from  the CMB. And it was generated only 350,000 years 
after the Bigbang!  The universe did its thing all in one shot and 
little much else happened for the ensuing 14 billion years. 
    What is more astounding, few modern treatments emphasize this 
feature. For all of astronomy history, prior to discovery of the CMB 
in 1965,  we built our knowledge of the universe thru maybe 8 percent 
of the total radiation in it! 
    To compare this with the overall mass density of the universe, we 
have 

    (density starlight) = (energy density) / c^2 
                        = 2.43e-15 J/m^3) / (9e16 m^2 / s^2) 
                       
                        = 2.70e-32 kg/m^3 

    The overall mass density of the universe is about 4e-28kg/m^3 for 
a ratio of starlight mass to overall mass of 1.75e-5! This minuscule 
fraction of mass turned into starlight lets us treat the total mass in 
the universe as constant over time. What mass was formed in the 
Bigbang exists today. 

 +------------------------------------+ 
 | ENERGY CONTRIBUTION FROM STARLIGHT | 
 |                                    | 
 | starlight = 2.43e-15 J/m^3         | 
 |           = 2.70e-32 kg/m^3        | 
 +------------------------------------+ 

 Number Density as Entropy 
 -----------------------
    Some cosmologists say that the entropy of the universe is the same 
as the ratio of the photons to baryons. The value cited is around a 
billion to one. The entropy  of the CMB is 2.063e-14J/K.m3 as found  
from the Clausius method. By the boltzmann statement of entropy we 
have 

    S = k * ln(N) 
      = 2.063e-14 J/K.m^3 

    ln(N) = (2.063e-14 J/K.m^3) / k 
          = (2.063E-14 J/K.m^3) / (1.381e-23 J/K) 
          = 1.494e9 1/m^3 

This is an entropy measure as a pure number, rather than joule/kelvin. 
    The densities of photons and baryons in the universe, taken from 
litterature, are demsityP = 4.157e8 photon/m3 and densityB = 0.239 
baryon/m3. Their ratio is 

    demsotuP / densityB = (4.157e8 photon/m^) / (0.239 baryon/m^3) 
              = 1.733e9 photon/baryon 

Given the uncertainty in assessing the density of baryons, this is in 
good agreement with the entropy value based on Clausius. 

 +--------------------------------+ 
 | ENTROPY AND PHOTON/BARYON      | 
 |                                | 
 | densityP / densityB = 1.733e9  | 
 |                                | 
 | entropy = 1.494e9              | 
 |                                | 
 |  entropy = densityP / densityB | 
 +--------------------------------+ 

Blackholes 
 --------
    When first seriously considered as real physical bodies, we didn't 
believe there would be an application of thermodynamics for them. 
Below the event horizon there are no molecules to vibration as heat 
energy and there was no obvious way to assign a temperature to a 
blackhole. The interior of a blackhole was supposed to be a thoro 
vacuum because all mater in it went straight into the central 
singularity. 
    In 1974 Hawking and also Bekenstein worked out that a blackhole 
must have thermodynamic properties in order that its behavior emgage 
properly with the physics above the event horizon. 
    Explanation of the new thermodynamics -- still in the 2010s under 
development --  requires a whole other discussion than available in 
this here piece. I offer only a couple features as seed s for external 
menticulture. 
    Hawking and Bekenstein showed that a blackhole has a temperature 
and an interanl energy or entropy. We can reason that a blackhole must 
have entropy because it is the fate of energy and mass entering the 
blackhole. These do not disappear but add to the energy of the 
blackhole.
    For a Schwarzschild blackhole, one with only mass as its defining 
parameter, there being no angular momentum or electric charge, this 
internal energy is converted into more mass for the blackhole. This is 
the only significant instance of nature turning energy into mass by 
inanimate processes. The temperature of a blackhole is 

    Tbh = h * c^3 / (16 * pi^2 * gamma * M) 

where H is Planck constant; c, speed of light; gamma, Newton constant; 
M, blackhole mass. For blackholes formed from stars, at least 3 solar 
masses, the temperature is incredibly low, about 1e-7 kelvin. 
    Altho such a blackhole should radiate thermal blackbody radiation, 
it is utterly smothered by the irradiation absorbed by the blackhole 
from the ambient 2.7K background radiation and has no astronomy 
concern. For a blackhole to have a Hawking-Bekenstein temperaature 
equal to the cosmic background, it has to be of mass order the Moon. 
As yet we know of none among astronomy objects of interest. 
    The radiated energy comes from conversion of the blackhole's mass, 
being a loss of its entropy. The blackhole entropy is 

    Sbh = area * (2 * pi * k * c^3 / (h * gamma)) 

where the k is Boltzmann's constant.  This entropy is that built into 
the original blackhole when it was created, plus that added by intake 
of external mass and energy like from an accretion disc. Of this 
entropy some goes into the Bekenstein-Hawking radiation, altho for 
astronomy purposes this is negligible. In fact, for blackholes formed 
from stars it would take orders of cosmic lifespans to radiate it 
away. 
    I must warn that in some texts the Planck constant is replaced by 
the Dirac constant, 'h-bar'. In typeset text the 'h' has a slash thru 
its mast.  h-bar is just h/2pi, which i use in the above formulae. 
    From these two basic thermodynamic properties of blackholes, there 
is now a vigorous investigation of traditional thermodynamics. This 
discipline is still, at least for industry and engineering, bases on 
experiment and empirical work. perhaps as the blackhole thermodynamics 
evolves, it can apply its theory to traditional thermodynamics