Tore Haug-Warberg's Home Page

Tore Barsk


The dude


Mr. Bond

You should call it entropy, for two reasons. In the first place your uncertainty function has been used in statistical mechanics under that name, so it already has a name. In the second place, and more important, no one really knows what entropy really is, so in a debate you will always have the advantage..

Then Claude Elwood Shannon was asking John von Neumann what the uncertainty function in his newly created information theory should be called [M. Tribus ``Energy and Information'', Scientific American, 225 (1971) p. 180].

This page presents a few of my daily tasks over the past 15 years. There is no chronology with respect to what comes first and what comes last, but most of the time I find myself teaching, pondering, writing, or encoding thermodynamic (model) structures; using different kinds of programming languages.

A few words on thermodynamics might be in order since that is my main subject. For instance that it is universally regarded as a difficult subject. To this I would like to say that students spend too much time trying to comprehend all the formulae which, to their believes, make the foundation of thermodynamics. The latter is wrong. Because, if thermodynamics was to be invented a second time it would end up pretty much where it stands today. It is not just a mathematical model of the nature as we see it, it is about Nature itself. To understand thermodynamics one must try to understand nature, and not the formulae. This is, admittedly, not the easiest undertaking. Furthermore, since it is difficult to understand it will also be difficult to teach. This brings in the teacher - student relationship of which I think that:

To be heard is not necessarily to be understood;
to be understood is to understand;
to understand is to listen - with body and soul.

This goes both ways: Not only teacher - student, but also student - teacher. The wording above was chiselled out during my sabbatical stay at UCLA in the fall of 2013, which left me room to think about such things, but searching for similar phrases on the internet will render millions of hits in the form of blogs, papers, essays and books. Sure enough, the phrase has a classical touch. If you are looking for similar words of wisdom, the Roman philospher Lucious Annaeus Seneca holds a fair number of them. If you are interested in my thoughts on personal understanding you can have a look at this blog.

Links to my other stuff:

  1. Animations
  2. Theses
  3. TABBE
  4. KP8108 Phase Equilibria (PhD)
  5. Chocolate (fun)
  6. TKP4175 Thermodynamics (MSc)
  7. TKP4175 Lecture notes
  8. TKP4106 Modelling (MSc)
  9. Matlab primer
  10. Lifetime bibliography

External links:

  1. The Japanese KENSHU Method (J.Chem.Educ.)
  2. Symbols in Scientific Manuscripts (NIST)
  3. Scientific Papers (Internet Archive)
  4. The Engines of Our Ingenuity (UH)
  5. Ruby Hacking Guide (RubyForge)
  6. Top Thermodynamics (wiki)
  7. Chemistry WebBook (NIST)
  8. Oria (Library service)
  9. Nobel prizes (
  10. LaTeX (Cambridge University)

Links on this page:

  1. Thermodynamic modelling
  2. Algorithms
  3. Languages
  4. Enterprices
  5. Equations of state
  6. Teaching
  7. Network solvers

Thermodynamic models and model parameters:

Electrolyte NRTL

Implementing models from the literature is tedious work: The models can be complex, and errors and misprints is the rule, not the exception.

About thermodynamic consistency: Making the model right is harder than making the right model.

Consistency check

Database example

Collecting and maintaining thermodynamic data(bases): There is somewhere between 0.5 M and 1M physical property values and model parameters in my database collection.

Verifying component chemistry and uniqueness: As easy at it sounds - this is a very hard task. Many data collections are published with minimal identification information. Just formulas and numbers. Now, one chemical formula may map to several component names, and one component can have several CAS numbers (allthough there to each CAS number is only one component). As a rule, the physical properties of the component must be tested to verify that it is want you think it is.

CAS number

Developing new languages for model representation:

YASIM server

Thermodynamic calculation server (YASIM): Built to serve the needs of Yara International. Basically, it is a thermodynamic stream calculator equipped with a symbolic equation solver.

Thermodynamic model declaration (Thermo): This is my little baby - a high-level language written in Ruby to make object-oriented design of model hierarchies possible:

Thermo language

RGrad language

Automatic gradient calculation (RGrad): Calculating scalar derivatives of explicit functions is quite routine, and of function gradients the same, but calculating function gradients to arbitray order is not. RGrad is a language (designed by me and my PhD student Bjørn Tore Løvfall) for doing exactly this. It has been tested up to the seventh order on the SRK equation of state (yielding about 200,000 lines of exported C code):

Mathematical notation: Doing high-level programming is quite hard without some kind of abstract object representation. Standard notation from calculus is not always sufficient and new things must be tried out...

Math language

Congruence transformation

Co-ordinate transformations: Thermodynamics is much about shifts in free variables (which is actually why I need the automatic gradient calculations above). Symmetry and beaty is definitly the rule!

Developing algorithms for:

Phase stability

Global optimization


Known as flash calculations

Multicomponent reaction

Reactions in gas, solid or liquid phases

Heterogeneous reactions

Reactions across phase boundaries


Gas explosions and detonations


Restricted phase equilibrium

Gravitational field

Oil-gas wells of significant thickness


TVN, TpN, HpN, UVN, etc.


Thermodynamic singularities

Keeping up on equations of state and activity models:



Strong acids

Nitric acid, hydrochloric acid

Weak electrolytes

CO2, amines

Pure fluid properties

Steam tables and reference fluids

Inorganic solids

Allotropic forms of NH4NO3

Salt melts



Liquid air, alcohols

High-pressure phases

H2, geochemistry, detonations


Heavy water distillation

Private enterprices:

Thermodynamic pun: HAUG is an acronym for Enthalpy, Helmholtz, Internal, Gibbs (besides being my first family name). A small company serving customers in Norwegian industry, institutions and private sector with tailor made computer code for all kinds of thermodynamic calculations.

HAUG Technology

Teaching (TKP4175, KP8108):

Den termodynamiske arbeidsboken

TKP4175: The course shall provide a thorough introduction to the mathematical methods of thermodynamics, aimed at the use in simple control volume theory, computation of properties of thermodynamic mixtures (gases and liquids), and phase and reaction equilibrium calculations. KP8108: Hands-on course in thermodynamic equilibrium theory and algorithms (Newton type) for computing complex phase and reaction equilibria, in geometry independent systems. The concept of canonical variables and Legendre transformations is stressed. Programming in Matlab.

Process simulation with thermodynamic structure:

A joint effort by me and 3 of my PhD students (Volker Siepmann, Bjørn Tore Løvfall and Olaf Trygve Berglihn). The goal has been to represent, and of course solve, process flowsheets with thermodynamic nodes - both in steady state and dynamic mode. The outcome is in both cases a nicely structured coefficient matrix:

Network solver