3.029 Spring 2022
Lecture 07 - 02/22/2022

Thermodynamic Stability

Last week we talked about the fundamental thermodynamic relation

and used is in conjunction with the Legendre transform to introduce various other thermodynamic potentials

In-fact, the “natural” variables we defined for each of the thermodynamic potentials are chosen such that they minimize the thermodynamic potential

E.g. the Euler equation  is minimized for particular values of  and

Minimum Conditions

For a function to be at a minimum:

Its first derivative must vanish

Its second derivative must be positive

univariateFunction[x_]=2(x^4)-10(x^2)+7x

univariateMinimaSols=Solve[{
univariateFunction'[x]==0,
univariateFunction''[x]>0
},x]//N

Plot[univariateFunction[x],{x,-5/2,5/2},Epilog->{Red,PointSize[Large],Point[{x,univariateFunction[x]}/.univariateMinimaSols]},Frame->True]

Note this a local minimum test

In contrast `Minimize` returns the global minimum

Minimize[univariateFunction[x],x]//N

For multivariate functions, a similar idea exists. 
E.g. for functions of two variables

(Subscript[∇, {x,y}])f[x,y]={0,0}

The Hessian has to be positive-semi definite

I.e. have non-negative eigenvalues

hessian[f_,vars_]:=Grad[Grad[f@@vars,vars],vars]

MatrixForm[hessian[f,{x,y,z}]]

multivariateFunction[x_,y_]=2(x^4)-10(x^2)+7x y+5(y^2)

multivariateMinimaSols=Solve[
Join[
Thread[Grad[multivariateFunction[x,y],{x,y}]==0],
Thread[Eigenvalues[hessian[multivariateFunction,{x,y}]]>0]
],{x,y}]//N

ContourPlot[multivariateFunction[x,y],{x,-5/2,5/2},{y,-5/2,5/2},Contours->25,Epilog->{Red,PointSize[Large],Point[{x,y}/.multivariateMinimaSols]},PlotLegends->Automatic]

It’s instructive to think about these using the first and second order Taylor expansions of the function

Simplify[Normal[Series[f[x,y],{x,x0,1},{y,y0,1}]]]/.Derivative[1,1][f][__]->0

Which we can equivalently obtain using

With[{du={δx,δy}},
du.Grad[f[x,y],{x,y}]/.{x->x0,y->y0}]

Expressed in this form, the condition for a function to be at a minimum, maximum, or saddle point is given by

where the funky symbol means “for all possible choices of du”

Similarly, to second order we have

Simplify[Normal[Series[f[x,y],{x,x0,2},{y,y0,2}]]]/.{Derivative[2,2][f][__]->0,Derivative[1,2][f][__]->0,Derivative[2,1][f][__]->0}

With[{du={δx,δy}},
Expand[(1/2)du.hessian[f,{x,y}].du/.{x->x0,y->y0}]]

with the condition

Thermodynamic Stability

Back to our thermodynamic potentials

Euler’s equation suggests that there are specific values of entropy and volume which minimize the internal energy

Meaning the following form is greater than zero

I.e. the Hessian is positive semi-definite

MatrixForm[
hessian[U,{S,V}]
]

We can use the fundamental thermodynamic relation to simplify this further by identifying

To obtain

MatrixForm[
internalEnergyHessian={{dtds,dtdv},{dtdv,-dpdv}}
]

internalEnergyStability=Reduce[Thread[Eigenvalues[internalEnergyHessian]>0],
{dpdv,dtds},Reals]

In-fact, we’ve already encountered the first condition when we talked about the Van der Waals gas, and specified its bulk modulus has to be positive

Note: We used the isothermal bulk modulus, whereas we now derived a condition on the isentropic bulk modulus