Who’s gone overboard modeling w/ Python? Part II – Gravitation

I was working on orbits and gravitation with my AP Physics B students, and as has always been the case (including with me in high school), they were having trouble visualizing exactly what it meant for something to be in orbit. They did well calculating orbital speeds and periods as I asked them to do for solving problems, but they weren’t able to understand exactly what it meant for something to be in orbit. What happens when it speeds up from the speed they calculated? Slowed down? How would it actually get into orbit in the first place?

Last year I made a Geogebra simulation that used Euler’s method  to generate the trajectory of a projectile using Newton’s Law of Gravitation. While they were working on these problems, I was having trouble opening the simulation, and I realized it would be a simple task to write the simulation again using the Python knowledge I had developed since. I also used this to-scale diagram of the Earth-Moon system in Geogebra to help visualize the trajectory.

I quickly showed them what the trajectory looked like close to the surface of the Earth and then increased the launch velocity to show what would happen. I also showed them the line in the program that represented Newton’s 2nd law – no big deal from their reaction, though my use of the directional cosines did take a bit of explanation as to why they needed to be there.

I offered to let students show their proficiency on my orbital characteristics standard by using the program to generate an orbit with a period or altitude of my choice. I insist that they derive the formulae for orbital velocity or period from Newton’s 2nd law every time, but I really like how adding the simulation as an option turns this into an exercise requiring a much higher level of understanding. That said, no students gave it a shot until this afternoon. A student had correctly calculated the orbital speed for a circular orbit, but was having trouble configuring the initial components of velocity and position to make this happen. The student realized that the speed he calculated through Newton’s 2nd had to be vertical if the initial position was to the right of Earth, or horizontal if it was above it. Otherwise, the projectile would go in a straight line, reach a maximum position, and then crash right back into Earth.

The other part of why this numerical model served an interesting purpose in my class was as inspired by Shawn Cornally’s post about misconceptions surrounding gravitational potential and our friend mgh. I had also just watched an NBC Time Capsule episode about the moon landing and was wondering about the specifics of launching a rocket to the moon. I asked students how they thought it was done, and they really had no idea. They were working on another assignment during class, but while floating around looking at their work, I was also adjusting the initial conditions of my program to try to get an object that starts close to Earth to arrive in a lunar orbit.

Thinking about Shawn’s post, I knew that getting an object out of Earth’s orbit would require the object reaching escape velocity, and that this would certainly be too fast to work for a circular orbit around the moon. Getting the students to see this theoretically was not going to happen, particularly since we hadn’t discussed gravitational potential energy among the regular physics students, not to mention they had no intuition about things moving in orbit anyway.

I showed them the closest I could get without crashing:

One student immediately noticed that this did seem to be a case of moving too quickly. So we reduced the initial velocity in the x-direction by a bit. This resulted in this:

We talked about what this showed – the object was now moving too slowly and was falling back to Earth. After getting the object to dance just between the point of making it all the way to the moon (and then falling right past it) and slowing down before it ever got there, a student asked a key question:

Could you get it really close to the moon and then slow it down?

Bingo. I didn’t get to adjust the model during the class period to do this, but by the next class, I had implemented a simple orbital insertion burn opposite to the object’s velocity. You can see and try the code here at Github. The result? My first Earth – lunar orbit design. My mom was so proud.

The real power here is how quickly students developed intuition for some orbital mechanics concepts by seeing me play with this. Even better, they could play with the simulation themselves. They also saw that I was experimenting myself with this model and enjoying what I was figuring out along the way.

I think the idea that a program I design myself could result in surprising or unexpected output is a bit of a foreign concept to those that do not program. I think this helps establish for students that computation is a tool for modeling. It is a means to reaching a better understanding of our observations or ideas. It still requires a great amount of thought to interpret the results and to construct the model, and does not eliminate the need for theoretical work. I could guess and check my way to a circular orbit around Earth. With some insight on how gravity and circular motion function though, I can get the orbit right on the first try. Computation does not take away the opportunity for deep thinking. It is not about doing all the work for you. It instead broadens the possibilities for what we can do and explore in the comfort of our homes and classrooms.

2 thoughts on “Who’s gone overboard modeling w/ Python? Part II – Gravitation

  1. This is really cool. I love reminding students that the computers back when we went to the moon couldn’t really do any of this.

    I also really like how you’re talking about the connections between programming, modeling, and learning physics. When my students create a simulation that doesn’t “look right,” they are starting to realize that they need to think harder about the physics.

    I keep hearing people say things like “students don’t learn as much from simulations because they think you can make the computer do anything.” How do you think exposing them to programming helps with that?

    1. Thanks Andy – I completely agree that using a simulation is a process that demands that students do a bit more than get an answer. It’s hard sometimes to ask students to do analysis of their answer (does your answer make sense?) but it’s easy to have a conversation about whether a model fits observations or measurements or not.

      I think there are a few approaches to counter the argument about how computers can be programmed to do anything. The first is that the computer model is not creating results that exist independently of the real world. The program isn’t inventing laws of physics – instead we are using what we understand about the laws of physics to construct a computer model. The next step – and this MUST be the next step if this argument is to work – is to compare those results to observations. If the model is a good one, the computer model must behave in a way similar to what is observed. If this comparison isn’t done, then the abstraction of the computer model never becomes more than one more abstract idea, divorced from reality, that students collect during their education. There must be a connection between the model and the physical world for it to be valuable work.

      I had students adjust the constant velocity model I gave them to match a moving car, essentially the buggy lab that comes from the Modeling Instruction curriculum. There is a lot of really good thinking that happens during that matching process that doesn’t happen as naturally as when attempting to do it with graphs and equations. The computer model is describing what is happening to this real world object, and student can see the similarities.

      I first learned about some of the details about computer models during a summer internship in college. I was working with some scientists working in microgravity science, and picked up on a general sense among these scientists that the only way to study certain phenomena was to do simulation. Trying to investigate things like capillary flows, for example, in 1-g is almost pointless in some situations because gravity dominates. I was having a conversation with the head of the center about what I was learning, and he seemed irritated when I seemed parroted back some of what he clearly heard from his scientists about simulation and its role. His comment was really interesting.

      He said something along the lines that people always talk about having to study fluid dynamics in microgravity because gravity ‘hides’ things. Gravity doesn’t hide anything. Gravity is an observable phenomenon just as surface tension, convection, and the other things that people tend to obsess about in microgravity. The utility of these simulations ends when they stop producing results that can actually be verified by experiment or observation. Saying that a computer model shows a phenomenon that can only be verified by placing an experiment in space for a year requires a lot of trust in the model itself, and that model should do a good job of predicting what is happening in gravity as well before funding the project with thousands of dollars. (He is a well known fluid physicist that had an experiment investigating both surface tension and convection fly on the shuttle a couple times. It was pretty cool to hear him talk this way about his own field.)

      It’s true that you can design a simulation that does not follow Newton’s laws, and then perhaps convince students that it is correct. That is dangerous. Putting the model first and never exposing it to reality is the major danger of using it in teaching. It’s hard to ignore when a simulation seems to contradict what one’s own eyes observe. As long as we make comparison with reality an integral component of our use of simulation in teaching, it will be valuable for learning.

Leave a Reply

Your email address will not be published. Required fields are marked *