Mathematical methods in statistical mechanics
Review of previous lecture: practice on your own
1. What is the probability of obtaining a royal flush in poker?
The number of ways to get a royal flush in one suit is just 1. Thus, the numerator is 4 because there are four suits in the deck.
2. What is the probability of rolling a 1 on the first roll or a 4 on the second roll? Hint: use
Assuming a fair die, we have
Multivariable calculus
Extrema
We need to know how to evaluate changes in functions of multiple variables: how temperature, pressure, and volume change with respect to one another; how metabolites affect the permeability, volume, and particle number within a cell; etc.
For functions of a single variable, we already know how to find extrema. If you have a function , you can find the extremum by setting the derivative to zero:
(Draw this, see if it makes sense!)
For multiple variables, we just have more conditions. All the partials must be set to zero. If we want to find the extremum of , we have to find all the partials:
and set them equal to zero. We find that the minimum is . This is shown graphically below.
Let’s do a more challenging example.
Example: Take all the first and second partials of the ideal gas
The equation of state (we’ll define this carefully in a later lecture) for a gas of non-interacting particles is given by:
We’ll be more rigorous in our definitions of equation of state in the upcoming lectures but, for now, it’s just an equation that defines the pressure of a gas as a funtion of and
I won’t go through all the second partials. Let’s just look at two:
Notice that the two second partials are the same. We’ll see the implications of this in a moment. First, we need to define something called a “differential”.
Exact and inexact differentials
Let’s recall the chain rule. If I have a function where , then
This is trivially (heh) extended to multiple variables
Now do something very, very dangerous. Erase all the ’s.
This is a “differential.” It tells us how small perturbations to and produce perturbations in .
Definition: a differential is exact if is path independent
In order to determine exactness, check that the mixed partials are equal:
We’re going to see how powerful that is when we study thermodynamic state functions. Looking back to our ideal gas example, we can already see that is an exact differential, meaning that is independent of the path taken. We can take all kinds of strange paths to get from one pressure to another, but it doesn’t matter, only depends on the start and end points.
Extrema: subject to constraints
Let’s go back to the parabaloid . When and are unconstrained, we find a minimum at . But suppose we require that our answer lie on a plane defined by .
There are three options at this point for doing our optimization:
1) Plug in or into the equation for and turn everything into a single variable problem.
2) Take the differentials of and and set them equal to zero.
3) Use Lagrange multipliers.
In this case, the easiest thing to do may be the first option. However, as we get to more complicated systems, we’ll need option 3.
Lagrange multipliers
Define a new function . This function is called a “Lagrangian,” and is a Lagrange multiplier. is our constraint equation ( in the last example).
It’s not a trivial thing to understand it intuitively (I would encourage those of you who are comfortable with the rest of the material to give it a shot).
- If you want a graphical interpretation, consult the Khan Academy.
- If you want a really classic but also somewhat weird interactive explanation consult Wolfram
- We can talk about the milkmaid problem in class if people are into it (that’s essentially the Wolfram demo).
Otherwise, just trust me when I say this function is useful. The critically important point here is that minimizing the Lagrangian accomplishes the constrained optimization problem.
Let’s make use of total differentials.
All that mess on the right hand side needs to be zero in order for the point to be a minimum. The whole expression reduces to a system of equations in which the ’s are treated independently. Why are they independent? Click here to get a more advanced description.
Example: subject to the constraint .
Take the differential:
Gather up the terms and set to zero. Do the same for terms.
Solving for , then
Right now, we don’t care about . We eliminate it and find that . Soon, we’ll care a bit about
Practice on your own
-
Exact differentials. Is the following expression an “equation of state” (path independent)?
Bonus: what kind of system does this equation describe?
-
Lagrange multipliers. Challenging! Find the distribution such that
- The quantity is at a maximum.
- The mean of is given by
- The variance of is given by
If you get stumped, just set up the problem and don’t solve it all the way.
Hint: the correct distribution should be SUPER familiar!
Lagrangian deets.
What we’re ACTUALLY doing in a lagrange multiplier problem is solving THIS:
We take the divergence here because the geometric interpretation of constrained optimization shows that, at the minimum, and are the same (to within some multiplicative factor ).