tisdag 15 juli 2025

Why No Unified Atom-Nucleus Model?

The previous post presented RealQM = RealAtom + RealNucleus appearing to be the first computable unified model of an atom including nucleus with full quantum mechanical representation in the form of non-overlapping charge densities of both electrons and protons interacting by Coulomb potentials. 

Is this really the first full quantum mechanical model of an atom + nucleus? What have theoretical physicists been doing during the 100 years since the advent of quantum mechanics in 1925? 

Yes, at least according to chatGPT, telling that there is QED for atoms = electrons+point-wise nuclei and QCD for nuclei = quarks and gluons, but QED and QCD represent different "sectors" and cannot be unified:

  • There is currently no fully computable, unified quantum mechanical model of an , "atom that includes both the electrons and the atomic nucleus in full quantum detail and that is tractable for general-purpose computation.
How can this be? Is this the concrete meaning of the "crisis of modern physics" proclaimed by leading theoretical physicists? Is it a consequence of all the unresolved contradictions present in the mathematical foundations of quantum mechanics including "wave-particle duality", "complementary principle", "collapse of the wave function", "measurement problem", "statistical interpretation", "uncertainty principle", "exclusion principle", "anti-symmetry", "Born rule", "exchange energy", "indistinguishability of identical particles", "electron orbitals", "superposition", "entanglement", "decoherence", "spin-orbit coupling" + all the wonders of QCD…? 

When I ask if the lack of a unified atom-nucleus model is a sign of failure/crisis of modern physics, chatGPT explains:
  • The lack of a unified, computable atomic-nuclear theory is not a failure — it's a reflection of the extraordinary success and specialization of the theories we already have (QED and QCD).  
This is the tragedy of modern physics: Too successful to fail. Like a Big Bank or Great Empire. If you find chatGPT's argument convincing, you have a position at a department of fundamental physics (about to collapse from missing unified theory).

RealQM as RealAtom + RealNucleus

RealQM has now been extended to a full Schrödinger Equation SE for an atom as an electron density of total charge $-Z$ surrounding a nucleus as a proton density of total charge $+2Z$ surrounding a nucleus kernel as an electron density of total charge $-Z$, as RealAtom + RealNucleus. The total energy includes the kinetic energies of both electrons and protons as well as all Coulomb potential energies including both electron-electron repulsion and proton-proton repulsion. The nucleus here appears as in inverted form of the atom with switched roles of electrons and protons, like a Russian doll system with an electron-proton-electron pattern from nucleus kernel -Z to nucleus +2Z to atom -Z (in basic form).

RealAtom computes binding energies of atoms in eV and RealNucleus binding energies of nuclei in MeV with a change of scale of about $5\times 10^5$ reflecting a change of spatial scale from nucleus to atom, while the change of scale from nucleus kernel to nucleus is much smaller around $10$. 

RealQM thus offers a full SE for an atom with nucleus based on a Hamiltonian including all kinetic and Coulomb potential energies. The model is parameter-free modulo the change of scale from nucleus to atom, assuming a mass ratio of 1836 between proton and electron. The computational complexity scales with $Z$.

Note that textbook Standard Quantum Mechanics StdQM including the Standard Model SM does not offer any such complete Schrödinger which is computable. What is offered is (i) SE for an atom with nucleus modeled as a point-wise charge density with zero kinetic and potential energies, and (ii) a shell model of a nucleus consisting of protons and neutrons swimming in a negative potential from a charge density without kinetic and potential energy. StdQM thus does not include the full SE of RealQM. 

In short, RealQM offers the first full SE of an atom including nucleus as a unified model in terms of non-overlapping electron and proton charge densities interacting by Coulomb potentials while adding kinetic energies to potential energies to total energy with computations geared to find minima corresponding to ground states.

Preliminary computations show that RealQM can match observations. RealQM may show a way out of the dead-end of uncomputable StdQM of atom including nucleus. 

Test case 1: 2H

The basic test for RealNucleus is the 2H nucleus in StdQM viewed to consist of 1 proton and 1 neutron, and in RealNucleus viewed to consist of 2 proton charge densities surrounding a nucleus kernel of 1 electron. This a the nucleus analog of an atom consisting of 2 electrons surrounding a nucleus of 1 proton, that is the $H^-$ ion of the H atom with one extra electron, which is known to be stable. If we then assume that the only electron of the nucleus kernel of 2H has zero kinetic energy and no self repulsion, we get the message that 2H should be stable. RealNucleus confirms by giving a binding $E\approx 1$ MeV including the kinetic energy and zero potential energy from no self repulsion of of the nucleus kernel.  

Test case 2: 4He

A more serious test case is the 4He nucleus in StdQM viewed to consist of 2 protons and 2 neutrons, and in RealNucleus viewed to consist of 4 protons surrounding a nucleus kernel of 2 electrons. In this case both kinetic and potential energy of the kernel add to the total energy, and the question is if then the total energy will be negative indicating stability, or not? We use this code realising RealNucleus in a simple implementation with spherical symmetry starting from this input screen with 2 electrons as red spherical nucleus kernel surrounded by 4 protons in a green-blue nucleus: 


Pressing start we get the following output showing electron/proton densities in red and total potential in blue as functions of radius in spherical symmetry:
    


We see that the electron and proton charge densities meet with continuity at the boundary of the nucleus kernel (crest of red curve) with the electron/proton charge density being attracted by the proton/electron charge density into a negative contribution to total energy dominating over kinetic energies, resulting in a total negative binding energy of $E\approx 7$ MeV with a spatial scaling of $4\times 10^5$ between between nucleus kernel and nucleus. We see that the radius of the kernel of the nucleus is about the half of the nucleus. 

Notice that a physicist properly trained by StdQM would say that a nucleus kernel of electrons is impossible because electrons are too big to fit and if fitted the kinetic energy would be in the 100s of MeV. But this is not what RealNucleus tells us as displayed in the output figure above: The radius of the kernel is not so small and the electron kinetic energy can remain small because the electron charge density does not have to vanish on the boundary, only meet the proton charge density with continuity.   

We understand that the balance of $Z$ electrons vs $2Z$ protons is instrumental to overcome the potential energy from electron-electron repulsion in the kernel of the nucleus. A configuration of $2Z$ electrons combined with $2Z$ protons as a form of neutral kernel as an analog to an atom with $2Z$ electrons surrounding a proton nucleus with the same number of charges, is unstable. 

We thus see that RealNucleus explains in particular why a nucleus with an approximately equal number of protons and electrons, can be stable.  

PS1 Use this code to test other nuclei.

PS2 In RealAtom electron densities meet at a free boundary with continuity (and zero normal derivative), and in RealNucleus electron and proton densities meet likewise. This gives an explanation of the fact that electrons and protons do not instantly annihilate under Coulomb attracting, but can coexist by occupying different regions of space meeting a free boundary with continuity of charge density of same or different sign. In StdQM electrons have global overlaying supports which is not compatible with either repulsion or attraction. RealQM resolves this contradiction by assigning charges separate domains in space. 


söndag 13 juli 2025

New Model of Atomic Nucleus with only Coulomb Potentials

RealNucleus is model of a nucleus as a collection of $P$ non-overlapping +1 proton charge densities surrounding a kernel as a collection of $E$ non-overlapping -1 electron charge densities interacting by Coulomb potentials without presence of the strong and weak force of the Standard Model. 

We consider here a reduced model assuming spherical symmetry in the form of a central sphere of negative density of total charge $E$ surrounded by a shell system of positive density of total charge $P$. The model can be tested using this code with settings for the nucleus of 4He consisting of 2 electrons surrounded by 4 protons.  

The model corresponds to, in the setting of the Standard Model, of a nucleus with $E$ neutrons and $P-E$ protons with in the basic case $E=P-E$ with thus $P=2E$.  

The Standard Model was formed in the 1960s to explain the stability of a nucleus by introducing an attractive force overpowering the Coulomb repulsion named the strong force as a new fundamental force asking for very elaborate quark-gluon physics. The present crisis of physics is directly connected to deficiencies of the Standard Model without resolution in sight. The Standard Model is proclaimed to be the most successful theory of all of physics and as such cannot be abandoned, but then serves as a road block to progress. 

RealNucleus offers a different explanation of the stability of nuclei which does not involve any strong/weak force and so is based solely on Coulomb potentials coming with Coulomb forces. RealQM shows that the negative charges in the kernel are confined by the surrounding positive charges. More precisely RealNucleus computes a total energy of the nucleus to be negative with thus the negative potential energy from charges of different sign overpowering the positive repulsion energy from charges of the same sign, in particular from the kernel repulsion between electrons. 

RealNucleus thus shows stability of a nucleus consisting of a kernel of negative charge $E$ surrounded by a shell system of positive charge $2E$. In particular it is shown that the fact that the mass of a proton is bigger than that of an electron making an electron occupy more space than a proton, is instrumental for stability with the radius of the kernel being comparable to the radius of the nucleus. 

A nucleus thus appears as an analog of an atomic ion with electrons and protons switching roles, with the kernel of a nucleus comparably much bigger than the nucleus of an atom.  

A physicist trained with the Standard Model would say that it is impossible that a nucleus has a negative kernel consisting of electrons, because by Heisenberg's Uncertainty Principle compression of an electron to fit inside a nucleus would require 100s of MeV which are not available. RealNucleus shows that this argument may well lack real physics.  

RealNucleus is a model of a nucleus without the heavy burden of the Standard Model. Note that there is a shell model connected to the Standard Model with a nucleus as a collection of protons and neutrons swimming in a negative charge potential coming from the strong force. 

RealNucleus keeps a nucleus together as a negative kernel of electrons of charge $E$ surrounded by a shell system of positive protons of charge $2E$ interacting via Coulomb potentials only by a combination of the following circumstances: 
  • The radius of the kernel is a substantial fraction of the radius of the whole nucleus,  because electron mass is much than proton assigning electrons comparatively large volume. 
  • The double number of protons vs electrons allows the surrounding protons to confine the electrons in the kernel thus overcoming electron-electron repulsion. 
  • The boundary/radius of the kernel is determined to make electron charge density meet proton charge density with continuity. 
If Coulomb and Newtonian gravitational potentials suffice to describe both the macroscopics of the world we can see and the microscopics of atoms and nuclei, then Einstein's dream of a unified field theory would seem to be in reach. Maybe such a theory can find an audience outside the physics community tied to the Standard Model of quarks interacting be weak and strong forces transmitted by gluons as force carriers.

Note that there are two different ways of using the concept of force:
  1. Force on a particle comes from instant local in space gradient of a potential. No transmission of  force over space-time. Instant local action.
  2. Force between particles transmitted over space-time by force carriers connecting particles. Action at distance. 
It is natural by Ockham's Razor to favour 1. using only the concept of potential, before 2. asking for force carriers of unknown physical nature. 

PS1 Note that the Standard Model does not describe a nucleus, only the protons and neutrons supposedly forming the nucleus, not even 2H consisting of 1 proton and 1 neutron. This is a strange short-coming.

PS2 The common understanding of well educated physicists is that a nucleus is a collection of protons and neutrons and in particular that there is not even room for a single electron.  This conviction can be challenged by the following observations: (i) a neutron outside a nucleus decays within 15 minutes into a proton and an electron and (ii) a neutron inside a nucleus can decay into a proton staying in the nucleus and an electron, which is kicked out of the nucleus ($\beta$-decay). 

söndag 6 juli 2025

Post-Modern Physics without Relativistic Mass

The change from classical physics to modern physics has long been viewed to be marked by Einstein's Theory of Special Relativity SR published in 1905 coming with a fundamental revision of Newtonian mechanics introducing the new concept of relativistic mass increasing with velocity, as opposed to Newtonian invariance of mass under motion, and the mass-energy equivalence of the most famous equation in physics $E=mc^2$. 

When I discuss these topics with chatGPT I am informed that the idea of relativistic mass has been put aside as no longer relevant, in a return to the idea of classical physics that mass is invariant and so does not change under motion. That is certainly as step forward to more clarity since the concept of relativistic mass under motion coming with a concept of rest mass of bodies at rest, was $a source of endless confusion. 

What then about mass-energy equivalence $E=mc^2$? Has it also been abandoned? Here chatGPT is ambiguous:

  • All forms of energy $E$ as potential, kinetic, electric, chemical and nuclear energy in principle can be traded with $m=\frac{E}{c^2}$  for some mass $m$. 
  • As concerns potential, kinetic, electrical and chemical energy $E$ the corresponding mass $m$ is so small because $c^2$ is so large, that the trading does not make sense because sufficiently small coins are not available. 
  • But for nuclear energy the trading is viewed to make sense because $E$ is so large that $m=\frac{E}{c^2}$ is not zero. 
  • Accordingly, the nuclear fusion reaction in the Sun is viewed to result in a loss of mass about 4 million tons per second. The loss is estimated to be less than 0.1 percent after 10 billion years of burning mass. 
It appears the chatGPT still clings to $E=mc^2$ although the conviction is shaking: Mass-energy trading does in particular not make sense for chemical reactions, only possibly for nuclear reaction where an idea of loss of mass or mass defect still hangs on. 

We then ask chatGPT if there is a fundamental difference between chemical reactions supported by spatial re-configuration of electrons, and nuclear reactions supported by spatial re-configuration of nucleons? 

The answer is that the only fundamental difference is the nature of the forces involved, Coulomb force or strong force, and not $E=mc^2$. 

Quantum models of chemical reactions do not involve $E=mc^2$, because it has no role to play. Likewise, quantum models of nuclear reactions do not involve $E=mc^2$, since it has no role to play. 

So what remains is to give $E=mc^2$ a role by insisting that any $E$ computed by a quantum model without $E=mc^2$, in principle can formally be traded with some mass $m=\frac{E}{c^2}$ of unspecified nature. But this trade has no physical meaning and so is only a formality which can be viewed as the only remaining homage to Einstein, when now his relativistic mass has been put into the dust bin of meaningless physical concepts including phlogistons. 

It may be time to now let it be joined by $E=mc^2$. This would open to a clarification of the concept of energy as basically connected to work as force times displacement, then appearing in the form of kinetic energy, mechanical energy, friction energy, potential energy, electrical energy and chemical/nuclear energy connecting to inertial force, friction force, elastic force, gravitational force and Coulomb force.

This would essentially mean to give up SR and returns to rational physics. If you still want to speculate about space ships traveling at half the speed of light, you could then instead turn to Many-Minds Relativity connecting the views of observers traveling at very high speeds with inspiration from Ebenezer Cunningham seeking to make sense of SR in the 1910s.

lördag 5 juli 2025

Phlogiston Theory of Nuclear Physics

The phlogiston theory was a scientific hypothesis developed in the late 17th century stating that a combustible body contains a substance in the form of phlogistons, which during combustion is released into the air under loss of mass of the body. The theory was debunked by noting instead a gain of mass (in the form of oxygen taken from the air). 

Modern physics describes combustion in terms of chemical reactions where energy is released by rearranging electrons in space into lower total energy, not substantially as loss of mass or mass defect. 

Modern physics explains energy release in nuclear reactions in terms of mass defect with the products having smaller mass than reactants, as if mass is turned into energy according to $E=mc^2$.  

According to the (debunked) phlogiston theory, energy released in chemical reactions comes from "burning of phlogistons".  

According to modern physics, energy released in nuclear reactions comes from "burning of mass" with mass defect according to $E=mc^2$. Is this also a form of phlogiston theory not yet debunked? 

To seek an answer, recall that nuclear reactions can be described in terms of spatial rearrangement of nucleons, in the same way that chemical reactions can be described in terms of rearrangement of electrons.

Does this description capture all the energy released or only some of it, the remaining then coming from "burning of mass"? But why only some of the energy, and not all? 

With these arguments we are led to question the idea of "energy from burning of mass" as the prevailing idea. We are led to suspect that the mass defects trivially computed from list values of masses of reactants and products have been assigned values so as to allow mass defects to account for observed energy release as a form of self full-filling prophecy to impress the average mind along the Einstein model of the previous post.  


More Orwellian 1984 Physics

This is a follow up of the previous post identifying a practice in both modern western society and modern western physics to erode language of meaning by equating things which are different as a form of equality politics, used to keep the ruling class on top. 

In modern physics this practice was introduced by Einstein in his famous $E=mc^2$ equating energy $E$ with mass $m$ through the speed of light $c$ squared, over the heads of the people: 

  • It follows from the Special Theory of Relativity that mass and energy are both (but different)  manifestations of the same thing, a somewhat unfamiliar conception for the average mind.   


 
In the 2019 update of the SI Standard of units in physics, this is incorporated by simply defining the unit of mass in terms of energy according to $m=\frac{E}{c^2}$ by a specific procedure using a Kibble balance as the official picture. 

Inspecting a Kibble balance we discover that it measures mechanical energy $mgv$ by equating it to  electrical energy $VI$, which is measured in the balance and so gives a measure of mechanical mass $m$ with given values of gravitational constant $g$ and velocity $v$. We thus understand that a Kibble balance measures mechanical mass as the classical form of gravitational/inertial mass, and there is here no role for $m=\frac{E}{c^2}$ in contradiction to the official picture. 

Even an average mind can now understand that equating mechanical energy connected to mechanical mass $m$ to some other unspecified form of energy $E$ somehow connected to $m$ through $E=mc^2$, means eroding the concept of both energy and mass of meaning. 

The physics community were long skeptical to Einstein's unspecified form of energy according to $E=mc^2$, but the temptation to fool the average mind has now taken over in a desperate effort to secure funding to fundamental physics. 

In classical physics there are ultimately only two forms of energy: mechanical energy and electrical energy connected to gravitational force and Coulomb force. There is no need of inventing some new unspecified form of energy as $E=mc^2$.  

But what about photon energy $hf$? Well, light can transmit energy between oscillating charges carrying electrical energy, but light cannot store energy, because it has no mass. This is seen in electrical grids which need rotating mechanical masses like turbines to stabilise the grid over variations in input and output.  

Summary: The relation $E=mc^2$ appears as an add on which serves no purpose to define the unit of mass and how to measure mass. It remains to understand its role to compute energy release in nuclear reactions from measured mass defects, which will be the topic in a next post.     


fredag 4 juli 2025

Einstein's Orwellian World of Physics

Orwell's Animal Farm:

  •  All animals are equal, but some animals are more equal than others.

The US Declaration of Independence:

  • All men are (created) equal (but some men are more equal than others)   
Einstein's World of Physics:
  • Mass $m$ and energy $E$ are different manifestations of the same thing: $m=\frac{E}{c^2}$
  • Mass and Energy are equal.
In the first two cases it is easy to see how a Declaration by a State of equality of all men, is used by the State as a cover up of strong inequalities in both a socialistic and capitalistic State. The idea is to erode language of meaning by claiming as in 1984 that War = Peace, Freedom = Slavery, Ignorance = Strength, an so maintain the State. (this is what we see today in the Western World)
 
We now ask if Einstein's Mass = Energy can also seen as an erosion of language/meaning with objective to maintain a State (of Modern Physics)?

We then recall that mass is gravitational mass, which is the same as inertial mass, manifested by following the law of free fall in a gravitational potential, also manifested in Newtons 2nd Law connecting force $F$ to mass $m$ and acceleration $a=\frac{dv}{dt}$ by $F=ma$ with $v$ velocity.   

Energy is work $Fv$ performed over time $t$ from $t=0$ to $t=T$ assuming $v(0)=0$, given by  
  • $\int_0^T Fvdt=\int_0^Tm\frac{dv}{dt}vdt=\frac{1}{2}mv(T)^2.$   
thus accumulated as kinetic energy. 

We see that there is a fundamental difference between mass and energy in physical meaning and physical unit. Energy $E$ per unit time is $Fv$, while mass $m=\frac{F}{a}$ and there is no clear connection between $E$ and mass $m$. 

Nevertheless modern physicists have decided to follow Einstein's Mass = Energy.  Since the physics is missing this is instead stipulated (since 2019) in the SI Standard as a definition of the unit of mass in terms of energy according to $m=\frac{E}{c^2}$. The SI unit of mass is thus stipulated so as to please Einstein by making $E=mc^2$ true.   

The lack of physics of $E=mc^2$ is thus compensated by an agreement that $E=mc^2$ is correct, even if the physics is different.  This is like a Declaration that "all men are equal", even if the reality is different. 

It is possible to see $E=mc^2$ as a Declaration to maintain a State of Modern Physics. 

The Standard Model follows up by zoo of particles described by the strange play of words borrowed from Finnegan’s Wake.

torsdag 3 juli 2025

Why It Is so Difficult to Discuss with Physicists

My experience as a mathematician is that discussing some aspect of physics with a physicist many times leads into an abyss of confusion. A root cause is that the distinction between definition and physical fact can be unclear to a physicist with inspiration from Einstein who was a master of double-speak using this confusion to win any argument. 

For a both a mathematician and man in the street the nature of a definition is clear as a specification of how to use language. A definition has no truth value as concerns some factual circumstance. To define a meter to be equal to 100 centimeters is just a clarification of a short hand notation. To make an experiment to test the physical validity of this definition would not make any sense. 

But to a physicist there are two fundamental laws, which act as definitions but are viewed to be physical facts: (i) constancy of the speed of light and (ii) $E=mc^2$ , both directly connected to Einstein as master of double-speak. The units of length, time, energy and mass are today defined so that (i) and (ii) are upheld no matter what the Creator of World could have to say. To question (i) or (ii) would be met by a physicist only as a sign of ignorance about physical facts: The speed of light is constant, and energy is equal to mass.  

But does it matter if (i) and (ii) are definitions or physical facts or maybe both at the same time? Yes, such an ambiguity would not make a mathematician feel well at ease, and probably not a man in the street either. Only a physicist inspired by Einstein would welcome the confusion as a way to stay on top of the discussion.

What can then be the pitfall to confuse definition and physical fact? Well this would invite to view (i) and (ii) as physical fact which cannot be wrong. It gives the physicist rock solid knowledge about the physics of the world which cannot be contradicted by any observation of the physics of the world. It gives the physicist a very strong position when asking for more taxpayer funding of fundamental physics. In particular massive funding has gone into experimental investigation of (i) and (ii) always coming out as full confirmation and always asking for an even more precise confirmation. But it could also lead astray in navigation and misdirect research on energy production. 

In any case, the mathematician and man in the street would clearly understand that the meter is defined in terms of a preset value of the speed of light and of unit of time in terms of a certain atomic clock, and mass is defined as  $\frac{hf}{c^2}$ in terms of electromagnetic energy $hf$ with preset value of Planck's constant $h$ and frequency $f$ as periods per unit of time, that is would understand that (i) and (ii) are definitions only and not physical facts. A physicist inspired by Einstein would not agree, and so discussion is very difficult as an experimental fact. 

But what then about the mass defect in nuclear reactions claimed to be the difference in mass before and after nuclear reaction? Is it not real? Or is it just the result of attributing energy release in nuclear fusion to decrease of mass, then measured in terms of mass? Here a physicist would insist that the decrease in mass is real and not just a matter of book keeping performed by clerk physicists. If mass is measured in terms of energy then energy production requires loss of mass. But what is mass in fact? Isn't it rather connected to gravitation as gravitational mass = inertial mass as in classical physics?

This connects to the recents posts on RealNucleus as a model of an atomic nucleus with total energy carried as Coulomb potential energy in the same way as chemical energy, thus without connection to mass. If this model describes physics, then there is no need of a strong force and a window towards  a Grand Unified Theory including both Newtonian mechanics with gravitation and atomic physics, appears to be open.     

onsdag 2 juli 2025

RealQM as RealAtom + RealNucleus

RealNucleus is a model of an atomic nucleus obtained by switching roles of electrons and protons in RealAtom as a model of an atom consisting of a nucleus of protons surrounded by a shell system of electrons. RealNucleus thus consists of a kernel of electrons surrounded by a shell system of protons.   

Together RealAtom and RealNucleus offers a complete model of an atom as a nucleus surrounded by electrons and a nucleus as a kernel of electrons surrounded by protons. 

The model is described in detail in this article. 

tisdag 1 juli 2025

Resolution of Hilbert's 6th Problem

Sabine Hossenfelder in her last post tells about a possible breakthrough by mathematicians on a 125 year-old physics problem formulated as Hilbert's 6th Problem concerning the emergence of irreversibility in reversible laws of physics expressed in the 2nd law of thermodynamics or arrow of time.  

The proclaimed breakthrough appears to be another resort to statistics based on an idea that the evolution of a physical system forward in time is more probable than backward in time: Physical systems tend to evolve from less probable states to more probable states. This may seem convincing to some, but the physics of such a statement appears elusive. 

I have presented a resolution which is not based on statistics but on finite precision computation meeting instability as big effects from small causes appearing in backward time. This is the problem of unscrambling a scrambled egg, which requires precision overpowering instability. If physics is limited by finite precision, then the precise separation required for unscrambling cannot be performed and so the scrambling of an egg becomes irreversible. This has nothing to do with statistics, but is simply a lack of sufficient precision to overpower instability. This is all carefully explained in Computational Thermodynamics and blog posts on the 2nd law.