Blooming energy

Today I saw that the tree outside my office window had blossomed over the weekend:tree

So I got to wondering how much energy it had used to do that. I asked the question on twitter

and got a lot of interesting answers involving mass/energy, carbon bond energy, etc.

I’m not sure what the answer is, so I thought I’d post about it to see what other answers I could get. I’m really interested in what happened over the weekend, and I have a hazy memory of seeing tiny green buds before the weekend. So really I figured the buds all existed and just had to be forced out. I figured something had to move a few centimeters with, say, a kg-weight worth of force. That’s just me guessing though.

Of course with that approach (and really all the approaches people were using on twitter), you have to have an estimate of how many blooms there are. So I decided to see if Mathematica could help me with that.

I imported the image and used the image mouse-over tools to find the color of the blooms. Then I set all pixels that weren’t within a ColorDistance of 0.2 (found empirically) of that color to black. Then I did a DistanceTransform of that to replace all pixel values with the distance to the nearest black pixel. Then I used MaxDetect on that to find the centers of all of the blooms. Then I used MorphologicalComponents and ComponentMeasurements to count them (just under 3000) and HighlightImage to make this image:treehighlight

I think it did a pretty good job of finding all the blooms that way.

So, with roughly 3000 blooms in a period of 3 days, how much energy did it take? I’m not sure but I hope you can help.

Here are some starters for you:

  • What’s wrong with a mass/energy approach?
  • Just cut some off, burn them, and see how much you raise the temperature of water. Then multiply!
  • Why didn’t you use ImageJ for this? (here’s the link to the original image if you want to try)
  • The way you calculated the number of blooms is dumb, a much better way is . . .
  • Why do you care about the energy, I thought you said energy doesn’t exist?
  • Why can’t you just enjoy the view instead of ruining it with all this science?
  • On twitter you said that the tree sprouted. What are you, an idiot?
  • If you’re asking about energy, why does the three days part matter?
  • You didn’t say anything about seeing some green before the weekend on Twitter, thanks for having me waste my day.
Posted in fun, mathematica, physics, technology | 3 Comments

Quantum economies in higher ed

Well, I’m in the dean’s office now. Pause while the wordpress server handles the sudden exodus from this page. Ok, now we’re ready. I wanted to get some thoughts down (and seek useful advice from you, dear reader) about how we can incentivize various activities in higher ed. The reason I titled this “quantum economies” is that I’m realizing that most of my incentives (carrots and sticks) come in quite large chunks. What I’m trying to figure out is a way to have smaller chunks at my disposal.

I just got back from a conference that was all about assessment of general education in higher ed. Most of the people there have either a) drunk the koolaid about assessment, or b) have accreditation breathing down their necks. I’d say I’m really in both camps. One of the most common points of discussion in the hallways was how to get better buy in for various assessment activities on our various campuses. Some give stipends to those who really try to i) collect data, ii) analyze data, and iii) make changes accordingly. Some make sure to give a shout out to programs that are doing some or all of all 3 of those things. But I have to say that most of us were feeling like we don’t really have great ways to incentivize programs to do this necessary work.

So I thought about what we do. One thing we do is explicitly pay attention to the assessment work that departments have done when doing both program reviews and reviews of new hire requests. Some at the conferences were aghast when I told them that latter one, but for me it feels appropriate. My problem is that it’s too big. Our departments hire on average every 5 years or so, and our program review cycle is similar. That’s too rare and too big to really make the day-to-day incentives that I’m looking for. The problem for me is that we don’t have that many other program-level sticks or carrots.

I did have one idea that some at the conference thought was amusing. Some said that it would definitely work while others just assumed I was joking. I’m not sure. I definitely originally thought of it as a joke but maybe there’s something to it. What do you think: If your program doesn’t do assessment work, all (or most? or many? or more than usual?) of your classes have to be at 8am. We struggle a little to get people to teach at that time (I could write a whole other post about the interesting conversation on our campus about that time slot) and most would rank it towards the bottom of their favorite time to teach. Some at the conference also talked about courses that meet on Fridays in a similar vein.

This is definitely smaller than “you can’t hire” but it’s still pretty . . . petty I guess is the right word. At the conference others talked about how it would be great if getting to teach a gen ed course was something people fought over. They talked about how if those were the only, say, 18-person capped classes on campus then people would beg to teach them. Basically we were all trying to find ways to reward those who do good work (again: i) measure, ii) analyze, iii) correct) and, I suppose, punish those who don’t. One problem, of course, is the vicious negative cycle the “bad” programs would undergo with most if not all of these ideas.

So I’m still kicking around some thoughts. I’d love to get some more from you. I guess my goals are:

  1. That we find a better way to value assessing our learning outcomes.
  2. That we incentivize programs to do that hard work and take it seriously.
  3. (most importantly) that we become better at serving our students.

I’ll end with my favorite quote from Kathleen Landy at the conference:

Assessment is not an autopsy, it’s a physical.

Thoughts? Here are some starters for you:

  1. That’s not at all what ‘quantum’ means. It’s clear you’re on the dark side of administration if you can’t even remember that from your physics teacher days. I’m out.
  2. I tried to leave this page but wordpress insisted I stay and read all this drivel. That’s 5 minutes I’ll never get back.
  3. I like the idea of ____ but I think a better twist on it would be . . .
  4. I hate the idea of _____ though I suppose you could make it better by . . .
  5. Who is General Ed? What’s his last name?
  6. Boy for me assessment of learning outcomes is definitely a bloody autopsy. What do you mean by it being a physical instead?
  7. I love teaching at 8am, this didn’t make any sense to me at all.
  8. Instead you should punish programs by …
  9. You should never use sticks, you should always use carrots and here’s why . . .
  10. You should never use carrots, you should always use sticks and here’s why . . .
  11. You should make any department that’s not doing their assessment do all their programming in python (long time readers will get that)
Posted in dean, Uncategorized | 11 Comments

Lasers bouncing inside stuff

I’ve written before about how I sometimes like to imagine what would happen if you shot a laser in a fully mirrored room. Back then I did a bunch of cool stuff with flat walls, mostly by calculating the distance beyond the wall a bouncing ball was and having a potential energy function that brought the ball back. Recently I’ve been trying to figure out how to do that in much more complex shapes so I’ve been playing around with Mathematica’s “Region” capabilities. It took me a while, but I think I finally have a decent version with arbitrary shapes.

For those that don’t want to read any more, here’s a laser bouncing around inside a cow:

perfect (non-diffracting) laser beam bouncing around inside a cow

perfect (non-diffracting) laser beam bouncing around inside a cow

I was hoping that there would be an easy function like “normal to surface” or something but I couldn’t find anything close enough. There is a nice “RegionDistance” function that tells you how far from a region (a cow) you are. Unfortunately I couldn’t use that as my potential energy because to do the differential equation solving I need to be able to take a derivative of that (that’s what gives you the forces and hence the acceleration of the ball) and Mathematica didn’t really like that (I don’t blame it, it’s not really a differentiable function).

So then I started playing around with “RegionNearest” which tells you what part of a region is closest to your current position (ie the position of the ball). With that, here’s what I do:

  1. Define the region (cow=ExampleData[{“Example3D”, “Cow”}, “MeshRegion”])
  2. Find the boundary of the region (BoundaryRegion[cow])
  3. Launch the laser/ball
  4. Constantly check to see if the position is within some small distance of the boundary
  5. If it is, find the nearest point on the boundary and use that to determine the normal to the boundary (current point minus the boundary point).
  6. Use the normal vector to reflect the velocity vector
  7. repeat 4-7 until your computer crashes.

What’s really handy is the “WhenEvent” feature of Mathematica’s differential equation solver “NDSolve.” WhenEvent basically does part 4 above and triggers the function for 5 and 6. It’s so useful that I use it for this situation that isn’t really a differential equation. Basically I just say the force is zero everywhere and add the WhenEvent feature to do the reflections. It works great!

I should note that I started this project wondering what happens in a sphere. But it turns out that it’s super boring:

Then I went on to an ellipsoid, but that was pretty boring too. So, I went with the cow (my sons helped pick that). When my son saw the one above, he was really interested in what happens when it goes down a leg. Here you go:

going down the leg

going down the leg

Cool, huh?

Thoughts? Here are some starters for you:

  1. I’m in this class and … wait … nevermind
  2. This is cool. I especially like . . .
  3. This is dumb, you forgot about . . .
  4. You should try this shape . . .
  5. Why didn’t you use python to do this?
  6. How do you do the vector math with the normal vector and the velocity vector to do the reflection?
  7. What if the cow moves?
  8. Wait, I thought you were in the dean’s office now. Why are you still doing this cool stuff, aren’t you just a stuffed suit?
  9. Why do you only sometimes italicize the word Mathematica?
Posted in fun, mathematica, physics | 3 Comments

Non-majors teaching tools

This January I’m teaching a 4-wk intensive course called “Hamline Mythbusters”. On the first day of class I verified my assumption: this would be the last science class ever taken by nearly the whole class. They’re almost entirely seniors (the class filled in 10 minutes on the first day of registration) and they’re using this class to fulfill our disciplinary breadth requirement. I’ve been doing a few fun things in this course and I just wanted to get a few of them down here.

Estimation day

On estimation days the students work in groups to determine things like “how many piano tuners work in the twin cities?” or “how many gallons of gas are used in the US every year?” My grading scale is determined by:

\text{score}=100-10 \left|\log_3\left(\frac{x}{\text{actual}}\right)\right|

which is the same as saying a letter grade off for every factor of 3 you are off from the actual answer.

We’ve only had one of these days so far (the gas question) and I was really pleased with the result. Out of the 11 teams, only 2 were more than a factor of 3 off and both of those were due to a simple mistake where they multiplied by average gas mileage instead of dividing. It took the slowest team an hour so next time (tomorrow) I’m going to do multiple ones so that the groups can divide and conquer.

The connection to science is just developing a good number sense and to realize that they know a lot more than they think they know. By the way, I put a box at the front of the room so that they couldn’t just google all the answers:


Debate day

The day before debate day (actually on Friday to prep for Monday) they are told to bring in 2 pro and 2 con sources for debate day. On our first debate day we did “The US should use nuclear power for it’s dominant source of energy.”

In class they broke into the pro and con teams (randomly) and were tasked with finding 5 main topics and to break into groups to develop good quotes from their sources about their topic. Each group in the main debate was responsible for presenting one new idea and rebutting one idea from the other side. The debate ran: pro new idea, con rebuttal, con new idea, pro rebuttal repeat.

I mostly enforced the rule that when they presented they had to basically just read from their sources. This really worked well! My only complaint is that they didn’t really attack each others’ sources’ authenticity.

I graded the efforts with 50% of the points for turning in their annotated sources (making clear which quotes they used) and 50% based on a reflection paragraph on who won and how the authenticity of the sources affected the debate (the consensus was that it didn’t).

What If blog post

I told them to familiarize themselves with Randall Monroe’s What If blog and to prepare a blog post of their choosing. I’ve graded the first drafts so far and they’re all doing some pretty interesting things, ranging from picking on Trump through ice in place of sidewalks to having all cats disappear. I’m encouraging them to really take things to as many new levels as they can. They’ve got some work to do on future drafts, including drawing some funny/ironic cartoons, but I’m really excited about where this is going.

10 100 word assignment

Borrowing again from Randall Monroe, I’m asking them to submit an explanation of a scientific or technical things using the 10 100 most used words in the English language. That’s what they’re doing peer editing on as I type this post.

We talked about the analogy between a scientist needing to change her vocabulary when talking with the general public and them having to do this assignment. We talked about possibly allowing a glossary where they could introduce new words that must be defined using the 10 100 words.

Lateral thinking

Lateral thinking puzzles are those party games where you lay out a situation and the audience has to ask yes/no questions to determine the whole story. Here’s an easy one: 5 pieces of coal, a carrot, and a scarf and found on a lawn. There’s a logical reason why they’re there, what is it? The answer is that a snowman melted.

I’m using them sparingly (ok, I did 3 of them today) because I think they are good practice for the questions they need to ask themselves during their mythbusting explorations. To do well at lateral thinking puzzles you have to constantly question your assumptions and double check what you think you know. Sound familiar? I think it’s quite similar to the traits of good scientists!

Ok, that’s all I’ve got for now. It’s a fun class, though the grading is killing me. Do you have any thoughts? Here are some starters for you:

  • I’m in this class and I really love ____ and here’s why.
  • I’m in this class and I really hate ____ and here’s why.
  • Why don’t you say the 1000 most used words instead of ten hundred?
  • What rubric do you use for assessing these writing assignments?
  • Wait, where’s the Mathematica assignmen? (that’s for Rhett as long-time readers will recognize)
  • What if they make a different assumption during the estimation day than your google search that provides the so-called “actual number?”
  • I think lateral thinking is not a good analogy for problem solving and here’s why. Instead you should ____.
  • How much is Monroe paying you? (He probably doesn’t actually like me very much.)
  • I hear you’re moving into the Dean’s office. Are you just mailing this course in?
Posted in syllabus creation, teaching, Uncategorized | 2 Comments

Physics majors practice presentations

For years we’ve been working to give our physics majors opportunities to improve their presentation skills. We do a lot of oral exams but we also want our students to do well in more formal settings. We have a junior/senior seminar that the students take for 4 semesters, and they have to present in three of them. For their first one (fall of their junior year typically) we don’t want them to stress out over physics content so, assuming they don’t have a research project to report on, we tell them to give us a short presentation on a general physics concept that they understand well. This post is my thinking on how to improve that.

Typically students pick something like a projectile problem and they present it kind of like a mix between an oral exam and a mock teaching situation. The former is weird because it’s usually a really easy problem (for juniors) and the latter is problematic because that kind of presentation tends not to be how we’d choose to teach the material (no interactivity, for example). Normally we end with some token physics criticism/question but them concentrate on suggestions for how they could present better.

My biggest problem with this setup is how fake it is. It’s not the type of presentation they’ll likely be giving in the future. Then they’d much more likely be talking about a data-driven decision or conclusion they’ve reached. They likely wouldn’t be defending their understanding of a simple concept and they certainly shouldn’t be teaching like that (mostly dark room, only one person talking, etc).

So my current idea is to have them still have a pretty safe and easy thing to prepare but to have it be much more in the spirit of the types of presentations we’d like to see from them. I thought it might be cool if they could present their data from a lab they’ve already done. It might be a simple lab from general physics or something, so likely none of us would be surprised by the outcome, but they could be asked to approach it as trying to convince someone of the conclusions they’ve drawn. We could then really help them focus on what aspects of the presentation need focus (well done data plots, clear explanation of any theory necessary, etc). We still might make minor physics criticisms or questions but we could focus on the presentation skills we really care about.

I figure we could ask students in their first one or two physics classes to pick the lab write up they are most proud of and we could keep it for them to hand back when their juniors. We could do that early in the semester so they could have time to get their presentations ready.

Your thoughts? Here are some starters for you:

  • I’m in this class and I like this plan a lot, here’s why . . .
  • I’m in this class and this is a stupid plan, here’s why . . .
  • Why not force them to do an actual experiment? You act like it’s only worth 0.5 credits or something.
  • Would this work for the labs that are more along the lines of verification labs (“yep, I get 9.8 m/s/s”)?
  • Why have them pick their best one? Maybe the lab instructor should pick it
  • Maybe you could make sure that no two students do the same lab. Here’s how I’d set that up . . .
  • I like presentations based on ________ better, here’s why . . .
Posted in syllabus creation, teaching | 5 Comments

Wasted 10 minute quiz

These days I do a daily quiz for my students. It’s a problem randomly selected from the three problems assigned last time (unless it’s a review day, then it’s randomly selected from the previous 2 days). These are typically deep, rich problems so the only way you could do them in 10 minutes is to have really worked on them ahead of time. I usually add some twists or turn them inside out but, basically, if they’ve worked on them and really understood the material they should be doable. The problem is there’s a noticeable minority of students who do very poorly on these quizzes. They get bad scores (1’s or 2’s on my 4-point scale) and spend a large amount of the 10 minutes just sitting there with a defeated look on their face. So I’m trying to brainstorm other approaches and would love it if you, kind reader, could chime in.

Learn their lesson

Option one is just do nothing and hope that they learn their lesson eventually. Perhaps enough 1’s and 2’s will get them to realize they really should work harder (or perhaps differently) on these problems.

Because I use a Standards-Based Grading approach they know they can repair their grade by turning something in later so there’s not a lot of pressure to perform in class. Of course many of these students pile up a lot of 1’s and 2’s and tend to fall far enough behind that my two week rule gets them in trouble.

I guess what I’m feeling right now (facing the prospect of (once again) turning in lots of F’s for midterm grades) is that the lessons aren’t being learned.

Remind them to ask for help

I could remind them that since the quiz grade doesn’t set in stone that standard’s score, if they feel like they’re likely to get a 1 or a 2 they could try to explain on their quiz what they’re struggling with. When this happens now, admittedly rarely, I tend to either give that person some feedback on their quiz paper, send them a video, or send the whole class a video with some explanation. I think in the smaller classes that I could handle this scaling up a little and I think I’d understand better where the students are at than grading a crappy quiz performance.

I think if I didn’t stay on top of it and continue to give personalized feedback, students would likely stop writing a whole lot and instead continue to use their 10 minutes in class to do other things (with a defeated look on their face).

Show them something else

I was brainstorming with a student who’s in class with me right now about what would work better for him on days when he doesn’t really know how to start the quiz. I asked him about the notion laid out above and he thought that seemed reasonable. Then we started to brainstorm this new notion. Maybe I could give students a choice: either take the quiz or come with me to another room where I’d do some additional instruction on the topic. Maybe that could just be me trying to articulate every thought in my head as I try to do the quiz.

I’m definitely attracted to this if only to avoid looking out and seeing defeated faces. On the down side I feel like this sort of direct instruction 1) makes the students feel like they’re learning, but 2) doesn’t really help their learning. It reminds me of the students who say “I own the solution manual but I don’t use it to do my homework. Instead I love to study from it much more than struggling over any suggested exercises.” I’ve never actually believed students when they say that (not the first part, the second part). I think they look at well solved problems and dutifully nod their heads saying “oh yeah . . . of course . . . yep that’s right” instead of what we want our students to be thinking: “hmmm … not sure… oh wait  … let me try … ooh, now I know!”

I’m also not sure if students would tend to make the right choice (for them) when offered to either take the quiz or come with me. I guess I’m not sure what to think.

Your thoughts? Here are some starters for you:

  • What does “turn them inside out” mean?
  • I like the _____ option but not the ____ option because . . .
  • Why do you do quizzes at all? Instead you should . . .
  • I’m in this class and this post is great because . . .
  • I’m in this class and I hate this post because . . .
  • Wait, how do they use Mathematica during their quizzes?
  • I study from worked examples all the time. Why are you criticizing me?
  • That’s not what I think should be going through students heads when working problems. Instead I’d like to see  . . .
Posted in syllabus creation, teaching, Uncategorized | 11 Comments

Interactive arduino internet-of-things

I’ve written before about my Math and Computational Methods for Physicist course and how we’re doing a cool Arduino-based Internet of Things project. I’ve been brainstorming some new things we might do with that project and I wanted to see if you, dear reader, might have some suggestions/observations/complaints/whatever.

First an update on the database and our prototype. I haven’t added much to the database. Really only a dashboard list for the admin (me) showing the total number of measurements for each machine and when the last measurement was. It turns out that even though I fixed the pretty common wifi freeze with the watchdog approach, it still goes down about twice a week. I’m not really sure what’s up with that. The most recent time it happened I didn’t notice for about a day so when I went to look at it I noticed it was pretty hot. Unplugging it for 10 seconds or so and then replugging it seems to have fixed it for now. Any thoughts on how I can figure out what causes those very intermittent problems would be greatly appreciated. The class has devoted one lab to Arduinos so far and they all got to the point where they were measuring and calibrating temperature and controlling an LED. Pretty good for 90 minutes. We meet again about it this coming week when I’m hoping they’ve all found a “client” that they can program the arduino for.

Using a clock

The first new idea is to deal with client requests that are time-based. Something like “every night at midnight check the XXXX and report” as opposed to what we already have: “every Y minutes do something.” The arduino has a millisecond timer on it, but you can’t trust it to know in absolute terms what time it is. So at first I thought we couldn’t handle those requests. But then I remembered that we have a working wifi card on all of these! I figure we can just have it check the absolute time on some time server somewhere and at most be off by Y minutes. That’ll likely satisfy those sorts of clients (at least I hope so).


Already a few potential clients have asked for things like “every time the door opens measure XXX and report.” If they can handle a resolution of Y minutes, then we’re all set. Otherwise we’ll have to use the built-in interrupt stuff for arduinos. Then if the door opens an interrupt will be thrown and we’ll execute the whole “measure XXX and hook up to the internet” code.

Make a measurement if we say so

This is the one that I would really like some advice on. Some students and I were brainstorming how we might communicate to the arduino to make a measurement. Really this would be an extension of the “using a clock” idea above. We’re thinking of updating the database web site so that the owner of the machine (which is currently defined as the person who most recently updated the code for that machine) could update a page with something like “yes” or “no” returned so that the machine would check that page first (every Y minutes, say) before deciding whether to do anything else. We could, of course, get more complicated with various messages triggering lots of different responses from the machine. The limit would be the storage on the arduino (20 totally different codes stored might not be possible, for example) but I think we can still do some cool stuff.

I guess my question is: is this the right way to go about it? I read a lot about making the arduino basically a web page server so that you can go to it and ask for things. That’s the bulk of the pages you get if you search for “arduino internet of things” so I know it’s pretty popular. My problem is that it seems like it’s asking the arduino to do quite a lot, and essentially be fully on (as opposed to a boring “pause” loop) all the time. I figure this approach saves a lot of that, but maybe I’m missing something.

So, we’d love your help. If you have any ideas/hare-brained-schemes/concerns/anecdotes/love-letters-to-mathematica let us know in the comments below. Here are some starters for you:

  • I’m in this class and I’m really excited about this project. What Andy forgot to add was . . .
  • I’m in this class and I hate it. What I’d love is if someone made it clear to Andy that this is a dumb project so we don’t have to do it.
  • I’m in the HUWebApps group that Andy talked about here and I think this could be some fun work for us. One thought I had was . . .
  • I think these new ideas are really cool. One thing I’d be a little worried about is . . .
  • I think that some of these ideas are really bad, damage-people-for-life bad! Here’s a better way to go about it . . .
  • I’ve done some similar work <snark>thanks for linking to me</snark> and I’d suggest you read this, this, and this.
  • I run my arduino as a web server and it works great! You should really switch because . . .
  • I run my arduino as a web server and it sucks! I’m thinking of switching to how you do it, can I use your database?
Posted in arduino, HUWebApps | 6 Comments