Quantcast
Channel: CodeSection,代码区,Python开发技术文章_教程 - CodeSec
Viewing all articles
Browse latest Browse all 9596

You Physics Teachers Really Ought to Teach Numerical Calculations

$
0
0

I love including numerical calculations in my introductory and advanced physics courses. I find that including coding in the introductory physics course forces students to think in different ways to better understand physics. Numerical calculations are such an integral part of real world physics that it would be wrong to not include them in the intro courses. And at this point, I think my colleagues have run out of excuses for not including numerical calculations in these classes.

What is a numerical calculation? You might know it by another name―computational physics, numerical models, or even coding in physics. The basic idea is break a problem into many smaller problems. If you want an example, have a look at this older post on the three-body-problem . Although it’s usually the easiest to create a numerical calculation with a computer, you could technically do it on paper.

This is the way things work in the “real world.” Countless problems beyond the academic setting can only be solved numerically. Beyond physics, you findnumerical calculations in chemistry, math, economics, meteorology―you name it. Not only are numerical calculations useful, there are great tools for implementing them into lesson plans.I like python (the programming language, not the snake) because I find it relatively easy to learn and it does all the important stuff. Even better, you can run python on your phone .

I introduce students to numerical calculations by instructing them to create their own code to solve aproblem. Let me share with youwhat happens next.

Student Feedback at the Beginning

Picture thescene. I go over the basic principles of numerical calculations and createa program from scratch (probably a model of a mass on a spring ). Then students get to make their own numerical calculation, and I don’t even make them use python.

At this point, students have many concerns. Some express frustration that physics has turned into a programming course. Of course that’s simply not the case, unless you also consider physics is a literature course because it involves reading. Physics draws on skills from many fields(math, communications, drawing), which is one reason physics is awesome.

Other students deflect their anxiety into another issue like claiming they are a Mac person or a PC person, but python is platform agnostic (another thing that makes it great). Some students are simply afraid. They find the task too daunting and think they’ll never make progress. A few are too ambitious and want to begin with entirely too complex a program.

Sometime Later, While Working on Projects

Once students get started on their coding project (and past their initial fears), things start gettingbetter but not perfect. Many students fall back ontheir tendency to start with a Google search. This isn’t bad in of itself, but it can lead students to try using code they don’t fully understand. I find it far better to start with a simple problem that astudent could have complete mastery over.

The other big issue I see is that students find problems with vectors and scalars. This comes up more often than coding errors. What happens is a student willcalculate the gravitational force on a planet due to a star, but find the scalar value of this force. When the student tries adding a scalar to a vector to update the planet’s momentum, the program doesn’t work. I like thisbecause it helps students understand the vector nature of forces.

Some students see significant progress with their project during this phase They not only get something working like a moon orbiting a planet, but they can alsoshow that momentum is conserved. Better yet, students start learninghow to graphically show the total momentum in one direction as a function of time (as a graph).

Near the End of the Project

I find this to be the best part of the semester. I know students have trouble starting numerical calculations, but I find watching themprogress rewarding (for them, and for me). Of course they still experience some problems. I often find that some students withexperience in Java (the computer science department has students use Java) writeinteresting programs. These students tend to make complicated input/output algorithms but often miss the numerical calculation point. In the end, they have a program that calculates something withoutbreaking it into many small steps. Don’t worry, I let them fix their programs until they get something they are happy with.

But some students start taking things to a higher level. After making a simple falling ball, they want to make a ball bounce off a surface (trickier, but not impossible). Or after making a moon orbit a planet a student might want to add a third object to gravitationally interact with the other two.

All of which is to say I strongly encourage using numerical calculations in class. Any difficulties students experience are worth the increased understanding and skills they get from the lessons. You don’t know where to start? No problem. I’ve started compiling some online material to walk you through a numerical calculation. It’s essentially an online course at trinket.io . Yes, it’s not quite finished but it should be enough to get you started.


Viewing all articles
Browse latest Browse all 9596

Trending Articles