home

Thermodynamic Potentials Venn Diagram

A Venn diagram illustrating the relationships between thermodynamic potentials, forces, and flows. The diagram shows three main regions (Mechanical, Thermal, Chemical) and their intersections, representing different thermodynamic potentials. The subscript μ denotes an N-to-μ Legendre transform of the indicated potential (U, H, F, or G). The diagram helps visualize how different thermodynamic quantities are related through Legendre transforms.


Thermodynamic Potentials Venn Diagram

Download

PNG PDF SVG

Code

thermodynamic-potentials-venn-diagram.typ (106 lines)

#import "@preview/cetz:0.5.2": canvas, draw
#import draw: arc-through, circle, content, merge-path, rect, rotate, scale, scope

#set page(width: auto, height: auto, margin: 8pt, fill: none)
#set text(size: 12pt)

#canvas({
  // Scale up the diagram
  scale(4)

  let mechanical-center = (-0.65, 0.375)
  let thermal-center = (0.65, 0.375)
  let chemical-center = (0, -0.75)

  let ab-outer = (0, 1.135)
  let ab-inner = (0, -0.385)
  let ac-outer = (-0.983, -0.568)
  let ac-inner = (0.334, 0.193)
  let bc-inner = (-0.334, 0.193)

  let fills = (
    a: blue.transparentize(40%), // Mechanical (blue)
    b: red.transparentize(40%), // Thermal (red)
    c: green.transparentize(40%), // Chemical (green)
    ab: purple.transparentize(40%), // Overlap
    bc: yellow.transparentize(40%), // Overlap
    ac: teal.transparentize(40%), // Overlap
    abc: gray.transparentize(70%), // Center
  )

  rect((-1.95, 1.95), (1.95, -1.95), fill: none, stroke: auto)

  for (region, angle) in (("ab", 0deg), ("ac", 120deg), ("bc", 240deg)) {
    scope({
      rotate(angle)
      merge-path(
        {
          arc-through(bc-inner, (rel: (-1, 0), to: thermal-center), ab-outer)
          arc-through((), (rel: (+1, 0), to: mechanical-center), ac-inner)
          arc-through((), (rel: (0, +1), to: chemical-center), bc-inner)
        },
        fill: fills.at(region),
        stroke: none,
        close: true,
      )
    })
  }

  merge-path(
    {
      arc-through(
        ab-inner,
        (rel: (0.866, -0.5), to: mechanical-center),
        ac-inner,
      )
      arc-through((), (rel: (0, 1), to: chemical-center), bc-inner)
      arc-through((), (rel: (-0.866, -0.5), to: thermal-center), ab-inner)
    },
    fill: fills.abc,
    stroke: auto,
    close: true,
  )

  for (region, angle) in (("a", 0deg), ("c", 120deg), ("b", 240deg)) {
    scope({
      rotate(angle)
      merge-path(
        {
          arc-through(ab-outer, (rel: (-1, 0), to: mechanical-center), ac-outer)
          arc-through((), (rel: (-0.5, 0.866), to: chemical-center), bc-inner)
          arc-through((), (rel: (-1, 0), to: thermal-center), ab-outer)
        },
        fill: fills.at(region),
        stroke: auto,
        close: true,
      )
    })
  }

  for spec in (
    (
      pos: (-0.992, 0.573),
      body: [#text(size: 16pt)[Mechanical]\ $F_[mu] = -P V$],
      args: (anchor: "center"),
    ),
    (pos: (-0.95, 0.28), body: text(size: 14pt)[(Grand potential)], args: (anchor: "center")),
    (
      pos: (0.992, 0.573),
      body: [#text(size: 16pt)[Thermal]\ $H_[mu] = T S$],
      args: (anchor: "center"),
    ),
    (pos: (0, -1.146), body: [#text(size: 16pt)[Chemical]\ $G = mu N$], args: (anchor: "center")),
    (pos: (0, 0.523), body: align(center, $U_[mu] =\ T S - P V$), args: (anchor: "center")),
    (pos: (0, 0), body: text(12pt, align(center, $U = T S -\ P V + mu N$)), args: (:)),
    (pos: (-0.496, -0.336), body: align(center, $F =\ -P V + mu N$), args: (anchor: "center")),
    (pos: (0.496, -0.336), body: align(center, $H =\ T S + mu N$), args: (anchor: "center")),
    (pos: (0, 1.6), body: $G_[mu]$, args: (:)),
    (pos: (0, 1.4), body: text(size: 14pt)[(Gibbs-Duhem)], args: (:)),
  ) { content(spec.pos, spec.body, ..spec.args) }
  circle((0, 0), radius: 1.75, fill: rgb(70%, 70%, 90%, 20%), stroke: rgb(
    0%,
    0%,
    0%,
  ))
})