Gas station without pumps

2017 February 5

Units matter

Filed under: Circuits course — gasstationwithoutpumps @ 11:37
Tags: , , , , ,

I was a little surprised by how many students had trouble with the following homework question, which was intended to be an easy point for them:

Estimate C2(touching) − C2(not touching), the capacitance of a finger touch on the packing-tape and foil sensor, by estimating the area of your finger that comes in contact with the tape, and assume that the tape is 2mil tape (0.002” thick) made of polypropylene (look up the dielectric constant of polypropylene on line). Warning: an inch is not a meter, and the area of your finger tip touching a plate is not a square meter—watch your units in your calculations!

Remember that capacitance can be computed with the formula $C = \frac{\epsilon_r\epsilon_0 A}{d}~,$
where $\epsilon_r$ is the dielectric constant,  $\epsilon_0=$8.854187817E-12 F/m is the permittivity of free space, A is the area, and d is the distance between the plates.

The problem is part of their preparation for making a capacitance touch sensor in lab—estimating about how much capacitance they are trying to sense.

There is a fairly wide range of different correct answers to this question, depending on how large an area is estimated for a finger touch. I considered any area from 0.5 (cm)2 to 4 (cm)2 reasonable, and might have accepted numbers outside that range with written justification from the students.  Some students have no notion of area, apparently, trying to use something like the length of their finger times the thickness of the tape for A.

People did not have trouble looking up the relative dielectric constant of polypropylene (about 2.2)—it might have helped that I mentioned that plastics were generally around 2.2 when we discussed capacitors a week or so ago.

What people had trouble with was the arithmetic with units, a subject that is supposed to have been covered repeatedly since pre-algebra in 7th grade. Students wanted to give me area in meters or cm (not square meters), or thought that inches, cm, and m could all be mixed in the same formula without any conversions.  Many students didn’t bother writing down the units in their formula, and just used raw numbers—this was a good way to forget to do the conversions into consistent units.  This despite the warning in the question to watch out for units!

A lot of students thought that 1 (cm)2 was 0.01 m2, rather than 1E-4 m2. Others made conversion errors from inches to meters (getting the thickness of the tape wrong by factors of 10 to 1000).

A number of students either left units entirely off their answer (no credit) or had the units way off (some students reported capacitances in the farad range, rather than a few tens of picofarads).

A couple of students forgot what the floating-point notation 8.854187817E-12 meant, even though we had covered that earlier in the quarter, and they could easily have looked up the constant on the web to figure out the meaning if they forgot.  I wish high-school teachers would cover this standard way of writing numbers, as most engineering and science faculty assume students already know how to read floating-point notation.

Many students left their answers in “scientific” notation (numbers like 3.3 10-11 F) instead of using more readable engineering notation (33pF). I didn’t take off anything for that, if the answer was correct, but I think that many students need a lot more practice with metric prefixes, so that they get in the habit of using them.

On the plus side, it seems that about a third of the class did get this question right, so there is some hope that students helping each other will spread the understanding to more students.  (Unfortunately, the collaborations that are naturally forming seem to be good students together and clueless students together, which doesn’t help the bottom half of the class much.)

2013 October 7

Filed under: Uncategorized — gasstationwithoutpumps @ 10:14
Tags: , , ,

In Money and decimals [TDI 2] | Overthinking my teaching, Christopher Danielson brings up some questions about whether money is really a good example for teaching about decimals.  Unfortunately, he has closed comments on the blog post, preferring to have tiny snippet discussions on Twitter or having people join some course website on instructure.com, neither of which appeals to me.  So I’ll discuss his points on my own blog instead.

The most interesting question he raises is the following:

Is it possible, as Max Ray suggests below, that the conception people tend to carry in their minds is of dollars and cents as separate units, as they do feet and inches?

@Trianglemancsd though I am curious what students use to make sense of cents prior to fractions. A dollars unit and a pennies unit, right?

— Max Ray (@maxmathforum) September 27, 2013

I report my height as 6 feet 1 inch. I do not report it as $6\frac{1}{12}$ feet, although I know that I could. Likewise I don’t think of 1 hour and 5 minutes as $1\frac{5}{60}$ hours, although I know this to be correct.

Is it possible that many people think of $1.25 as 1 dollar and 25 cents, rather than as $1\frac{25}{100}$ dollars? Maybe students are thinking of dollars and cents as different units that have a nice conversion rate, rather than of dollars as the natural unit and cents as a partitioning of that unit. Follow-up questions: (a) Might Max’s insight help to explain the errors in the gallery of misplaced decimals? (b) What are the implications of this for using money to teach decimals? I think it is certainly the case that most people think of money in terms of dollars and cents, not in terms of dollars and fractions of a dollar, and many of the notational mistakes one sees in ads supports this interpretation. The Mad Hatter’s hat was priced at “ten and six”—10 shillings and 6 pence, which was half a guinea. Incidentally, I’ve never really understood why there was a unit for 21 shillings, when 20 shillings was a pound. (According to the Wikipedia article about guineas, it started out as a one-pound coin, but fluctuated in value according to the relative prices of gold and silver, before getting fixed at 21 shillings in 1717.) It used to be that many monetary systems were not based on a decimal system—I’m old enough to remember the former British system of pounds, shillings, and pence (20 shillings to the pound, 12 pence to the shilling) with prices given with a slash separating shillings and pence. The colloquial use of “and” to separate shillings and pence or dollars and cents is also indicative of the general thought pattern that these are separate units, neither composed nor divided in the way that Christopher likes to think of units. People don’t think in terms of dollars and fractional dollars, nor in terms of all prices in cents, but in terms of mixed unit of dollars and cents. (This may also help explain why 99¢ seems much cheaper to people than$1, while 99 and 100 are close—though the tendency for people to truncate rather than rounding is probably a bigger part of the story.)

Because people think of dollars and cents as separate units, using money as a metaphor for explaining decimal notation is not as useful as it might be. With separate units, the conceptual process is one of unit conversion and scaling, not of place value. Unfortunately, more useful models (like using cm, mm, and meters; grams and kg; mL and liters) are not open to US educators, because of the archaic units (inches, feet, and miles; tons, pounds, and ounces; pints, cups, tablespoons, and teaspoons) still used here.

A lot of teachers claim that decimals are hard—harder than fractions—but I’ve never understood that claim. Place value always seemed easy and natural to me, so having more places to the right seemed like a trivial extension.  None of the arithmetic algorithms changed (other than having to keep track of where the decimal point ended up), so decimals always seemed like a simpler extension to whole numbers than fractions were.

Of course, fractions are a more powerful and more fundamental concept than decimals—not all rational numbers can be expressed as simple decimals, and the notational conventions for repeating decimals are not obvious nor easily explained. So the rather complicated relationship between fractions and decimal notation is understandably difficult to teach.  But I would have thought that the problem comes more from the fractions than from the decimals.

2013 August 4

Units in physics again

Filed under: Uncategorized — gasstationwithoutpumps @ 17:22
Tags: , , ,

Joe Redish has a series of posts on The Unabashed Academic on the use of units in math and physics courses: Units and stoichiometry, Cutting mathematicians some slackTeaching units, and A higher power—units again.  I just re-read that series of articles today (having read one or more of them when they first came out).

The Teaching units post had one paragraph that particularly caught my attention:

In addition to suppressing units when we do pure math, we might also note that when writing computer code we often suppress units. (This led to a multi-million dollar failure at NASA.) But any object-oriented programming language can correctly retain (and even check) units. I doubt that classes in computation, either in computer science, engineering, or physics departments, teach objects with units—despite the fact that it would be incredibly useful for scientists.

I used Vpython with my son in learning calculus-based physics, and was irritated by its inability to play nicely with units (see Units in physics and Physics simulations). It would be a fairly simple modification to Vpython to allow a “units” option for each plotting or drawing routine  There could be a global option to change the defaults from None (for legacy Vpython code) to “m” for lengths, “s” for time, and “Hz” for frequencies (like the “rate” function), and to require units using the Unum package for all plotting and drawing.

For teaching physics, having unit checks on all computations would help students debug both their programs and their physics understanding.  I really don’t understand why this was not included from the beginning in Vpython, since the language was intended for use as a language for teaching physics. Carrying the units around like this does slow the code down (perhaps by a factor of two), but the pedagogical value of being able to debug incorrect-unit bugs far exceeds the pedagogical value of faster simulations.

Next year, in the circuits course, I’m going to be a stickler about students always including units in their computations, as a consistency check on their thinking, since many of the bioengineers do not have good number sense or algebraic intuition.  Forcing them to carry units throughout may make them a little less likely to do random algebraic manipulations.

2013 July 4

Caballero on teaching physics with computation

Yesterday, Danny Caballero left a comment on my blog with pointers to three preprints of papers he’s been a co-author on:

I couldn’t agree more with the overall sentiment in this post. Computing is important for all students of science and for science teachers. However, as you say, I do think my dissertation work has been misconstrued a bit in this post. So, let me clarify.

The inventory you mention measures a small slice of mechanics taught in introductory physics. It’s been an important slice, but maybe now it’s time to think beyond it. What are students learning above and beyond this assessment? In M&I, they are learning about modeling, computing, and connecting the two. My work shows that the present implementation of M&I doesn’t produce great gains on this assessment, that students make mistakes in their code, and that they are less inclined towards computing after instruction.

So what? We are getting to teach students how science is done and they are using computing to investigate models. Now, this implementation is not the most polished one, which means we have a good way to go. But, that’s OK, because we are not going to fix all these issues overnight. We have been working on them for the last two years in various contexts. But, we need to figure out how to teach science and computing together. And we need to figure out how to do it well.

So, I’ll point you to a few other publications on computing in physics that I’ve written. Two concern high school, and another deals with physics majors. The high school work shows we can implement ideas from my dissertation work at the high school level (as others are doing). Moreover, we find that students who know physics and computing ideas can make good models of systems and are not memorizing lines of code. In my dissertation work, we didn’t do any qualitative work like student interviews, but it’s clear that doing so is necessary. The work with physics majors is one of the first forays into integrating computing in upper-division physics. We show that a new model for implementation can positively affect student attitudes.

Upper-division:
http://arxiv.org/abs/1303.4355

This morning I read his three papers.  They all describe prototype courses that use computational modeling to teach physics, with some analysis of the outcomes.  They are not controlled experiments, but prototyping proof-of-principle projects (as are most educational research “experiments”).  This is not a criticism of the papers—one generally has to do a lot of prototyping before arriving at a method that is robust and repeatable enough to be worth the difficulty and expense of controlled experiments.  Engineers see the need for prototyping, but too many people in other fields think that things have to work perfectly the first time or be discarded forever.

These papers bracket the previous work Danny did that studied computational modeling for first-year calculus-based physics.  The two high-school papers are about a 9th grade physics class that uses the Modeling Instruction approach to teaching physics, to which was added computational modeling using VPython.  The “upper-division” paper discusses adding computational modeling to a 2nd-year classical mechanics course for physics majors, following a traditional 1st-year calculus-based physics course.

I was a little unclear on the level of the 9th-grade course.  In one place he refers to it as “conceptual physics”, but in other parts of the description it sounds more like an algebra-based high school physics course (covering the mechanics half of AP Physics B), a step-up from conceptual physics.

From his description, it seemed fairly straightforward to add a computational component to the Modeling Instruction approach, and it helped students see that all the different “models” taught in that approach are really special cases of the same underlying general model.  They used Vpython with a couple of additional packages (PhysKit and PhysUtil) to make creating graphs and motion diagrams easier for beginning programmers.  The additional packages allow lines like

    motionMap.update(t)
timerDisplay.update(t)
graph.plot(t, cart.pos.x)


in the inner loop, simplifying the usual VPython interface a bit.

It sounds like the students were finishing the course with a mix of students who knew what they were doing and those who still hadn’t quite grasped the physics or hadn’t quite got the programming.  He did try analyzing some of the student work to see whether students were having difficulty with the physics or VPython for making the simulations, but I found the results hard to interpret—raw numbers don’t mean much to me, because I don’t have a good prior expectation of what 9th graders at a private high school should be able to do.  I’m curious whether difficulties with programming correlated with difficulties in understanding the physics, and whether grading the computational homework gave insight into the misconceptions the students had about the physics.

One of the strong points of the computational approach is that it allowed the students to model phenomena usually beyond the scope of 9th-grade physics (like a soccer ball with linear drag forces).  I found this to be the case for calculus-based physics also, where we modeled pendulums without the small-angle approximation (problem 4.P.89 in Matter and Interactions) and the magnetic field lines of a helical solenoid.

Some of his observations are unsurprising: “Students find debugging their programs difficult; that is, they have trouble determining whether they have made a coding error or a physics error and how to deal with that issue. ”  He also noticed that some students found installing the software difficult—I believe that the VPython developers have been working on that problem, though it is not yet at the level where all 9th graders will find it easy.

Personally, I’d like to see the physics simulations for high school students use computations with units throughout—this would help them catch a lot of their physics errors earlier.  I see this lack of units as one of the biggest flaws in VPython as an instructional tool for physics.  I’ve blogged about this before in Physics with Units, and I’ve done some VPython programming using Unum.  Unfortunately, the Vpython plotting and animation code does not play nicely with Unum, and having to strip out the units before plotting or drawing negates most of the advantages of keeping units around. I realize that for professional physics simulations, units are always implicit (in comments and variable names) rather than explicit, because that makes more efficient use of the computer, but for instructional purposes explicit units would be worth the inefficiency.

The 2nd-year classical mechanics course used Mathematica to solve ordinary differential equations (ODEs), and provided only minimal instruction in Mathematica.  The main improvement to the course from my perspective was the addition of a final project that allowed students to study an open-ended physics question of their own choice using computational modeling.  This improvement was discarded in subsequent offerings, because it required too much instructor time. Caballero wrote, “For junior and research-focused faculty, the computational project is a significant investment of their time and energy given the large enrollment in CM 1. Developing authentic, scientific experiences for students that can be sustained with little faculty input is challenging.”

This is a theme that I see repeatedly in course design in all disciplines and at most universities: the really good parts of prototype courses take a lot of instructor time and get discarded.  I think that the goal “sustained with little faculty input” is a wrong goal, but it is one shared by many faculty and administrators, who think that teaching is a burden that should be given as little effort as they can get away with. I’ve decided, rather deliberately, not to design my courses that way, but to design them around high faculty involvement.  I believe that the value of a University education depends on high-contact courses, and I’m willing to resist the MOOCification of the university at least in my own courses.  This does take a lot of my time, and I’ve given up on writing grant proposals to make the time—not a choice that most junior faculty could afford to make, given that promotion these days is based more on how much money is brought in than on the quality of teaching or research.

2011 December 27

Units in physics

Filed under: home school — gasstationwithoutpumps @ 12:32
Tags: , , , , , ,

The post today by A higher power — units again, triggered one of the little things that has been bugging me about how I’m teaching Physics using Matter and Interactions and VPython.  The problem is that VPython does not have any way of expressing or keeping track of units.  All the variables are just real (or complex) numbers, with no attached units.  Although that is standard practice in computer programming, it is not standard practice in physics and is pedagogically a bad idea, as debugging a hidden change of units is very difficult for students.  (The article that triggered this musing is about units to higher powers, like length6 or length4, where they come from, and how to think about them, but that is not the problem I’m interested in right now.)

I’m wondering how difficult it would be in VPython to create a new class of  objects which can be scalars or vectors with units.  It has been done in other languages in the past (see, for example, Incorporation of units into programming languages by Michael Karr and David B. Loveman, II, Communications of the ACM, Volume 21 Issue 5, May 1978 doi:10.1145/359488.359501), and is still being done in other languages.

The popular SciPy scientific Python package does not implement units—there is unit name associated with the constants in its table of constants, but it is just a string, with no attached semantics, and it is not carried with the numbers.  But there are implementations of units of measurement in Python.  There is a discussion  on bytes.com of this very question, pointing to several implementations. A couple of the implementations pointed to have dead links (http://RussP.us/scalar.htm and http://home.tiscali.be/be052320/Unum.html). The RussP code does not seem to be findable on the web (I’ve not bothered checking the Wayback Machine, since unmaintained code is not a good idea to incorporate into a project), but the Unum code seems to now be at https://bitbucket.org/kiv/unum/, where it is still actively maintained. The description at bitbucket seems promising:

Unum stands for ‘unit-numbers’. It is a Python module that allows you to define and manipulate quantities with units attached such as 60 seconds, 500 watts, 42 miles-per-hour, 100 kg per square meter, 14400 bits per second, 30 dollars, and so on. Features include exceptions for incorrect use of units, automatic and manual conversion between compatible units, easy extension to arbitrary units, and integration with other arithmetic types including Numpy arrays and standard library types like complex and fractions.Fraction.

The installation instructions for Unum claim that it can be installed with easy_install, but that was deliberately broken on Sept 4, 2011, and the installation instructions not updated to reflect the change.  Installation with the alternative instructions (downloading the tar file, untarring it, and running “python setup.py install”) does work, and Unum seems fairly solid.  It is probably dangerous to use “from unum.units import *”, since there are a lot of short names that get defined, and someone is likely to have used one of them with a different meaning already.  Using “from unum import units” is probably better, since that allows expressions like 2*units.cm, which avoids ambiguity.  One minor feature of Unum is that it keeps units with prefixes (km, cm, mm), which can be an advantage or disadvantage.  It is possible to force particular units:

sp = 10*units.km/ (5*units.h)
>>> sp
2 [km/h]
>>> sp.asNumber(units.m/units.s) *units.m/units.s
0.555555555556 [m/s]
>>> sp.asUnit(units.m/units.s)
0.555555555556 [m/s]



In the comp.lang.python Google group, Will Ware posted mks.py, a fairly minimal implementation of numbers with units.  If I’m reading the code right, there are some weird restrictions (like requiring unit-less scalars to the left of numbers with units when multiplying, so 2.7*liters is legal, but (1*liters)*2.7 is not).  This is a minimal implementation that can be used with care, but is not robust enough for use with novice programmers. Unum looks like a better bet.

Pyre does explicitly include units, but it is intended for experts to create efficient code, and the complexity of the framework is probably too much for first-time programmers.

ScientificPython looks like a competitor for SciPy, and includes an interface to VPython already.  I’ve not checked how well the Scientific.Physics.PhysicalQuantities module (which implements “physical quantities with units, including unit conversion and arithmetic operations with unit checks”) is integrated with VPython, but it looks like Konrad Hinsen has done most of the work here.  Of course, picking up the whole package may be a bit much as there is a lot of stuff here that is not relevant to a first-year physics class, so the documentation may be overwhelming.  It does seem simpler to use just a subset of this than to use Pyre, though.

I now have to decide whether to suggest to my students that they install and use Unum with their Vpython programs.  It would certainly help them keep their units straight.