# Using Mathematica to Plot an Isotherm at its Critical Temperature

Hello I'm new to mathematica and I have been trying to plot an isotherm for a substance at its critical temperature, using Van der Waals equation of state. I have done all the work except I do not know why my code is not outputting the graph; it simply outputs the graph with no line in it. Any help is appreciated!

Code:

P = R*T/(v - b) - a/v^2;

Tc = (8 a)/(27 b R);
R = 0.08205;
Tc /. {a -> 5.489, b -> 0.063}
Plot[P[Tc, v, {a -> 5.489, b -> 0.063}], {v, 0, 1}, AxesLabel -> {v(*L/mol*), T(*K*)}]


P is VDW equation, Tc is the critical temperature equation with parameters a and b and I am using the Plot function to graph the isotherm.

The way you have your code set up, your equation for pressure never calls for the value of Tc, instead it tries to use an unknown variable you have called T.

Additionally, if you're looking to plot an isotherm, your y-axis is incorrectly labelled. It should be pressure, not temperature. When plotting, make sure you have your equation's variables defined beforehand, so as to make the code used easier to follow. Here you go:

P = R*Tc/(v - b) - a/v^2;

Tc = (8 a)/(27 b R);
R = 0.08205;
Tc /. {a -> 5.489, b -> 0.063}
Plot[P, {v, 0, 1}, AxesLabel -> {v(*L/mol*), p(*atm*)}]


• Hello thank you for your response! Should this make a plot for sure? I tried it right now but nothing was outputted as well. Oct 9 '16 at 5:13
• Sorry my mistake it worked!!! Thank you so much! Oct 9 '16 at 5:35
• No problem, glad to see it all worked out for you! Oct 9 '16 at 6:30