{"id":25613081,"url":"https://github.com/mathworks-teaching-resources/electricity-magnetism","last_synced_at":"2026-06-19T04:31:26.898Z","repository":{"id":278626173,"uuid":"936224584","full_name":"MathWorks-Teaching-Resources/Electricity-Magnetism","owner":"MathWorks-Teaching-Resources","description":"Interactive courseware enhancing the learning of electricity and magnetism, focusing on capacitors and DC motors with examples and visuals.","archived":false,"fork":false,"pushed_at":"2025-02-20T19:23:34.000Z","size":2231,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"release","last_synced_at":"2025-02-20T20:21:36.591Z","etag":null,"topics":["courseware","cwm","electricity","engineering","matlab","simscape"],"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":"CONTRIBUTING.md","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":"2025-02-20T18:19:43.000Z","updated_at":"2025-02-20T19:40:24.000Z","dependencies_parsed_at":"2025-02-20T20:21:41.385Z","dependency_job_id":"646123a6-6ecd-4927-ba4a-87384123e8dd","html_url":"https://github.com/MathWorks-Teaching-Resources/Electricity-Magnetism","commit_stats":null,"previous_names":["mathworks-teaching-resources/electricity-magnetism"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathWorks-Teaching-Resources%2FElectricity-Magnetism","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathWorks-Teaching-Resources%2FElectricity-Magnetism/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathWorks-Teaching-Resources%2FElectricity-Magnetism/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathWorks-Teaching-Resources%2FElectricity-Magnetism/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MathWorks-Teaching-Resources","download_url":"https://codeload.github.com/MathWorks-Teaching-Resources/Electricity-Magnetism/tar.gz/refs/heads/release","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240111263,"owners_count":19749453,"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","electricity","engineering","matlab","simscape"],"created_at":"2025-02-22T01:22:24.698Z","updated_at":"2026-06-19T04:31:26.892Z","avatar_url":"https://github.com/MathWorks-Teaching-Resources.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ca id=\"T_DEF03274\"\u003e\u003c/a\u003e\n\n# \u003cspan style=\"color:rgb(213,80,0)\"\u003eElectricity \u0026 Magnetism: Introduction\u003c/span\u003e\n\u003ca id=\"H_053613DF\"\u003e\u003c/a\u003e\n\n\n[![View on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/180193-electricity-magnetism-introduction) 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/Electricity-Magnetism\u0026project=emag.prj\u0026file=README.mlx)\n\n[![MATLAB Versions Tested](https://img.shields.io/endpoint?url=https://mathworks-teaching-resources.github.io/Electricity-Magnetism/TestedWith.json)](https://MathWorks-Teaching-Resources.github.io/Electricity-Magnetism)\n\n**Curriculum Module**\n\n_Created with R2024b. Compatible with R2024b 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 provides supplementary examples and visualizations to enhance understanding of electricity and magnetism principles, specifically focusing on common application like capacitors and DC motors.\n\n\u003ca id=\"H_F00D98E4\"\u003e\u003c/a\u003e\n\n## Background\n\nThis initial release of the Electricity \u0026 Magnetism courseware features two interactive scripts that explore the principles of how capacitors function, based on the laws of electrostatics.\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/image_0.png\" width=\"19\" alt=\"image_0.png\"\u003e Stop button in the **RUN** section of the **Live Editor** tab in the MATLAB Toolstrip.\n\n## Contact Us\n\nSolutions are available upon instructor request. Contact the [MathWorks Educator Content Development Team](mailto:onlineteaching@mathworks.com) if you would like to provide feedback, or if you have a question.\n\n\u003ca id=\"H_30BC7141\"\u003e\u003c/a\u003e\n\n## Prerequisites\n\nThis module assumes knowledge of basic calculus and introductory physics, including mechanics and fundamental concepts of electricity and magnetism.\n\n\u003ca id=\"H_330E72C3\"\u003e\u003c/a\u003e\n\n## Getting Started\n### Accessing the Module\n### **On MATLAB Online:**\n\nUse the [\u003cimg src=\"Images/image_1.png\" width=\"136\" alt=\"image_1.png\"\u003e](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/emag\u0026project=emag.prj) 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 an app with several navigation options to get you started.\n\n### **On Desktop:**\n\nDownload or clone this repository. Open MATLAB, navigate to the folder containing these scripts and double\\-click on [emag.prj](\u003cmatlab: openProject(\"emag.prj\")\u003e). It will add the appropriate files to your MATLAB path and open an app that asks you where you would like to start. \n\n\nEnsure you have all the required products ([listed below](#H_E850B4FF)) 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/image_2.png\" width=\"16\" alt=\"image_2.png\"\u003e **Add-Ons** \u003e **Get Add-Ons**. \n\n\u003ca id=\"H_E850B4FF\"\u003e\u003c/a\u003e\n\n## Products\n\nMATLAB® is used throughout the module along with the following products:\n\n\nSimulink®\n\n\nSymbolic Math Toolbox™\n\n\nSimscape™\n\n\nPartial Differential Equation Toolbox™\n\n\u003ca id=\"H_E8C62B23\"\u003e\u003c/a\u003e\n\n# Scripts\n\n**Capacitors series**\n\n|||\n| :-- | :-- |\n| \u003cimg src=\"Images/image_3.svg\" width=\"171\" alt=\"image_3.svg\"\u003e \u003cbr\u003e  | [**CapacitorsFundamental.mlx**](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Electricity-Magnetism\u0026project=emag.prj\u0026file=Scripts/CapacitorsFundamentals.mlx) \u003cbr\u003e **In this script, students will...** \u003cbr\u003e $\\bullet$ Explore the fundamental principles and applications of capacitors in electrical circuits. \u003cbr\u003e $\\bullet$ Analyze the relationship between capacitors and electric fields, including their role in storing and releasing electrical energy. \u003cbr\u003e   |\n| \u003cimg src=\"Images/image_4.png\" width=\"171\" alt=\"image_4.png\"\u003e \u003cbr\u003e  | [**CapacitorsChargeDischarge.mlx**](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Electricity-Magnetism\u0026project=emag.prj\u0026file=Scripts/CapacitorsChargeDischarge.mlx) \u003cbr\u003e **In this script, students will...** \u003cbr\u003e $\\bullet$ Analyze energy storage in capacitors and evaluate its applications in circuits. \u003cbr\u003e $\\bullet$ Simulate the charge and discharge of capacitors to demonstrate their role. \u003cbr\u003e   |\n\n\u003ca id=\"H_37d7\"\u003e\u003c/a\u003e\n\n## [**ElectricFieldAndCharge.mlx**](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Electricity-Magnetism\u0026project=emag.prj\u0026file=Scripts/ElectricFieldAndCharge.mlx)\n|||\n| :-: | :-- |\n| \u003cimg src=\"Images/image_5.png\" width=\"171\" alt=\"image_5.png\"\u003e \u003cbr\u003e  | **In this script, students will...** \u003cbr\u003e $\\bullet$ Analyze the relationship between electric charges and electric fields. \u003cbr\u003e $\\bullet$ Compute the electric field due to point charges and continuous charge distributions. \u003cbr\u003e $\\bullet$ Visualize Coulomb force and electric fields. \u003cbr\u003e   |\n\n\u003ca id=\"TMP_9182\"\u003e\u003c/a\u003e\n\n## [**VisualizeField.mlx**](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Electricity-Magnetism\u0026project=emag.prj\u0026file=Scripts/VisualizeField.mlx)\n|||\n| :-- | :-- |\n| \u003cimg src=\"Images/image_6.png\" width=\"171\" alt=\"image_6.png\"\u003e \u003cbr\u003e  | **In this script, students will...** \u003cbr\u003e $\\bullet$ Learn how to visualize a field in two dimensions. \u003cbr\u003e $\\bullet$ Visualize their own electric field. \u003cbr\u003e   |\n\n\u003ca id=\"H_3e1e\"\u003e\u003c/a\u003e\n\n## [**GaussLawDoc.mlx**](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Electricity-Magnetism\u0026project=emag.prj\u0026file=Scripts/GaussLawDoc.mlx)\n|||\n| :-- | :-- |\n| \u003cimg src=\"Images/image_7.png\" width=\"171\" alt=\"image_7.png\"\u003e \u003cbr\u003e  | **In this script, students will...** \u003cbr\u003e $\\bullet$ Analyze charge distribution to identify symmetry. \u003cbr\u003e $\\bullet$ Learn to select an appropriate Gaussian surface with respect to the charge distribution. \u003cbr\u003e $\\bullet$ Compute electric field for various charge configurations using Gauss's Law. \u003cbr\u003e   |\n\n\u003ca id=\"H_5252\"\u003e\u003c/a\u003e\n\n## [**MagneticFieldAndCurrent.mlx**](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Electricity-Magnetism\u0026project=emag.prj\u0026file=Scripts/MagneticFieldAndCurrent.mlx)\n|||\n| :-- | :-- |\n|\u003cimg src=\"Images/MagneticFieldAndCurrent.png\" width=\"170\" alt=\"image_8.svg\"\u003e        \u003cbr\u003e  | **In this script, students will...** \u003cbr\u003e $\\bullet$ Describe how electric currents generate magnetic fields. \u003cbr\u003e $\\bullet$ Apply the Biot\\-Savart law and Ampère's law to calculate magnetic fields. \u003cbr\u003e $\\bullet$ Illustrate magnetic field lines around current\\-carrying conductors. \u003cbr\u003e   |\n\n\u003ca id=\"H_76d7\"\u003e\u003c/a\u003e\n\n## **MagneticDipole.mlx (planned)**\n|||\n| :-- | :-- |\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"Images/image_10.svg\" width=\"40\" alt=\"image_9.svg\"\u003e        \u003cbr\u003e  | **In this script, students will...** \u003cbr\u003e $\\bullet$ Explain the concept of magnetic dipole and its properties. \u003cbr\u003e $\\bullet$ Evaluate the interaction of magnetic dipoles with external magnetic fields. \u003cbr\u003e $\\bullet$ Determine the torque and potential energy of magnetic dipoles in various field configurations. \u003cbr\u003e   |\n\n\u003ca id=\"H_5c7e\"\u003e\u003c/a\u003e\n\n## **MagneticApplication.mlx (planned)**\n|||\n| :-- | :-- |\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cimg src=\"Images/image_10.svg\" width=\"40\" alt=\"image_10.svg\"\u003e        \u003cbr\u003e  | **In this script, students will...** \u003cbr\u003e $\\bullet$ Explain the basic principles of DC motor operation and the role of electromagnetic force. \u003cbr\u003e $\\bullet$ Examine the relationship between current, magnetic field, and torque in a DC motor. \u003cbr\u003e $\\bullet$ Model the performance and efficiency of DC motors. \u003cbr\u003e   |\n\n\u003ca id=\"H_F61733D7\"\u003e\u003c/a\u003e\n\n# License\n\nThe license for this module is available in the [LICENSE.md](https://github.com/MathWorks-Teaching-Resources/Electricity-Magnetism/blob/release/LICENSE.md).\n\n# Related Courseware Modules\n\u003ca id=\"H_868F5748\"\u003e\u003c/a\u003e\n\n## [DC Circuit Analysis](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/DC-Circuit-Analysis\u0026project=DCCircuitAnalysis.prj\u0026file=README.mlx)\n|||\n| :-- | :-- |\n| \u003cimg src=\"Images/image_11.png\" width=\"171\" alt=\"image_11.png\"\u003e \u003cbr\u003e  | **Available on:** \u003cbr\u003e [\u003cimg src=\"Images/image_12.png\" width=\"91\" alt=\"image_12.png\"\u003e](https://www.mathworks.com/matlabcentral/fileexchange/103375-dc-circuit-analysis) \u003cbr\u003e [\u003cimg src=\"Images/image_13.png\" width=\"136\" alt=\"image_13.png\"\u003e](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/DC-Circuit-Analysis\u0026project=DCCircuitAnalysis.prj\u0026file=README.mlx) \u003cbr\u003e [GitHub](https://github.com/MathWorks-Teaching-Resources/DC-Circuit-Analysis) \u003cbr\u003e   |\n\n\u003ca id=\"H_868F5748\"\u003e\u003c/a\u003e\n\n## [Virtual Measurement of Electron charge\\-to\\-mass ratio lab](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Virtual-Measurement-of-the-Electron-Charge-To-Mass-Ratio-Lab\u0026project=virtual-measurement-of-the-electron-charge-to-m.prj\u0026file=README.mlx)\n|||\n| :-- | :-- |\n| \u003cimg src=\"Images/image_14.png\" width=\"171\" alt=\"image_14.png\"\u003e \u003cbr\u003e  | **Available on:** \u003cbr\u003e [\u003cimg src=\"Images/image_15.png\" width=\"91\" alt=\"image_15.png\"\u003e](https://www.mathworks.com/matlabcentral/fileexchange/94540-virtual-measurement-of-e-m-lab) \u003cbr\u003e [\u003cimg src=\"Images/image_16.png\" width=\"136\" alt=\"image_16.png\"\u003e](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Virtual-Measurement-of-the-Electron-Charge-To-Mass-Ratio-Lab\u0026project=virtual-measurement-of-the-electron-charge-to-m.prj\u0026file=README.mlx) \u003cbr\u003e [GitHub](https://github.com/MathWorks-Teaching-Resources/Virtual-Measurement-of-the-Electron-Charge-To-Mass-Ratio-Lab) \u003cbr\u003e   |\n\n\nOr feel free to explore our other [modular courseware content](https://www.mathworks.com/matlabcentral/fileexchange/?q=tag%3A%22courseware+module%22\u0026sort=downloads_desc_30d).\n\n# Educator Resources\n-  [Educator Page](https://www.mathworks.com/academia/educators.html) \n\u003ca id=\"H_0FA5DA18\"\u003e\u003c/a\u003e\n\n# Contribute \n\nLooking for more? Find an issue? Have a suggestion? Please contact the [MathWorks Educator Content Development Team](mailto:%20onlineteaching@mathworks.com). If you want to contribute directly to this project, you can find information about how to do so in the [CONTRIBUTING.md](https://github.com/MathWorks-Teaching-Resources/Electricity-Magnetism/blob/release/CONTRIBUTING.md)  page on GitHub.\n\n\n *©* Copyright 2025 The MathWorks, Inc\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathworks-teaching-resources%2Felectricity-magnetism","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathworks-teaching-resources%2Felectricity-magnetism","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathworks-teaching-resources%2Felectricity-magnetism/lists"}