Investigating Real and Ideal gases

Kristina Danielle Closser
California State University-Fresno, Chemistry
Author Profile

This activity was selected for the Teaching Computation in the Sciences Using MATLAB Exemplary Teaching Collection

Resources in this collection a) must have scored Exemplary or Very Good in all five review categories, and must also rate as “Exemplary” in at least three of the five categories. The five categories included in the peer review process are

  • Computational, Quantitative, and Scientific Accuracy
  • Alignment of Learning Goals, Activities, and Assessments
  • Pedagogic Effectiveness
  • Robustness (usability and dependability of all components)
  • Completeness of the ActivitySheet web page

For more information about the peer review process itself, please see

This page first made public: Aug 16, 2018


This activity looks at the difference between real and ideal gas laws, emphasizing the connection of the physical properties to equations and graphs. Students first analyze the real gas equation, which should be familiar from earlier chemistry courses, and make plots of this equation in MATLAB. Then they use the van der Waals equation to describe real gases.

Learning Goals

At the end of the class period, students should be able to
  • Identify assumptions present in ideal gas model and assess how these break down for real gases
  • Connect the equation of state for a real gas to conceptual and graphical models
  • Create 2D graphs using MATLAB (Note: any plotting software can be used)

Context for Use

  • This activity was developed for the first week of an upper division physical chemistry class of ~30 students in groups of 3, where at least one student in the group has a laptop with the necessary software.
  • The course meets for 2 hours twice a week and this activity should occupy most of the the 2 hour block, including a discussion with the whole class.
  • Students are expected to have minimal exposure to MATLAB, but will have seen a demonstration or video on how to generate plots.
  • MATLAB is used to create plots of the equations and allows students to easily adjust parameters to get a better understanding of how the different parameters affect the behavior of the gas. In general any plotting software can be used, but MATLAB is chosen here as it will be used more extensively in other areas of the course.
  • Students are also expected to be familiar with the ideal gas law from previous courses, they should have taken 2 semesters general chemistry, 2 semesters of calculus and 2 semesters of general physics, and in practice have widely varying backgrounds.

Description and Teaching Materials

This activity is designed to be done during a 2 hour class period in class in groups of ~3 students.
Prior to class students should have watched a video on generating plots in MATLAB (e.g.,, then in class I give students a few instructions on using live scripts and what I want to be sure they include in all their figures.

Students then have time to work through the full activity (45 min-1 hr) and this is followed by a full class discussion on the difference between real and ideal gases, with students reporting their conclusions from the worksheet. Emphasis should be placed on connecting the equations to the physical properties of gases.

In the last few minutes of class an assessment is given that asks students to use their knowledge to interpret a different equation of state.

Student Handout

docx: Student Handout for Real and Ideal Gas activity (Microsoft Word 2007 (.docx) 16kB Aug14 18)

pdf: Student Handout for Real and Ideal Gas activity (Acrobat (PDF) 917kB Aug14 18)

Instructor Solutions

docx: Solutions for Real and Ideal Gas activity (Microsoft Word 2007 (.docx) 17kB Aug14 18)

pdf: Solutions for Real and Ideal Gas activity (Acrobat (PDF) 941kB Aug14 18)

mlx: MATLAB plots for Real and Ideal Gas activity (MATLAB Live Script 90kB Aug14 18)

Teaching Notes and Tips

This activity can be done with any software that will generate 2D plots. This will be many students' first use of MATLAB, so creating the plots is likely to be one of the most time-consuming parts of the activity.

Students should be given time to work through the full activity, and any groups that finish early, can repeat the real gas section using a different equation of state (e.g. Clausius: P=nRT/(V-nb)-an^2/[T(V+nc)^2]).


Students turn in one handout per group and the file with the corresponding plots at the end of class.

Also, a brief assessment is given at the end of the class period where students are asked to (individually) apply their knowledge to a new equation of state (Dieterici). This assessment is graded only for participation credit and students should have 5-10 min to complete it.

Assessment for Real and Ideal Gas activity (Microsoft Word 2007 (.docx) 15kB Aug14 18)

Assessment for Real and Ideal Gas activity (Acrobat (PDF) 512kB Aug14 18)

References and Resources