{"id":21478392,"url":"https://github.com/mathworks-teaching-resources/thermodynamics","last_synced_at":"2025-07-15T11:30:53.074Z","repository":{"id":162256404,"uuid":"618622483","full_name":"MathWorks-Teaching-Resources/Thermodynamics","owner":"MathWorks-Teaching-Resources","description":"This curriculum module contains interactive examples that teach fundamental concepts and basic terminology related to thermodynamics with an emphasis on Mechanical Engineering applications.","archived":false,"fork":false,"pushed_at":"2024-10-28T15:41:36.000Z","size":36939,"stargazers_count":18,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"release","last_synced_at":"2024-10-28T17:41:22.017Z","etag":null,"topics":["courseware","cwm","matlab","mechanical-engineering","model-based-design","refrigerator","simscape","simulink","thermodynamics"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MathWorks-Teaching-Resources.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-24T22:08:43.000Z","updated_at":"2024-10-28T15:41:40.000Z","dependencies_parsed_at":"2023-06-02T14:45:21.471Z","dependency_job_id":"3e1ae6c5-4dc7-4b8f-adc4-b57242c1d0ec","html_url":"https://github.com/MathWorks-Teaching-Resources/Thermodynamics","commit_stats":{"total_commits":52,"total_committers":3,"mean_commits":"17.333333333333332","dds":"0.28846153846153844","last_synced_commit":"c107a43f10bff18875566e25983f13bd40424bf7"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathWorks-Teaching-Resources%2FThermodynamics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathWorks-Teaching-Resources%2FThermodynamics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathWorks-Teaching-Resources%2FThermodynamics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathWorks-Teaching-Resources%2FThermodynamics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MathWorks-Teaching-Resources","download_url":"https://codeload.github.com/MathWorks-Teaching-Resources/Thermodynamics/tar.gz/refs/heads/release","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226033456,"owners_count":17563168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["courseware","cwm","matlab","mechanical-engineering","model-based-design","refrigerator","simscape","simulink","thermodynamics"],"created_at":"2024-11-23T11:18:00.690Z","updated_at":"2024-11-23T11:18:01.585Z","avatar_url":"https://github.com/MathWorks-Teaching-Resources.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# \u003cspan style=\"color:rgb(213,80,0)\"\u003eThermodynamics\u003c/span\u003e\n\n\n[![View on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/126784-thermodynamics) or [![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=README.mlx)\n\n[![MATLAB Versions Tested](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2FMathWorks-Teaching-Resources%2FThermodynamics%2Frelease%2FImages%2FTestedWith.json)](https://MathWorks-Teaching-Resources.github.io/Thermodynamics)\n\n**Curriculum Module**\n\n_Created with R2024a. Compatible with R2024a and later releases._\n\n# Information\n\nThis curriculum module contains interactive [MATLAB® live scripts](https://www.mathworks.com/products/matlab/live-editor.html) that teach fundamental concepts and basic terminology related to introductory thermodynamics. Topics addressed include units, the first and second laws of thermodynamics, state variables, work, and the components of a refrigeration cycle. \n\n## Background\n\nYou can use these live scripts as demonstrations in lectures, class activities, or interactive assignments outside class. This module consists of several interactive live scripts intended to introduce or deepen student understanding of thermodynamic concepts, including working with data tables and reading thermodynamic plots. Two additional scripts are included for instructors or students who want to go beyond the included material by installing CoolProp or building their own refrigerator model. \n\n\nThe instructions inside the live scripts will guide you through the exercises and activities. Get started with each live script by running it one section at a time. To stop running the script or a section midway (for example, when an animation is in progress), use the \u003cimg src=\"Images/EndIcon.png\" width=\"19\" alt=\"EndIcon.png\"\u003e Stop button in the **RUN** section of the **Live Editor** tab in the MATLAB Toolstrip.\n\n\nSolutions are available upon instructor request. Contact the [MathWorks online teaching team](mailto:%20onlineteaching@mathworks.com) if you would like to request solutions or have a question.\n\n## Related Courseware Modules\n-  [**Calculus: Integrals** ](https://www.mathworks.com/matlabcentral/fileexchange/105740-calculus-integrals)is available on [\u003cimg src=\"Images/OpenInFX.png\" width=\"91\" alt=\"OpenInFX.png\"\u003e](https://www.mathworks.com/matlabcentral/fileexchange/105740-calculus-integrals) or [\u003cimg src=\"Images/OpenInMO.png\" width=\"136\" alt=\"OpenInMO.png\"\u003e](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Calculus-Integrals\u0026project=Integrals.prj\u0026file=README.mlx) or [GitHub](https://github.com/MathWorks-Teaching-Resources/Calculus-Integrals)  \n## Prerequisites\n\nThese scripts assume background knowledge of common thermodynamic terminology covered in secondary education, such as temperature, pressure, kinetic energy, and potential energy. Some scripts also require fluency with basic integral calculus. There is minimal MATLAB knowledge required for FirstLaw, SecondLaw and StatePlots, but you could use [MATLAB Onramp](https://matlabacademy.mathworks.com/details/matlab-onramp/gettingstarted) as a resource to acquire familiarity with live scripts and MATLAB syntax. More familiarity with MATLAB is required for CreatePVplots, CalculateWork, and Model\\_Fridge, as those are designed in Code Visible format. Familiarity with Simulink at the level of [Simulink Onramp](https://matlabacademy.mathworks.com/details/simulink-onramp/simulink) may be helpful for Model\\_Fridge as well.\n\n\nFor those interested in additional coding, SetUpCoolProp includes instructions for installing and accessing CoolProp. BuildRefrigerator walks through a project to build a refrigerator model in Simulink out of standard component blocks. BuildRefrigerator requires [Simulink Onramp](https://matlabacademy.mathworks.com/details/simulink-onramp/simulink), at a minimum. If possible, [Simscape Onramp](https://matlabacademy.mathworks.com/details/simscape-onramp/simscape) would be helpful as well. Students are expected to find and insert specified blocks, connect blocks, edit block parameters, rename blocks, copy and paste subsystems, run simulations, and explore the output.\n\n## Getting Started\n\n**On MATLAB Online:**\n\n\nUse the [\u003cimg src=\"Images/OpenInMO.png\" width=\"136\" alt=\"OpenInMO.png\"\u003e](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=README.mlx) link to download the module. You will be prompted to log in or create a MathWorks account. The project will be loaded, and you will see README.mlx laying out the contents of the repository.\n\n\n**On Desktop:**\n\n\nEnsure you have all the required products (listed below) installed. If you need to include a product, add it using the Add\\-On Explorer. To install an add\\-on, go to the **Home** tab and select  \u003cimg src=\"Images/AddOnsIcon.png\" width=\"16\" alt=\"AddOnsIcon.png\"\u003e **Add-Ons** \u003e **Get Add-Ons**. Then open Thermodynamics.prj to set up the project. The project will be loaded, and you will see README.mlx laying out the contents of the repository.\n\n\n**Working through the module:**\n\n\nGet started with each topic by clicking the link to open the live script. The instructions inside each live script will walk you through the live script and related functions.\n\n## Products\n\nMATLAB®, Simscape™, Simulink®, Simulink® Real\\-Time™, Stateflow®, Symbolic Math Toolbox™, Image Processing Toolbox™\n\n\nMATLAB and Symbolic Math Toolbox are used throughout. Simulink and Simscape are used in \u003csamp\u003eModel_Fridge.mlx\u003c/samp\u003e and \u003csamp\u003eBuildRefrigerator.mlx\u003c/samp\u003e. Image Processing Toolbox is used in \u003csamp\u003eModel_Fridge.mlx\u003c/samp\u003e. Tools from Simulink, Simulink Real\\-Time, and Stateflow are used in \u003csamp\u003eCalculateWork.mlx\u003c/samp\u003e.\n\n# Scripts\n|      |      |      |      |\n| :-- | :-- | :-- | :-- |\n| **Topic** \u003cbr\u003e  | **Summary** \u003cbr\u003e  | **Learning Objectives** \u003cbr\u003e In this script, students will... \u003cbr\u003e  | **Mode** \u003cbr\u003e   |\n|  **First Law of Thermodynamics** in  \u003cbr\u003e [**FirstLaw.mlx** ](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/FirstLaw.mlx) \u003cbr\u003e [\u003cimg src=\"Images/Kheops-Pyramid.jpg\" width=\"201\" alt=\"Kheops-Pyramid.jpg\"\u003e](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/FirstLaw.mlx) \u003cbr\u003e Photo credit: [Nina Aldin Thune](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/FirstLaw.mlx) \u003cbr\u003e  | This script introduces the first law of thermodynamics, focusing on units, energy, systems, and conservation laws. \u003cbr\u003e  | \\* Express various forms of energy in terms of fundamental units \u003cbr\u003e \\* Apply the conservation of mass in simple, conceptual situations \u003cbr\u003e \\* Identify systems with open and closed control volumes \u003cbr\u003e \\* Apply the first law of thermodynamics \u003cbr\u003e  | Code Hidden \u003cbr\u003e   |\n|  **Standard Thermodynamics Language** in [**CreatePVplots.mlx**](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/CreatePVplots.mlx)  \u003cbr\u003e [\u003cimg src=\"Images/isothermalPVplot.png\" width=\"201\" alt=\"isothermalPVplot.png\"\u003e](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/CreatePVplots.mlx) \u003cbr\u003e  | This script investigates pressure\\-volume (PV) diagrams and their relationship to state equations in a closed system. \u003cbr\u003e  | \\* Identify keywords including isothermal, isobaric, and isochoric, and translate word problems into thermodynamic terminology \u003cbr\u003e \\* Identify and state necessary assumptions to express a thermodynamic relationship \u003cbr\u003e  | Code Visible \u003cbr\u003e   |\n| **Calculate Work from P\\-V plots** in [**CalculateWork.mlx**](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/CalculateWork.mlx)  \u003cbr\u003e [\u003cimg src=\"Images/image_7.png\" width=\"201\" alt=\"image_7.png\"\u003e](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/CalculateWork.mlx) \u003cbr\u003e  | This script introduces computing the work done by a system using analysis of its PV plot. \u003cbr\u003e  | \\* Identify positive, negative, and zero work from a P\\-V plot without computing the value \u003cbr\u003e \\* Compute work in constant pressure, constant volume, and integrable P\\-V plots \u003cbr\u003e \\* Compare various state equations both to each other and to tabular data \u003cbr\u003e \\* Compute the work done by a piston modeled in Simulink \u003cbr\u003e  | Code Visible \u003cbr\u003e   |\n|  **Second Law of Thermodynamics** in [**SecondLaw.mlx**](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/SecondLaw.mlx)  \u003cbr\u003e [\u003cimg src=\"Images/pistonAdiabatic.gif\" width=\"201\" alt=\"pistonAdiabatic.gif\"\u003e](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/SecondLaw.mlx) \u003cbr\u003e  |  | \\* Identify thermal sources, sinks, and reservoirs \u003cbr\u003e \\* Compute thermal efficiency \u003cbr\u003e \\* Reflect on the second law of thermodynamics \u003cbr\u003e \\* Use the universe as a system of reference for determining thermodynamic flows \u003cbr\u003e  | Code Hidden \u003cbr\u003e   |\n|  **Properties of Pure Substances** in [**StatePlots.mlx**](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/StatePlots.mlx)  \u003cbr\u003e [\u003cimg src=\"Images/TS_water.png\" width=\"201\" alt=\"TS_water.png\"\u003e](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/StatePlots.mlx) \u003cbr\u003e  | This script introduces state diagrams and temperature\\-entropy plots. \u003cbr\u003e  | \\* Investigate the standard shapes of state diagrams \u003cbr\u003e \\* Investigate Temperature/Entropy plots for several pure substances, including water, R134a, and ammonia \u003cbr\u003e \\* Identify liquid, gas, two\\-phase, and supercritical states of matter on a temperature\\-entropy plot \u003cbr\u003e  | Code Hidden \u003cbr\u003e   |\n| **Explore a Refrigeration Mode**l in [**Model\\_Fridge.mlx**](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/Model_Fridge.mlx) \u003cbr\u003e [\u003cimg src=\"Images/FridgeModelwithSensors.png\" width=\"201\" alt=\"FridgeModelwithSensors.png\"\u003e](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/Model_Fridge.mlx) \u003cbr\u003e  | This project applies the thermodynamic concepts to an everyday example using a Simulink model. \u003cbr\u003e  | \\* Apply understanding about thermodynamic cycles to model a refrigerator \u003cbr\u003e \\* Perform unit conversions required to extract values from a database and use them in a model \u003cbr\u003e \\* Read and interpret thermodynamic plots \u003cbr\u003e \\* Create informative plots based on thermodynamic sensor data \u003cbr\u003e  | Code Visible \u003cbr\u003e   |\n|      |      |      |       |\n\n# Additional Scripts:\n|      |      |      |\n| :-- | :-- | :-- |\n| **Script** \u003cbr\u003e  | [**SetUpCoolProp.mlx**](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/SetUpCoolProp.mlx) \u003cbr\u003e  | [**BuildRefrigerator.mlx**](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Thermodynamics\u0026project=Thermodynamics.prj\u0026file=Scripts/BuildRefrigerator.mlx)  \u003cbr\u003e   |\n| **Description** \u003cbr\u003e  | A guide to installing and testing the functionality CoolProp from MATLAB. \u003cbr\u003e  | Using Simulink and the capabilities of the Simscape Two\\-Phase Fluid libraries, build and test a complete refrigerator. \u003cbr\u003e   |\n|      |      |       |\n\n# \u003cu\u003eIf you have questions:\u003c/u\u003e\n\nSolutions are available upon instructor request. Contact the [MathWorks online teaching team](mailto:%20onlineteaching@mathworks.com) if you would like to request solutions or have a question.\n\n\nCopyright 2023 The MathWorks, Inc.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathworks-teaching-resources%2Fthermodynamics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathworks-teaching-resources%2Fthermodynamics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathworks-teaching-resources%2Fthermodynamics/lists"}