MATLAB and Simulink Examples in Physics Courses
From the series: Online Teaching with MATLAB and Simulink
Michele McColgan, Siena College, Department of Physics & Astronomy
Michele McColgan, associate professor of physics at Siena College, shows how to add simple introductory activities and autograded assessments using MATLAB® and Simulink® to homework, quizzes, and exams in general and upper-level physics courses. Academic concepts in these courses include electricity and magnetism, electronics, thermal physics, and optics.
Applications of tools provided by MathWorks—as part of the Campus-Wide License available to Siena College—and used in this project include:
- MATLAB Grader™ for introducing computational thinking and automated assessment of 50 problems on circuit concepts
- MATLAB live scripts to learn the MATLAB environment for solving problems
- Simulink for designing circuit models, predicting behavior, and troubleshooting problems
This how-to video was first presented January 28, 2021, as part of the PICUP Spring Webinar Series: Computation in Undergrad Physics with an Emphasis on Using MATLAB.
So I'm Michele McColgan, and I'm a faculty member in physics and astronomy at a small liberal arts college in upstate New York. And we have about 100 students-- physics students-- in our department. We graduate 20 to 25 a year, and we have about 40% women. I use MATLAB Grader, Live Scripts, and Simulink.
I start right away in general physics. And then, I also incorporate a lot of group problems into my upper level classes. So I teach electronics, E&M, thermal physics, optics, And I usually start with simple intro activities, and then move on to group problems. And then I usually try to include something in MATLAB in a final exam, or practicum.
So when-- this past fall in my electronics course-- I decided I'm going to use MATLAB Grader a little more. What I wanted to do is use MATLAB Grader and Live Scripts. So I created about 50 problems for my electronics class in MATLAB Grader under these topics-- Ohm's Law, Voltage Dividers, Transistors, Op Amps, RLC circuits. So that kind of split between those topics.
The students really liked it. It was a homework assignment, in addition to written work. So they really enjoyed that. I also gave them group problems, which I'll talk about in a minute. So each unit had like four to six-- each unit had four homework assignments, and they included MATLAB Grader problems, Canvas quizzes. So I really liked giving them these quiz problems, mainly to give them immediate feedback. So they were graded. They gave them immediate feedback to see if their written homework was correct. And that way they would then submit to Gradescope.
And then I had team projects. And I really wanted to incorporate more design work. So I tried to incorporate designing circuits, given some criteria, where they designed it by hand, and then completed them in MATLAB or sometimes Simulink. So I really like to use MATLAB and Simulink. And I started out, training wise, with Onramp for both MATLAB and Simulink. And that was assigned in my class.
So how do I use MATLAB Grader? This is kind of my vision of using it, is to review material in physics. So I really like it in the beginning and for some simple problems. It just really helps them get into this idea of how do you translate a problem-- a word problem-- into a computational problem. So I start reviewing physics material from previous courses. I start with simple problems. I just start with easy things to practice-- scripts and functions. And then I try to transition from review to more advanced things.
And so one of the things I do is I provide videos of how to use MATLAB Grader. And I use a lot of examples from the general physics course, so they should know that material pretty well. And that way they are learning how to use MATLAB Grader. I'm not giving them all the information about the new material I give them videos about how to make a live script and how to create a Simulink model.
So why do I like MATLAB Grader? Students don't need a MATLAB license. So it's really nice, for the earlier classes, you can just use this and you don't need a license. It doesn't integrate. If you don't have an institution license, It doesn't integrate into Canvas or anything like that. But it wasn't that hard to just enter the grades. It works in any browser. So I do have students that have Chromebooks, and so it can work with those. Grading is done automatically.
The reason I wouldn't use only MATLAB Grader is that you still want them to learn the IDE. You want them to learn the Script window and the Command window. And you want them to practice typing things
out in the Command window and seeing what they get. And then pasting into their Script window once they get it right. You want them to think that way. And so it has limited functionality compared to the Live Editor, but there is a window to practice coding. So you really could, I guess, hack it if you wanted to and just have them practice in the window. It's just-- it looks different and students tend to not be able to transfer very well if they don't have that practice.
And I use Simulink, too, because we have applied physics majors going into engineering. And so I really love the opportunity to have them create circuits and then troubleshoot. Students really struggle troubleshooting and understanding, where should I be thinking about voltage values to see if my circuit is working. They don't find intermediate points to help them figure out what's wrong.
So, why do I like it? You can increase difficulty gradually. You can introduce computational thinking right away. You can convert a word problem to a competition problem. And there's a place to begin. So you're providing an easy online-- it's like things they're used to doing-- you do it online, and they have scaffolding.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
- América Latina (Español)
- Canada (English)
- United States (English)
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- United Kingdom (English)
- Australia (English)
- India (English)
- New Zealand (English)
- 日本Japanese (日本語)
- 한국Korean (한국어)