Computing Across the Physics Curriculum
[an error occurred while processing this directive]
[an error occurred while processing this directive]
Description of Module Types
-
Lecture Demonstration Simulation (DEMO/SIM): It is often impractical or impossible to set up physical systems along with data acquisition instrumentation to perform real time demonstrations for advanced mechanics lectures. In such cases, a MATLAB numerical simulation provides an ideal alternative to "hardware demos". In a sim/demo where parameters can be tweaked, data collected, and system variables plotted in a matter of seconds.
-
Experimentation with a Simulated Physical System (EXPLORATION): In order to engage student's interest in upcoming topics and to build student's overall intuition into the behavior of physical systems, students are sometimes provided MATLAB code to perform simulations for physical systems before the analytic techniques which form the mathematical basis for the simulation are presented in class. Students are asked to predict how the response of a system might change if various parameters were altered. Then the simulation is used to test student ideas. This can be done as a homework assignment or an in class exercise. Ideally, students might take data on real physical systems set up in a laboratory. But given that most advanced courses have no corresponding lab as well as the fact that most of the systems we study are impractical to set up in a university lab, MATLAB provides a wonderful opportunity for students to take data on simulated systems. In such cases, MATLAB takes the place of the real life system and provides students with the ability to easily manipulate variables, collect data, and analyze results in a matter of minutes.
-
Problem Solution Validation and Insight (SOL/VALIDATION): In real life problems, we don't have a solutions key we can check to see if a solution we derive is correct. In order for students to become competent professionals, the need to develop skills which enable them to check the validity of a derived solution. In most of the applications we have developed of this type for Mechanics, an equation of motion is found analytically, then Euler's method is used in MATLAB as an independent way to check the validity of the analytic solution. Of course, there are many other more accurate numerical techniques compared to the Euler method, but we have found that Euler is preferable for two reasons: First, we have not encountered any problems in our introductory Theoretical Mechanics course that Euler does not provide a correct solution if the time step is small enough. Second, the Euler method is very simple to implement and since it gives erroneous results for time steps that are too big for a particular problem, it teaches students to develop skills to question and test their simulation solutions. We also teach how to use the canned ODE solver from MATLAB as an alternative since it is so much faster and more accurate. Students are usually allowed to use whatever numerical method they prefer in their homework problems. In some cases, students are asked to write their own MATLAB code to run the simulation. In other cases, the simulation code is provided to students and they are simply asked to manipulate variables and make observations.
-
Problem Solution to Complex Problems (SOL/COMPLEX): In Theoretical Mechanics, it is often extremely difficult or even impossible to obtain analytic solutions. For example, it is often very straightforward to obtain Lagrange's Equations for a physical system but impossible to find the solution to these equations. The Euler Method in MATLAB has the wonderful attribute that it solves complex non-linear differential equations as easily as it solves simple first order differential equations. From a student's point of view, the steps to finding a numerical solution are the same whether the differential equation is complex or simple. Therefore, in this type of application, MATLAB is used to determine numerical solutions to problems where an analytic solution is difficult or impossible to obtain. In some cases, students are asked to write their own MATLAB code to run the simulation. In other cases, the simulation code is provided to students and they are simply asked to manipulate variables and make observations.
-
Graphing (GRAPHING): The point of graphing is not merely to plot out a result that students already understand. Rather, the graphing is done in order to enable students to gain physical insights and make inferences from a large array of data. MATLAB provides a fast an easy interface to plot functions. MATLAB also has advanced plotting routines for surfaces and curve families that provide deep insights into problems as well as giving students the opportunity to develop skills to interpret complex graphs.
-
Solving Simultaneous Equations (SIMUL/EQS) In Theoretical Mechanics, we often find in the course of solving problems that we generate a large number of simultaneous equations. For example, in one double Attwood Machine problem, there were seven simultaneous equations to solve in order to find an equation of motion. In such cases, MATLAB's built in simultaneous equation solver saves students from having to go through the tedium of solving simultaneous equations by hand.
-
Numerical Integration: (INTEGRATION): As an alternative to simulation techniques, differential equations can be solved using numerical integration techniques. MATLAB has several built in numerical integration routines including "quad" which is an all purpose routine that is straightforward to implement and works very well.