Thursday, October 4, 2018

The Universe Tells You If You're Right

Three recent, easy examples of ways that I've let the students know that they're not trying to please me - that I'm not the final arbiter and source of everything physics-y - came this week in the form of lab practica in three different courses:

AP Physics C (Mechanics): The Bouncy Spring
The students program a Glowscript animation of a ball on a spring, initially released from a position diagonally below the pivot point of the spring. Crazy bouncy motion ensues, but... did we do that right? Pair some high-speed video with the animation and see! For fast finishers: relate the loop computation rate to the frame rate of the camera and get the video and animation to move in sync.



Honors Physics: Ramp Rolling
Sitting in announcements last week, I thought about a ball rolling down the long, gentle slope in our auditorium, then hitting the wall after rolling across the flat ground. Hmm... how far up the ramp can I take the ball before it hits that wall? Easy enough: split the kids into three teams: a team to determine how the ball moves on the ramp (they figure out the translation: what's its acceleration on the ramp?), a second team figures out how it moves on the floor (acceleration again), and a third team does a derivation to put it all together, taking assumed results from teams 1 and 2 and deriving a function for the ramp distance. Works pretty well, and the gentle curved transition gives us an opportunity to talk about error analysis.



Electronics: Resistor Circuits
Were your Kirchoff's Laws and Ohm's Law calculations right when you analyzed that three-resistor circuit? Yes? No? Measure it! Really simple here - gives practice breadboarding and measuring that the kids wouldn't get from just a thumbs up/down from me.




Friday, July 29, 2016

The Power of Student Coding in Physics

A couple of weeks ago, I gave a 30-minute talk about student coding in physics at the AAPT National Meeting in sunny Sacramento. I'm including a link to the presentation below. The ideas are several:

  • "I don't code in my physics classes: why should I?"
  • "What tools should I have my students use to code physics?"
  • "How can I help my (esp. younger) students with some CS concepts?"
  • "What sorts of programs can my kids and I write in intro physics/intermediate division physics?"
  • "I haven't coded much before: I need some examples of code, too!"


Robot Project: Results

My Electrical Engineering elective ran a term-long project (in the vein of project-based learning) this spring with the goal of building a robot to overcome an "obstacle" (taken in the broadest sense).

Some previous posts on this project:

First-time logistical hiccoughs aside, the projects were generally successful, whether that was complete success (robots successfully overcoming their obstacles) or partial success (all subsystems working, some sort of late-game failure or unexpected exception).

I built an 'arena' for this, with each robot having its own triangular area in which to place its robots, obstacle(s), and goal:


A few of the robots:




A successful robot (obstacle was darkness - it switches to battery backup when the solar panel output drops):

I was happy with the amount of dedication that the project inspired in the students - they worked very diligently and picked up a lot of skills in the engineering and coding realms. A few tweaks for next year, but it's a keeper!

Thursday, May 19, 2016

Physics and Art: Pollock

This winter, one of my students came to me with an idea to create an 'art robot' - a robot that could create a piece of art. After some research, she found a Discover article summarizing Richard Taylor's work on fractal analysis of Jackson Pollock's drip paintings. Note that there is considerable disagreement over whether this is valid, as the range of available scales (only about three orders of magnitude) is generally considered too small to adequately authenticate fractal structure.

This hiccough notwithstanding, we set about to create a chaotic pendulum that could create paintings with similar fractal dimensions to Pollock's. The general idea of structural complexity is shown in a graphic from the first reference:

The fractal dimension measured by Taylor of Pollock's works is in the middle range: 1.5-1.6. A non-chaotic conical pendulum's traces are not complex enough to reproduce this (left image below), but a chaotic pendulum can (middle and right below, from second reference above):
In order to make the traces chaotic, we attached a pulley controlled by a stepper motor to the pivot of the pendulum and had an Arduino quickly oscillate the pivot infrequently (slightly lower period than the pendulum's natural period). A Glowscript simulation of two such pendula starting with nearly identical initial conditions show quick divergence, the result of the nonlinear chaotic system.

In practice, we gave the system some random horizontal driving as well, as it lost amplitude. The result is a set of five attractive canvases. The set will adorn the hall near my room, along with a poster explaining the process, showing the derivation, and discussing the results (I co-opted some MATLAB code to determine the fractal dimension of each foreground color-layer of each painting and each painting's average fractal dimension).











Wednesday, May 18, 2016

EE Project: Arduino Project Videos and Specifications Sheets

Two of the deliverables that students need to submit during the course of my Electrical Engineering robotics project are Arduino project videos and what I'm calling a "specifications sheet."

The Arduino project video involves them finding a pre-existing project - from the Make Arduino text that they have or the Sparkfun Inventor's Kit book or the Parallax Robot kit's materials or anywhere else - for the Arduino that they think might have some relevance for their robot build, to build it, then to modify it in some way to change its behavior, then to present a short Youtube video explaining the process and its relevance, and providing the commented code in the video description.

These have gone really well; the students haven't had training in coding for the Arduino, but they're fine with the electrical assembly issues, so it's a platform for them to modify code and hardware, which leads to them unpacking some of the working of the scripts. Lots of the projects have combined two functions, which is terrific. For example, several groups took sensor input and used it to output status messages to an LCD.

Here's one example using the LCD and a pushbutton:


...and here's one using the LCD and a photocell, complete with director extras.


The specifications sheet is like a datasheet for the robot. One of my goals is to get students to the point where they can read and use a datasheet, because it's ridiculous to think that they could ever learn all of the devices that they might encounter in their projects after this course. Instead, I want to train them to use the resources at their disposal - Stack Exchange, online tutorials, datasheets, etc. - and learn how to learn to use a new device, software package, or programming language.

These came in with varying levels of success, and I think that I can be more specific with these next year (though they can revise them this year to address any lack of specificity). The one below is a pretty good example, though I wanted some more detail on the values fed to the servos - what do those numbers mean? What's PWM, and how does it work? It's a great start, though.

Input:
Pin A0 - photocell
Gives a number value and identified as “pcellreading”
When the light value reads 250 or lower, the car will stop
Pin A1 - ultrasonic sensor
Need to wire sensor and input code
Will give number value and identified as “ultrareading”
Pin 7 - right whisker
Equal 0 when the right  whisker is touching something
identified as “wRight”
Pin 5 - left whisker
Equal 0 when the left  whisker is touching something
identified as “wLeft”
Outputs:
Pin 13 -left servo wheel (input of 200 means the amount of continuous pulses are being generated) (can be anything from 1-250) (corresponds to amount of time spent rotating the wheel)
Pin 12 - right servo wheel (input of 200 means the amount of continuous pulses are being generated) (can be anything from 1-250) (corresponds to amount of time spent rotating the wheel)
Backs up and turns left 120 degrees
If pcellreading>650 & wLeft=0 & wRight=0
Or if ultrareading>6
Backs up and turn right 60 degrees
If pcellreading>650 & wLeft=0
Back up and turns left 60 degrees
If pcellreading>650 & wRight=0
Moves forward
If pcellreading>650
Stop moving and it has reached the goal
If pcellreading<650 br="">Expected exceptions:
Car goes up ramp at angle so that one wheel goes over the edge before the ultrasonic sensor detects the cliff edge
It gets stuck in a corner area so that it keeps hitting the 2 wall in front of it without turning around





Tuesday, April 12, 2016

EE Projects: Obstacle Sheets

In my electrical engineering classes, student pairs are hard at work tinkering with Arduino sketches that they think will have some utility towards their ultimate goal of building a robot to defeat their landscape's "obstacles." (project summary here)

Here is some of their project work - I call these the "Obstacle Sheets," where they outline the challenge that their robot will face and provide some ideas for overcoming them. It's just broad strokes at this point; they needed to generate some ideas to explore, and the next task for each of them will be building three Arduino projects (we have a couple of books - The Sparkfun Inventor's Kit and the Make Arduino Book), modifying them to change their functioning, and documenting that process in a Youtube video.


Balloon-Cushioned Robot

Task:

-We will initially drive the robot off of some moderate height

-We are going to use CO2 canisters to inflate balloons

-We are having the robot activate an airbag (the balloons) so that it survives the fall

-This will be motion activated- It will notice that it is in freefall

-Needs to right itself after it hits the ground

-Needs to escape the balloon (Overinflate them)

-Needs to find goal


Items/Research:

-Research Mars Pathfinder

-We also need a 9v gas valve

-c02 canisters

-balloons

-regulator to control pressure


Scared of Everything Robot (meant to be used in an indoor environment, normal floor)

Objective:
Find the most optimal spot
 -Search for darkest spot, only stay if spot meets other sensor requirements
  -quiet, not too hot
Make comments about its surroundings based on sensors
 (optional if rest of project is finished)

 Obstacles:
-Getting around objects that are in the way of robot finding best spot
 Algorithm for getting around object, avoid getting stuck circling room
-Avoiding light (photo sensor)
 Photo Resistor, pg. 41
-Avoiding noise of certain decibel (directional microphone research)
-Avoiding temperature that’s too hot
-check dark spot for space heater
-only turn on sensor when dark spot has been reached
-Getting the robot to speak for certain light levels (speaker and photo sensor)
  Play certain sound files when sensors reach certain levels

Actively search for darkest place (mission)
 -multiple sensors
Secondary move away from loud noises and avoid objects (avoid obstacles)
Final: Turn off when optimal hiding place is found

 Projects Pertaining to Robot:
P. 64 light sensors
P. 65 (SIK Guide) Spinning a Motor:
P. 54 thermostat sensor

 Robot Course of Action

Scan for darkness w/ multiple photosensors, travel using random search (like Roomba)
Constant sensors
Noise (Directional Microphone)
Shake (pivot back and forth) when it detects sound of certain decibel until sound goes away
Physical Obstacle
Move along edge, until turned 180 degrees (close enough)
Sonar
Avoiding walls, follow step 1 until travelled x centimeters in straight line, then give up and turn 90 degrees and restart search
Darkness Reached
Check if good enough
If it’s dark enough
If it’s quiet enough (small speaker)
If it’s not too hot (space heater)

Solar Robot

     The robot runs off of solar power, and when a photocell detects a lack of light it wirelessly triggers a lightbulb above it that is powered by a wall outlet. The robot will have ultrasonic proximity sensors to detect and avoid boundaries. Its search algorithm will initially be random (like that of iRobot’s Roomba).

Goal
- Get the vehicle to central location
- Need voltage regulator

Robot Car: Ditch/cliff Avoidance

Obstacle: Ditches and cliff in the terrain
 Solution: Ultrasonic sensor will be in front of the cart to detect the change of distance between the cart and ground. The distance for it to work is 1 inch to 10 feet.
(page for the sensor)   http://learn.parallax.com/KickStart/28015

 Large objects as barriers
 Solution: multiple flex sensors on different sides of the car

 How does it navigate to the Goal?
 It will have a navigation algorithm. In the algorithm the bot continues to move forward until it reaches an obstacle. At the obstacle, it will back up and turn a certain amount of degrees depending on which flex sensors are touched. It will repeat this until it reaches the goal.

 How does it know that it’s in the goal?
The goal will be under cover like in a cave, so it will be dark instead of light out at the goal. The robot will have a photocell to detect the change of light to identity the goal

 Sources to help us
http://learn.parallax.com/node/235

http://blog.miguelgrinberg.com/post/building-an-arduino-robot-part-iv-a-not-so-basic-robot-firmware


Robot Arm Upgrade (expansion of Science Olympiad project)

 Obstacles
Moving quickly and efficiently
Grabbing objects
Pencils
Legos
Dice
Ping pong balls
Programming movement
Increasing precision of movement
Grabbing objects of different textures and moving them.
Robot does not grunt enough or say enough old man things.

 Solution ideas
By building an Arduino that can use programmed macro movements we can move arm to the area of the objects quickly and then human controls will be in charge of the micro movements.

 By using stepper motors controlled by the Arduino, we can move the arm more quickly and more slowly as we need to. We will be able to move the arm specific distances by programming the motors.

 We will shift from belt operated motors and actuators to more precise rack and pinion mechanisms.

 We will reduce the amount of clamps as currently the arm is lousy with clamps.

 We will build more precise actuators, reducing the amount of syringes we have, which is currently a [90's movie reference] amount.

 We will have parts on the robot be of uniform length and ensure the even level of the arm in order to increase precision.

 We will add a speaker that will speak randomized, programmed sounds related to the activity of the arm in order to let users know his feelings and to demoralize the enemy.

 Experiments Related

Circuit #11
Circuit #12
Coding pg. 94, 137
Driving bigger loads pg. 72

Tuesday, April 5, 2016

Electrical Engineering: A Project-Based Course

This year, with the new Electrical Engineering elective (prerequisite: electronics), I'm trying out a fully project-based course. With the background knowledge that they have and a whole lot that they pick up along the way, these students are going to build a robot to respond to this central prompt:

Robots overcome obstacles in many different ways; some are similar to the methods that humans would use and some are markedly different. The goal here is to design an "obstacle" and a robot to navigate the obstacle. Teams will build both the "arena" in which the robot operates and its goal location, and their robot must overcome the obstacle to reach the goal. "Obstacle" could mean many different things, definitely not limited to physical obstacles - a solar-powered robot may have darkness as an obstacle, a robot on Venus would have to overcome high temperatures, and a rescue robot would have to overcome uneven terrain.

Along the way, teams will need to meet several intermediate goals, producing several 'deliverables,' which demonstrate planning, incremental progress, and proof-of-concept for their robot.

Deliverables:

  • "Obstacle" description, along with ideas (plural!) about how the robot might overcome it (team evaluation )
  • Specifications sheet: details your robot's inputs (information from sensors), outputs (expected behaviors, actions, etc.), and expected exceptions (problems that can occur) (team)
  • Three Arduino projects from the texts that could pertain to your problem (individual evaluation; three projects different from your partner's three). For each, summarize how you think it might pertain to your project and show how you modified the project/sketch to change how it functions in some way. Present these as a Youtube video, with commented code (showing especially the modifications) linked
  • Program flow chart (detail the sequence of sensor readings, calculations, and outputs that will take place in the loop, as well as the preliminary variables that need to be set) (team)
  • Contribution to the WCGW? (What Could Go Wrong?) meeting: brainstorming unexpected exceptions for other projects - if you help them figure out the potential issues, they'll be able to design around them. You'll get the same help (individual)
  • Schematic: Arduino and all associated electronics (sensors, motors, LEDs, etc.) (team)
  • Sensor and output validation: show, with isolated snippets of code, that you can accurately measure whatever sensors are measuring and accurately control any output devices (individual - one partner designs, executes, and videos illustration of inputs, the other does the outputs). Present these as Youtube videos
  • Landscape, including the "obstacles" and a goal. The robot needs to be able to detect when it's in the goal! (team)
  • The robot, fully functional (team)
  • Reflection on the process and the big question of how robots overcome obstacles and how that is similar to or different from how humans do (individual)

Each of the deliverables will be evaluated on the 11-point scale. Teams/individuals must earn at least 7 on a deliverable in order to proceed, with revision increasing the grade. The final evaluation will take place together, with the five arenas and robots moving towards their goals simultaneously. This is their 'exhibition,' and I'm planning to invite as large a committee as I can to make it an authentic experience. 

Monday, January 4, 2016

Electronics: Goals and Ideas

This year, we've added a physics-based elective strand, consisting of Experimental Design, Electronics, and Electrical Engineering.  The electronics course is a prerequisite for the EE course, but you don't have to take both. The experimental design course is a bit of a singleton, which I'll get to in another post, but I'm a month or so into the electronics course, and wanted to share some of the paradigms of the course and see if anyone had any helpful ideas or experience teaching HS electronics to add.
Big Ideas
  • The course is more of a phenomenological look at electronics than a physical ones. That is, we're dealing with it as electronics folks would, rather than as physicists would. We can't get into a lot of heavy Maxwell's equations action, and we're not getting into an extremely precise model of the physics of current flow (Matter and Interactions does a great job with this, but it's not within the goals of the course or the mathematical tools of the prerequisites), and no differential equations to deal with RC, RLC circuits, etc. I want students to have a practical understanding, supported by theory where necessary and possible.
  • There's a big emphasis on assembly, schematics, soldering, etc. I want students to be able to read and use a breadboard, a schematic, clip leads, meters, and to be able to solder.
  • I want to hit the most important devices and concepts - resistors, capacitors, various sensors, etc., and also classic combinations of components (which are applications of these), like voltage dividers, voltage regulators, rectifiers, etc. This is one spot where I'd love a lot of suggestions; my formal electronics training has principally been physical, rather than practical.
  • The primary lens through which I'm going to have the students comparing different classes of devices is the i-V curve. Batteries, resistors, diodes and LEDs, and PV cells are the primary devices that I have on that list. Let me know if there's something that I'm missing. Capacitors will be in there, too, but they don't fit well into this paradigm.
  • I'm using (supplemented by my own stuff) the Make:Electronics book. There's a great deal that I like about it and some things that I don't (particularly on the theoretical end), but it's a good place to start. Students also get the kit for the first set of experiments, too. That's pretty expensive, and I probably can buy the parts and distribute them to them next year for a much smaller cost to them.
The StandardsThese will likely wiggle a bit, but here's where I'm starting with the learning standards for the term. Seeing where we are now, I'm thinking that capacitors will wait until the next term (EE). Let me know if anything's missing, etc.! ...I'll likely split the power and energy stuff out as its own standard, either next year or before the end of this term.

Resistors

  • Apply the loop and junction rules to battery/resistor circuits, both qualitatively and quantitatively
  • Appropriately use Ohm’s law to describe one or more resistors
  • Analyze series and parallel circuits
  • Determine and apply equivalent resistance
  • Recognize, apply, and analyze iV curves of resistors and batteries
  • Determine the power expended by resistors and connect energy and time
  • Use current as a measurement of rate of charge flow

Switching

  • Identify and analyze open and short circuits
  • Use and analyze SPST, SPDT, and DPDT switches
  • Use and analyze relays
  • Analyze circuits containing PNP and NPN transistors

Capacitors

  • Understand relationship amongst voltage across a capacitor, charge stored in it, and its capacitance
  • Qualitatively analyze steady-state capacitor circuits
  • Apply the loop rule to circuits with capacitors
  • Determine and apply equivalent capacitance
  • Calculate energy stored in capacitors

PV Cells

  • Recognize and analyze iV curves of photovoltaic cells
  • Analyze PV cells in circuits

RC Circuits

  • Qualitatively analyze (graphs of) voltage, current, and charge as time goes on
  • Analyze the steady state of an RC circuit
  • Use the loop and junction rules to determine current, voltage, charge at some moment in time
  • Calculate and apply the time constant of simple RC circuits
  • Advanced: use equivalent circuits to determine time constant

Diodes

  • Differentiate between and apply ideal and realistic diode models
  • Compare diodes with resistors and batteries
  • Recognize and analyze a diode's iV curve
  • Understanding and apply the concepts of threshold and breakdown breakdown voltage

Project

Schematics

  • Recognize components on schematic:
  • Batteries
  • Switches
  • Capacitors
  • Resistors
  • Potentiometers
  • Diodes
  • LEDs
  • PV cells
  • Junctions
  • Draw schematic, given circuit (clip leads or breadboards)

Assembly

  • Construct circuit with clip leads, given schematic
  • Recognize components visually
  • Breadboard circuit, given schematic
  • Solder components, with or without perf board

Units

  • Properly and consistently use units
  • Fluently deal with metric prefixes
  • Convert units fluently
  • Check for proper unit cancelation

Algebra

  • When appropriate, use symbolic algebra (no numbers until the end)
  • Recognize unreasonable answers
  • Reason proportionally
  • Fluently solve equations

The Sky Bike

The Sky Bike at the Franklin Institute (I'm sure also at a lot of other museums) is a great application of energy and stability concepts for AP students!


 When I challenged my students to explain why the bike was stable, I got a lot of "because of the weight underneath," but not much concrete, convincing explanation to justify that intuition. OK; let's back it up a bit. Why - in terms of energy - is a regular bike, when upright and motionless (for simplicity), unstable?

They connected stability (since we had said the word about ten times at this point) to the potential energy graph, and then just needed to do the trig to determine the gravitational potential energy of the Earth/bike/person system and graph it.

The diagram:

The gravitational potential energy (taking h=0 to be the vertical position):
$$U(\theta) = mgh = -mg\dfrac{l}{2}(1-\cos\theta)$$

The graph: 
Why is it unstable? The force exerted on the bike that will act to change the angle is given by $F = -\dfrac{dU}{ds}$, which is another way of saying that the direction of the force is the opposite of the slope of the U graph or... that the system will evolve in the same way that a ball would, if it were rolling on a hill of the same shape as the U graph. Dome shaped? It'll roll downhill, away from the equilibrium point, so the equilibrium is unstable. 

OK, let's add the mass underneath. I arbitrarily decided that it was on a massless pole of the same length as the bike's height, and that its mass was greater than the bike/person mass. This made qualitative analysis easier at the end, but they see how the parameters could be modified once the analysis is done.

The diagram:
The gravitational potential energy (taking h=0 to be each object's vertical position):
$$U(\theta) = mgh = -mg\dfrac{l}{2}(1-\cos\theta) + Mgl(1-\cos\theta)$$

The graph:

The big deal here conceptually is that, when the bike/person goes down, the mass goes up, and it gains more potential energy than the bike/person lost, meaning that we've turned a dome into a bowl, so that we now have a stable equilibrium.

Two interesting asides: if $M = \dfrac{m}{2}$, then $U=0$ for all angles, and the equilibrium is neutral, so the rider could stably sit at whatever angle. Not a super-fun idea, so it's a good time to talk about engineering and designing around such possibilities.

Also, how do we make the ride more stable? What does that mean graphically? It'd mean making the $U$ graph steeper, which we could do by increasing $M$. Note that the masses are intimately related to the "heights" of the domes/bowls:


The connection between forces and potential energy is often a topic that gets short shrift in AP Physics - seen as a small tidbit or something mathematical to be explored, but it's actually a very deep and applicable concept. I've also incorporated some programming exercises on this for students as well. Its use to justify the ball-and-spring model of matter (by approximating the Lenard-Jones potential as a parabola near the equilibrium point) is one of the lynchpins of my want for it in a physics course that uses Matter and Interactions.

Saturday, September 5, 2015

Honors Projects, 2015

I'm quite a bit behind the times, but here is a selection of the independent projects from Honors Physics last year - it was a great crop of creative projects!

  • A project examining the physics of the zipline scene from Divergent: would the cable/device really get red hot?

  • An examination of a unique binary star system: two identical stars orbiting, with a planet in the center. How far away do they need to be so that the planet isn't torn apart? What would the surface gravity be?

  • An examination of the energetics of the world-record trampoline bounce: is that as high as they could've gone?

  • The creation and evaluation of a model describing head impacts: the brain is taken to be an object connected to the skull by springs. Values for parameters are determined and the behavior is simulated via Excel spreadsheet and compared to actual concussion data.

  • Some myth busting here: is this video of a baseball player hitting a ball so that it bounces off of multiple ball returns and back to him real?


  •  Investigation of the physics of a railgun; some parameters determined via Python modeling, once the equations of motion are determined


Thursday, July 2, 2015

Atomic Lattices and Glowscript

I'm finishing up (read: procrastinating finishing up) a final paper in a material science course that I'm taking this summer. The paper is about cuprous oxide ($Cu_2O$) and its possible use in a homemade diode. That process is outlined here.
HP Friedrichs's homemade diode and holder
I am investigating whether what he has described in terms of process and results jibes with the literature's descriptions of fabrication processes, physical properties, and and electrical properties. All of that's interesting, but one neat part was a look at the crystal structure. It's a combination of two crystals: the copper forms a face-centered cubic sublattice and the oxygen forms a body-centered cubic sublattice.

Specifying crystals, I've learned, is a pretty neat vector operation, and one which lends itself to programming pretty well. There's a basic unit which is repeated at each point of a cube. That unit isn't necessarily as many atoms as you might think: for a body-centered cubic lattice, it's a set of points at (relative coordinates) (0,0,0) and a(.5,.5,.5), where a is the lattice constant, which is the edge length of the cube. hen you replicate this two-atoms basis at each of the corners of a cube of side-length a, you get a body-centered cubic lattice (doing it just once gives some extra atoms; the unit cell consists of just those atoms within the unit cube. Doing it infinitely, though, will give an infinite BCC lattice). It's a little harder to picture the FCC lattice, but its basis consists of (0,0,0), a(0,.5,.5), a(.5,0,.5), and a(.5,.5,0). 

So we have a set of atom positions (2 or 4, depending on the lattice) that we want to iterate over all point of the form a(x, y, z), with all coordinates in the integers. That's a perfect setup for VPython/Glowscript. It's easy enough, using some for loops, to iterate over an area of desired dimensions, and then it can all be zoomed and rotated by the user with VPython/Gloscript's native controls. I added a box showing the unit cube for orientation, and.. voila (click image or here to see animation)!

GlowScript 1.1 VPython

scene.background = color.white

def makeLattice(cubic,basis,offset,color,rad):
    # apply basis atoms to each site in cubic lattice
    atoms = []
    for site in cubic:
        for atom in basis:
            atoms.append(sphere(color= color, radius = rad, pos = site+atom+offset))
    return atoms

def makeCellLattice(cubic,basis,offset,color,rad):
    # apply basis atoms to each site in cubic lattice
    atoms = []
    for site in cubic:
        for atom in basis:
            if 0 <= (site+atom+offset).x <= a and 0 <= (site+atom+offset).y <= a and 0 <= (site+atom+offset).z <= a:
                atoms.append(sphere(color= color, radius = rad, pos = site+atom+offset))
    return atoms

def cubeDraw(color):
    # draw lines around the unit (not primitive) cell
    curve(pos = [a*vector(0,0,0),a*vector(1,0,0),a*vector(1,1,0),a*vector(0,1,0),a*vector(0,0,0)], color = color)
    curve(pos = [a*vector(0,0,0),a*vector(0,0,1),a*vector(0,1,1),a*vector(0,1,0),a*vector(0,0,0)], color = color)
    curve(pos = [a*vector(0,0,1),a*vector(1,0,1),a*vector(1,1,1),a*vector(0,1,1),a*vector(0,0,1)], color = color)
    curve(pos = [a*vector(1,0,0),a*vector(1,0,1),a*vector(1,1,1),a*vector(1,1,0),a*vector(1,0,0)], color = color)

a = 1 # lattice constant

# Lattice maker
# basis vectors
bcc = [vector(0,0,0), vector(.5*a,.5*a,.5*a)]
fcc = [vector(0,0,0), vector(0,.5*a,.5*a), vector(.5*a,0,.5*a), vector(.5*a,.5*a,0)]


# Create unit cubic lattice
# horizontal extent (will go from -x to x)
xmin = -1.5
xmax = 1.5
# vertical extent (will go from -y to y)
ymin = -1.5
ymax = 1.5
#in-out extent (will go from -z to z)
zmin = -1.5
zmax = 1.5

cubic = []

for i in arange(xmin,xmax+1,1):
    for j in arange(ymin,ymax+1,1):
        for k in arange(zmin,zmax+1,1):
            cubic.append(a*vector(i,j,k))

# Use this to show a single unit cell
#CuAtoms = makeCellLattice(cubic,bcc,vector(0,0,0),color.red,a/15)
#OAtoms = makeCellLattice(cubic,fcc,(sqrt(3)/8)*a*vector(-1,-1,-1),color.blue,a/20)

#Use this to show a bigger lattice
CuAtoms = makeLattice(cubic,bcc,vector(0,0,0),color.red,a/15)
OAtoms = makeLattice(cubic,fcc,(sqrt(3)/8)*a*vector(-1,-1,-1),color.blue,a/20)

scene.center = a*vector(.5,.5,-.5)

cubeDraw(color.red)

Saturday, April 25, 2015

Kinematics Graph Checker

Here's an applet for kinematics (mostly CAPM) practice that I put together this fall. Students have the option to choose what information they are given, from these choices:
  • Initial x, v, and a values
  • Position graph, initial x values
  • Velocity graph, initial x and v values
  • Acceleration graph, initial, x, v, and a values
The length of the time interval considered can also be varied. After getting the given information, students can draw their predictions (either sketching the shapes or drawing quantitative graphs), and then press the "Show Solutions" button to reveal the hidden two or three graphs. I finished this one after students were through 1D kinematics this year, so I don't have any info on how effective students find these. Let me know if you like (or don't like) them for your classroom purposes!

Friday, April 10, 2015

What Can You Do With This? feat. Phineas and Ferb

I love the "What Can You Do With This?" variety of problem prompts: give the students a situation, photo, video, sound, or piece of equipment and then ask them: "what can you do with this?" That is, "what questions can you ask of this?"

Students have great ownership of these questions, and must really engage with the modeling process - identifying what principles apply, making and justifying assumptions and approximations, determining what information is available, etc., as well as practicing the process of asking interesting but focused and answerable questions. None of these purposes are served well by "textbook problems," not to mention that the process is more enjoyable and engaging for students when they're such a big part of it.

Here's my most recent - a video prompt that I saw while watching Phineas and Ferb with my son:


The students came up with some great questions, made measurements (including scaling) from the video, and did their analyses. It took about 35 minutes, and here are the three whiteboards from this section:
"What's the stiffness constant of the 'trampoline'"?
"What would his maximum acceleration be as he's caught?"

 "What's the maximum force exerted on him by the trampoline?"
Also explored by this group, but not pictured: "From how high could he fall and not die?"

 "How high does Phineas bounce?"
"How much energy was lost during the bounce?"

Friday, March 13, 2015

Counter-factual Animations and Energy

Soon after my students began energy, I presented them with a set of five YouTube videos that I made with VPython of a race between two identical balls, launched by identical springs that had been compressed identical amounts.
The five simulations present five different ways that the race could play out; one is physically accurate and, while the other four have some sort of logic, their results are not physically correct. The students have some time in groups to determine which they think is correct and, more importantly, what specific issues they have with the others. I'm challenging them to figure out the laws of physics in these four alternate universes, in essence.

After they've worked for a while, they vote, and then we go through the unpopular ones first, with students giving their reasons against them, debating as disagreement crops up.

It usually boils down to two or three, and they hone in on the correct answer pretty reliably in a peer-instruction-esque way. The discussion has been lively and productive, and I like it as a way to focus their attention on the kinds of things that energy conservation does and does not allow in the world in general. It also is a good review of some kinematics concepts, including average velocity and the velocity/displacement relationship.

The YouTube format isn't the best - the size is a bit too small, unless you want to switch back and forth between fullscreen and smaller. Additionally, the suggested videos pop-up at the end is distracting and annoying.

To that end, I coded the simulations into GlowScript instead; students can now deal with them in-browser, repeating or switching at will. It would be neat to have two windows to select different simulations to run against each other simultaneously, and I may add that feature in the future. In the meantime, this will be a big improvement for students over the previous incarnation!

Saturday, February 7, 2015

Thoughts on Beginning Magnetism

It has been a while since I have been able to get magnetism into the Honors Physics course, but the lack of fourteen million snow days this year has certainly helped. I'm putting it at the end of the second term, which is the term in which we studied gravity and circular motion, so it fits in pretty well - a non-contact, field-based phenomenon which, like gravity, which causes circular motion.

Since it has been several years, I thought that I'd completely revamp my treatment of magnetism. Here are some notes on the first day, and a brief outline of the plan of the rest. It's mostly bullet points, and at least as much for me remembering the thought process as for anything.

My favorite bit is that it's a whole 95-minute day that fleshes out the idea of field relatively well, giving students some concrete experience puzzling them out and creating representations based on their own investigations. Hopefully, this will give them a better mental picture of fields in space.

General ideas: 
- Magnetism is similar to gravity, in that it's a non-contact force - it's "invisible.'
- It's all about "fields," and we're going to need to figure out what the heck a field is at some point. That's pretty much the goal for the day.

Operational def’ns: We're going to use an operational def'n of the field (at least the B field direction) today. What’s our op. def. of temperature? It's what a thermometer measures! For B field directions, it’s going to be “where a compass points."

Let’s explore that a little:
- Map of the field in the room. Need better compasses, or maybe use phones? (yes, phones worked much better on the second day) They draw their vectors on board, "complete" them to form field lines.
- Let’s look at another field together: field of wire apparatus (through table), with compasses. Combining little arrows into loops, change i direction to see the opposite direction loop
- They investigate with bar magnet, horseshoe magnet, current loop (?), solenoid - your goal is to draw a good diagram of your object's B field on the WB.

Sharing whiteboards (unfortunately, didn't get any pics here of the boards):
- Bar first - what dir. are the field lines? (N to S) What does that tell us about Earth? (The north geographic pole is near a south magnetic pole!). 
- Horseshoe: what’s the orientation of the (unlabeled) poles?
What’s in common so far? 
- loops (are they closed? Yes - we couldn't see the part inside the magnet for these, but they're there)
- from N to S
- distance-dependent strength (how can we tell this from the diagram? Density of field lines!)
- opposites/likes
Now the solenoid: puzzling out the shape (if they didn't figure it out - one class did)

RHR - wire current

Current loop, using RHR1 - generates RHR2… let’s check it for the solenoid (go to solenoid)

Looping back around (see what I did there?): what is a field?
- has a value (magnitude, direction) at every point in space
- affects objects that are in it

Which field have we dealt with? Gravitational field, though we haven't called it that, really.
- Planet g field shape; where’s it strongest? same deal; not closed loops, though - that’s a difference.
- What objects create g fields? (masses) what objects does it affect? (masses)

For B fields, what creates them? perm. mag., currents -> moving charges (spin, domains, etc.), and it’ll affect moving charges, too! We'll look at the effects next time!

Future:
- Using this applet to examine the effects of B fields on charges - helps to figure out that the direction of the force on the charge is always perp to v, dependence on q, etc.
- Lorentz force 
- Applying that to a current; forces on wires
- Quantifying the fields of wires, solenoids

That's pretty much what we'll have time for before exams!

Thursday, December 4, 2014

Independent Friction Labs

At the end of the first term, I give my honors physics students a couple of days to design, implement, and present an independent investigation involving friction. That's about all that I specify, other than the size of the poster and a few details about requiring equations set with software, citations, etc.

This year's crop was great!

This group investigated the "friction" effects of oobleck on a block, dragged through it at constant speed. They determined that the relationship could be modeled in a friction-like way, but only if the "coefficient" was a function of speed.

This group tested the idea that the mass shouldn't affect the acceleration due to friction; three kids wore the same clothes and slid across the floor, using video analysis to determine the acceleration.

This group tested and modeled the friction between interleaved pages of books. They first modeled the friction on a single page, under some number of pages above, and then did a summation to predict the total possible static friction force between the books.

This group tested the classic physics approximation of ice being frictionless. They made pucks out of ice and dry ice, and determined friction coefficients for each.

This group tried to find the optimum pulling angle for breaking the static friction on an object, both experimentally and theoretically.

This group determined the coefficient of static friction between two blocks, then predicted the hanging mass necessary in a half Atwood machine to cause the top block to slip against the bottom block (which is attached to the cart in the half Atwood).

Another half Atwood exploration - they set up a vertical surface on a cart and increased the hanging mass until an eraser would accelerate along with the cart, instead of slipping down. 

This group dragged a boat through water at different speeds, trying to determine whether they could model fluid drag as a friction force. They showed that the "coefficient" would be velocity-dependent, so that drag is not really a friction force.

Circular Motion Simulation Follow-up

I last posted about a new circular motion applet that I was planning on using with my classes as the quantitative part of their UCM paradigm lab. Some reflections:

  • When students came up with a list of variables that might affect the size of the centripetal acceleration, the list was: speed, mass, radius (always in that order). The visual accelerometer on a rotating table showed the qualitative effect of speed nicely, and the thought experiment about driving a car around a corner (tight or wide) addressed radius. We couldn't do mass with the given stuff, so I told them to check that out in the applet. A few seconds' work with the slider showed that it's irrelevant.
  • The applet is framed in terms of string length (radius) and rotational frequency - instead of speed. This means that students had to confront (and figure out) the relationship between rotational frequency (or period) and speed just to get their data for the acceleration's dependence on speed. I like that.
  • The other way that they have to confront it is to control speed while investigating acceleration's dependence on radius - changing the radius but not the frequency would change the speed. The students have the figure out the proper frequency for each new value of the radius in order to keep the speed constant during the second experiment. I like this a lot as well.
  • Students still have trouble reconciling their two models ( and ) to determine the complete function of v and r. Even when they have figured out the units of the two constants, the connection is hard for them to make. I'm very open to suggestions of ways to make this go more easily - I don't have a great handle on what the conceptual difficulty is for them here. In the second section, I framed those two models as "OK, so a is proportional to v-squared, and a is proportional to 1/r," and that may have helped.
  • Overall, the quantitative modeling went much more quickly, had some good conceptual things to think about, and was good practice with function modeling, so I'm pretty happy about it, at this point. We'll see how things go over the next couple of weeks; did this begin to build lasting understanding?

Saturday, November 29, 2014

Circular Motion Simulation

I've been through several variations of circular motion paradigm labs over the years. Lots of approaches, lots of pros and cons.

Here's where I'm landing this year:

  • Preliminary investigation: a qualitative exploration, using basketballs and "science hammers" (lab rods with clamps on the ends) - differentiating between the effects of forces parallel to and perpendicular to the velocity. This establishes the conceptual foundation of uniform circular motion, and comes back later in the year during the energy transfer model (work)
  • Quick conceptual investigation: using either a visual accelerometer or a wireless dynamics probe/LabQuest, determine the qualitative effects of various variables on the acceleration of an object in UCM. Narrow it down to radius and (linear) speed. Angular speed can be a more natural variable for this (and easier to design an experiment to control for), but I've found that students have a lot of difficulty differentiating between angular and linear speeds at this point, and that they later confuse an angle in a banked turn with the angle "around the circle." 
  • While designing a real-world experiment with constant angular velocity is easier, using an applet can make experimental design with linear velocity as a variable just as easy. It's also quicker and more reliable (whirligig experiments can be a little dicey with data quality), putting the emphasis on the data analysis. (Save the whirligig for a practicum later!)
The various circular motion applets that I've used before are pretty much inaccessible now, because of Java's waning usability. So, I wrote one using Glowscript

Here's a screenshot - click through to use the applet.

Saturday, September 20, 2014

Graphical Solutions _and_ Symbolic Algebra in Physics

Graphical solutions are terrific tools to build understanding in motion, momentum, energy, and nearly every area of physics. Even better than that, they allow a large number of students to successfully solve problems that really struggle with a strictly algebraic approach. Kelly O'shea and others have some great resources for you to peruse; the approach can be eye-opening for those of us brought up in the traditional system.

One thing that I struggled with a few years ago when first exposed to graphical problem-solving was all of the numbers. With my honors physics classes, I put a lot of emphasis on building their skills in exclusively symbolic solutions to problems - students are expected to do every solution with "no numbers until the end." That is, they have to first derive an expression giving the desired quantity in terms of nothing but given quantities; only then can they use any numbers. This approach has several big advantages:

  • It's a pain to carry around units in the algebra (and necessary, because it's unthinkable to have "naked numbers"); symbolic algebra means that we don't have to
  • We can re-evaluate for different values of the parameters easily
  • We can check how our solution depends on the variables - should the Atwood's acceleration increase or decrease when this mass increases?
  • We can learn how our solution depends on the variables - maybe we didn't know that the mass would cancel out of the expression for the minimum speed in the Gravitron!
  • We can check how our solution behaves in special cases - should the acceleration go to g if that mass goes to zero?
  • We can learn how the solution behaves in special cases - hey, the position function of a falling ball with drag becomes linear in the large-t limit!
  • We can still check the units of the answer, without having to carry them through the algebra - if the units don't work, then it's not even worth plugging in the numbers
  • This is a skill that ultimately is a part of how "big kids" do science - it's an great skill to have going into college science and math courses (the course that I took this summer had, out of about sixty HW and exam exercises, exactly three problems that involved numbers!)
  • It helps to refine and develop student algebra skills (the more abstract end of the concrete-to-abstract progression of their skill development)
These advantages don't have to be lost in graphical problem-solving - students can still label the graph (naming every labeled quantity, whether it's known or not) and can still build slope and area relationships from the graph (involving those variables that they labeled). Solving these symbolically gets them the best of both worlds: graphical analysis and its lower barrier to entry and improved understanding, and symbolic algebra, with the skills listed above.

What does it look like? Here's a bit of student work, from a recent assessment on CVPM (constant velocity particle model) and the a whiteboard with the first (!) CAPM (constant acceleration particle model) problem that three students did this year.





Tuesday, September 16, 2014

VPython, Energy, and Stability

The content in AP Physics C about stability and its relationship to energy is a pretty thin introduction to a fairly deep idea. Classifying equilibria by looking at the derivative of potential energy can be a quick add-on, or we can make it a little deeper with the help of VPython.

When it first comes up, we go through the stable/unstable/neutral equilibrium discussion and the corresponding shapes of potential energy graphs, but I really wanted a way for students to apply that. I've thought of a few, only three of which I have tried out so far:

  • Have VPython plot a potential energy vs. tip angle curve for a box that's standing on its end - compare for different heights/widths of box
  • Have VPython graph total potential energy vs. stretch amount for a mass on a vertical spring
  • Have VPython graph potential energy for a mass of a spring that doesn't necessarily stay vertical (on y vs. x axes, with U value signified by color)
  • Investigate the Lenard-Jones (interatomic) potential, both for meaning and location of equilibrium points and to fit an approximate quadratic to it near the equilibrium point, justifying the use of the ball-and-spring model of matter.
  • Later in the year, during rotation, have them create a physical pendulum program with a box on a pivot not through its center - modify this to show the graph of potential energy as a function of angle
For the first and fifth, I have some results using VPython to show. (The fourth is great, too, especially if you're using Matter and Interactions!) For the box tipping, the graph is neat, not least of which because of the discontinuity in the derivative at 0. Calculus wouldn't find this minimum on without intervention from the student, and it's easy to forget to check those endpoints! This gives a nice graphical reminder. My one concern is that the geometry is fairly harrowing - determining the height of the CM as a function of angle isn't super-easy, and requires a high-quality diagram. 

Here's a screen shot:


When you vary the parameters, that central well can become deeper (more stable) or shallower (less stable), and vanishes as the box gets narrower (and becomes a pencil).

For the final one, I think that the program, being a modification of a previous one, isn't too difficult to do, though it does bring in the complication of having a "meta loop," where the whole simulation runs several times, with different placements of the axis. 

Here's a screen shot that links to a video of the program running:

The graph here is incredibly rich. Not only do we see two different kinds of equilibrium (three, if you let the pivot be at the middle for the first run through), but we see how the system is forced away from or towards those equilibrium more or less violently as the pivot moves. This helps to bring together their common-sense understandings of stability and the physical principle that we're trying to investigate.