Phase transitions: phases of matter, PV diagrams, isotherms (ideal gas law & van der Waals), critical temperature, Maxwell’s construction, latent heat (converting ice into steam).
For more related figures, please see the Thermodynamics category.







Edit and compile if you like:
Click to download: phase_transitions.tex • phase_transitions.pdf% Author: Izaak Neutelings (June, 2018)\documentclass[border=3pt,tikz]{standalone}\usepackage{ifthen}\usepackage{siunitx}\usepackage{tikz}\usetikzlibrary{hobby} % for ..\usetikzlibrary{arrows.meta} % to control arrow size\tikzset{>={Latex[length=4,width=4]}} % for LaTeX arrow head\usetikzlibrary{calc,intersections,decorations.markings}\usepackage{siunitx}\usepackage{xcolor} % for colored text\colorlet{mylightblue}{blue!20}\colorlet{myblue}{blue!50!black}\colorlet{mydarkblue}{blue!30!black}\colorlet{mylightred}{red!10}\colorlet{myred}{red!50!black}\colorlet{mydarkred}{red!60!black}\colorlet{mydarkgreen}{green!30!black}%\tikzstyle{midarr}=[decoration={markings,mark=at position 0.5 with {\arrow{stealth}}},postaction={decorate}]\tikzset{midarr/.style={decoration={markings,mark=at position #1 with {\arrow{stealth}}},postaction={decorate}},midarr/.default=0.5}\def\tick#1#2{\draw[thick] (#1) ++ (#2:0.03*\ymax) --++ (#2-180:0.06*\ymax)}\begin{document}% PHASE TRANSITIONS\begin{tikzpicture}[arrow/.style={->,thick,mydarkblue,shorten <=2,shorten >=2},box/.style={thick,rounded corners=4,inner xsep=6,inner ysep=3}]\message{Phase transitions^^J}\node[blue!10!white,draw=mydarkblue,fill=blue!50!gray!80!black,box] (S) at (-2.4,0) {\strut solid};\node[blue!10!white,draw=mydarkblue,fill=blue!80!white,box] (L) at (2.4,0) {\strut liquid};\node[blue!20!black,draw=mydarkblue,fill=blue!20!white,box] (G) at (0,2) {\strut gas};\draw[arrow,->] (S.8) -- (L.173) node[above,midway,scale=0.9] {melt};
Open in Overleaf: phase_transitions.tex
I think there is an error in compiling due to graph 3.
Hey Jet, thank you for the heads up! HTML does not like ‘<', but it should be fixed now. Cheers, Izaak
Hello,
in the heating curve plot, I saw the following:
\coordinate (Ex) at ($(EI-O)$); % x evaporation
\coordinate (Ey) at ($(E-IO)$); % y evaporation
I couldn’t find in the documentation what the EI-O and the E-IO do to the coordinates. Would you be able to explain briefly? I studied the output, but could not make sense of what the question is doing.
Thank you,
J.
Hi,
It is explained in Section 13.3 in the manual, have a look here:
https://tikz.dev/tikz-coordinates#tikz-lib-calc
Maybe it’s more clear from this simple example:
Basically
(R|-O)
projects the(R)
coordinate onto a horizontal line line through(O)
, while(R|-O)
projects(R)
onto a vertical line line through(O)
. I do not think the dollar signs are actually needed in this case (they are syntax for thecalc
library to operate on coordinates, like subtraction, addition, scaling, interpolation, etc.).In the second example, you see that you can also use
|-
and-|
to draw a line with a 90° angle between two coordinates:-|
is “horizontal, then vertical”,|-
is “vertical, then horizontal”.Cheers,
Izaak
Hi everyone,
Could someone assist me with creating a T-V thermodynamic diagram using TikZ? I would like the diagram to include the following elements:
Isocoric Lines (constant volume lines)
Isobaric Lines (constant pressure lines)
Shaded regions to represent the liquid phase, saturated phase, and vapor phase.
I can provide a reference image for clarity if needed.
Thank you for your help!
Best regards,