Laboratory Exercise

Kepler's Laws and Orbits
Today you will write a GeoGebra simulation of planetary orbits. You will learn a lot about GeoGebra and will write your own numerical methods to calculate the orbital trajectory rather than using the built-in NsolveODE command. It will be more instructive this way, and will perhaps also be easier in the end. There are many things you will need to learn about programming in general and GeoGebra in particular, but none of them is very hard.[br][br]We will analyze the shape of orbits (1st law), the law of areas (2nd law) and the law of periods (3rd law) in the course of our lab. GeoGebra has some excellent tools for doing these things in a way that is both easy and is visual, which I believe helps drive the point home.
Part 1
[list=1][*]Open GeoGebra and place a point at the origin. Right click its properties and make it look like the sun by using appropriate color and maybe making the dot bigger. Also label it "sun" and display that label.[/*][*]Make a point by typing E=(1,0). I used "E" because it will represent earth. Make it blue and keep it fairly small.[/*][*]Create a vector v=(0,1). Right click the vector once it's created and change the position tab to E. This creates a velocity vector attached to the earth. This vector is not only there to make things pretty, but will be part of our calculation.[/*][*]Type dt=0.1. This will be the time step in our model between the kinematics calculations. It is really representing [math]\Delta t=0.1[/math], but due to limitations on use of Greek letters in scripting, we can't use the greek delta. The idea of dt is that we will assume for the sake of the kinematics that the kinematic variables are constants over the duration dt=0.1. This will allow us to make approximations like [math]\Delta \vec{r}=\int \vec{v}\;dt \approx \vec{v}\;\Delta t.[/math] Of course this will only be accurate so long as [math]\Delta t=0.1[/math] is sufficiently small as compared to the period of the orbit. [/*][*]Type t=0 and press enter. Create a slider and adjust its properties to min value of 0, max value of 50, step size [math]dt=0.1.[/math][/*][*]Still within the properties dialog for "t", go to the "scripting" tab and the "on update" sub-tab. In there you will want to update the position of the earth and the value of the velocity vector. For example, you could update the position of a point named "B" by typing B=B+(1,0). The way to understand this statement is that we are redefining B based on its own current value plus some change. The statement adds the vector (1,0) to the point's position and redefines the point to have that new position. Use the kinematic approximation of displacement mentioned above to update the earth's position by using its velocity vector in this way for each time a duration dt ticks by.[/*][*]Just below that position update line in the scripting tab, you must correspondingly update the velocity vector. This will require a gravitational force equation. We will not worry about the masses or the value of G in this lab. The gravitation equation then can be thought of as [math]\vec{F}_{1,2}=-\frac{(\vec{r}_1-\vec{r}_2)}{|\vec{r}_1-\vec{r}_2|^3}.[/math] Think of object "1" as earth. Recall that object 2 is the sun and is at the origin. That should simplify your calculation. Also recall that the function [code]length[] [/code]will give the magnitude of a vector. [/*][*]Create a button by clicking the drop down menu of the [icon]/images/ggb/toolbar/mode_slider.png[/icon] icon. Label the button "Reset". Inside, type in three separate lines: t=0, E=(1,0), v=(0,1). Now click on the [icon]/images/ggb/toolbar/mode_move.png[/icon] icon.[/*][*]Right click on the point representing earth and turn the trace on.[/*][*]Click the reset button.[/*][*]Right click the time slider and turn animation on.[/*][*]At this point earth should start moving if all went well. Q1: What is the shape of the orbit?[/*][*]We want to record the points that make up the orbit so that they can be analyzed. Reset your model, open the spreadsheet view, go to the point E on the left and right click and select "record to spreadsheet". Use the right arrow key and update - by separate key presses - the value of time until one complete orbit is made. Then click on the red record icon at the top of the spreadsheet columns to end recording. [/*][*]Create a new point using the [icon]/images/ggb/toolbar/mode_point.png[/icon] tool somewhere within your planet's orbit to represent a second focus of an ellipse (besides the sun) so that we can fit the ellipse to the orbit.[/*][*]Create a variable named 'a' by typing a=1. This will represent the orbit's semi-major axis.[/*][*]Create an ellipse with two foci (the sun and the new point A) with a semi-major axis equal to 'a'. To do this, use the ellipse function (in the input bar). Choose the first form. [/*][*]Highlight the values in the spreadsheet (both columns) and right click. Choose create/list of points. [/*][*]Now adjust the value of a and the position of the new point A until the ellipse matches the points representing the planetary orbit. [br][/*][*]Record the values of 'a' and the new point's position and using the text tool, print them in the graphics view. Also make sure the period of your orbit (value of t to complete the orbit) is recorded in the graphics view. You can print pretty subscripts using the Latex option.[/*][*]Using the points in your orbit, make two areas with the polygon tool to test the law of areas. Make sure the two areas sweep out an equal amount of time (same number of points included). The area function will calculate the area of the polygons. Show the areas of those polygons with settings for 3 significant figures so we can see that they are equal areas to good precision. [/*][*]Repeat these for two other initial velocities: v=(0,1.2) and v=(0,0.8) to show that these results do not depend on any particular parameters of the orbit.[/*][*]For each of your three orbits, calculate the ratio of [math]T^2/a^3[/math] where 'a' is the semi-major axis of the orbit and 'T' is its period. Please include this data in your lab report.[/*][/list]
Questions
[list=1][*]What is the point of fitting the orbits with ellipses?[/*][*]What is the eccentricity of each of your orbits? Recall that eccentricity is e=2c/2a, where 2c is the distance between the foci and 2a is twice the semi-major axis length.[/*][*]Based on the law of areas, where in the orbit does the planet travel fastest? Slowest?[/*][*]Does the mass of the planet affect its orbital period?[/*][/list]

Information: Laboratory Exercise