ECT Demo: Modeling Boyle’s Law using Computational Thinking
Demonstration at a glance...
| In this demonstration... |
In this demonstration the teacher describes how computational thinking is used to understand the relationship between pressure and volume in a container of gas as described by Boyle’s Law[1]. Students will begin to see how decomposition, pattern recognition, abstraction and algorithm design can be used to understand natural phenomena. At the end of this demonstration students should be able to describe how velocity affects the position of a particle and how collisions of the molecules in a gas exert pressure on the inside of a container holding a gas and how the size of the container affects the rate of collisions.
Confirm that your computer is on and logged-in | 1 to 3 minutes | |
Confirm that your projector is turned on and is projecting properly | 1 to 3 minutes | |
Confirm required software is installed or install software as described below | 1 to 3 minutes | |
This demo uses VPython. We recommend you use the latest version of VPython (6.x) which requires an older version of Python (2.x). If you have a 64-bit version of Windows you should use a 64-bit version of both Python and VPython. Steps:
And then
| 5 to 10 minutes 5 to 10 minutes | |
Open the ECT Pseudocode Guide | 1 minute |
Part 1: Using Computational Thinking to analyze gas pressure & volume | 10 to 15 minutes |
Part 2: Using pseudocode and VPython to simulate a gas contained in a cube | 20 to 40 minutes |
Notes to the Teacher: Chemistry often involves processes that cannot be observed directly. Computational thinking becomes all the more critical in this field where observations and data must be analyzed for patterns to develop laws and theories. Use the information below to give your students an overview of four Computational Thinking connections and the concepts of Boyle’s Law. |
Computational Thinking Connections: The pressure of a gas in a container results of rate and velocity that particles of the gas collide with the container. For a particular number of particles of gas at a particular temperature, the larger the volume of the container the less likely that gas particles will collide with the sides of the container. Likewise, as the volume of the container decreases, the rate of collisions with the sides of the container increases. In other words, pressure varies as the inverse of the volume. A change in the rate of collisions of particles at a fixed average velocity represents a change in the pressure that the gas produces against the walls. |
Notes to the Teacher: Walk through the following pseudocode example below with your students to show them how algorithmic thinking can help us understand how the motions of molecules in a gas explains the pressure it exerts on its container. |
Computational Thinking Connections: This model is designed to show the relationship between the rate of collisions with the walls of a container and its volume. As the pressure exerted by the gas in the container is based on the rate of collisions students can begin to understand why increasing the volume of the container decreases the pressure of the gas. For simplicity, only one particle is modeled but additional particles could be added as an additional challenge. |
Activity: Pseudocode
This pseudocode can be used with various container sizes to calculate the associated rate of collisions. |
VPython Code
Invoke your VPython environment called VIdle and copy/paste the following code into it:
Run the VPython code using Run → Run Module. The code will produce an animation of a single particle of gas inside a cube with sides equal to the value of length in the VPython code. The larger the size of the cube, the less often the particle collides with the sides of the cube, or, the rate of collisions is inversely proportional to the size of the cube. Output (length = 10 and 20 respectively) |
Learning Objectives | Standards |
LO1: Student should be able to describe how velocity affects the position of a particle. | Core Subject CCSS MATH.HSN.VM.A.3. Solve problems involving velocity and other quantities that can be represented by vectors. Computer Science AUSTRALIA 8.4 (Collecting, managing and analyzing data): Analyse and visualise data using a range of software to create information; and use structured data to model objects or events. CSTA L3A.CT.8: Use modeling and simulation to represent and understand natural phenomena. UK 4.2: Develop and apply their analytic, problem-solving, design, and computational thinking skills. |
LO2: Student should be able to describe how collisions of the molecules in a gas exert pressure on the inside of a container holding a gas and how the size of the container affects the rate of collisions. | Core Subject NGSS PS1.A: Gases and liquids are made of molecules or inert atoms that are moving about relative to each other. In a gas, they are widely spaced except when they happen to collide. Computer Science AUSTRALIA 8.4 (Collecting, managing and analyzing data) |
Term | Definition | For Additional Information |
Volume | A unit of three-dimensional measure of space that comprises a length, a width and a height. It is measured in units of cubic centimeters in metric, cubic inches or cubic feet in English measurement. | |
Pressure | The amount of force that is applied over a given area divided by the size of this area. | |
Position | Coordinates of an object, often expressed as x, y, and/or z. Position is sometimes referred to an displacement to emphasize how far the object has traveled or how far it is from position (0,0) or (0,0.0) | |
Velocity | Rate of change of the position of an object |
Concept | Definition | |
Decomposition | Breaking down data, processes or problems into smaller, manageable parts | |
Pattern Recognition | Observing patterns and regularities in data | |
Abstraction | Identifying and extracting relevant information to define main idea(s) | |
Algorithm Design | Creating an ordered series of instructions for solving similar problems |
Contact info | For more info about Exploring Computational Thinking (ECT), visit the ECT website (g.co/exploringCT) |
Credits | Developed by the Exploring Computational Thinking team at Google and reviewed by K-12 educators from around the world. |
Last updated on | 06/26/2015 |
Copyright info | Except as otherwise noted, the content of this document is licensed under the Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache 2.0 License. |
ECT: Modeling Boyle’s Law using Computational Thinking of
[1] Boyle’s Law states that the pressure of a gas is inversely proportional to volume if the temperature of the gas is held constant. Because the Ideal Gas Law is a composite of gas laws, it can be interpreted in a way that is equivalent to Boyle’s Law. When we consider pV=nRT we can say that if the number of gas molecules and the temperature remain constant, then the pressure is inversely proportional to the volume.