Part 1
Copy and paste the following GlowScript code into your own GlowScript account. Read through the code and predict what might happen during the simulation
Part 2
Conceptual Physics Claim, Evidence, and Reasoning (C.E.R.):
GlowScript 2.7 VPython get_library('https://rawgit.com/perlatmsu/physutil/master/js/physutil.js') rom __future__ import division from visual import * from visual.graph import * #Window setup scene.range = 7e7 scene.width = 1024 scene.height = 760 #Objects Earth = sphere(pos=vector(0,0,0), radius=6.4e6, texture=textures.earth) Satellite = sphere(pos=vector(6.6*Earth.radius, 0,0), radius=1e6, color=color.orange, make_trail=True) #Parameters and Initial Conditions mSatellite = 15000 pSatellite = vector(30000000,0,0) G = 6.67e-11 mEarth = 5.98e24 r = (Earth.pos - Satellite.pos) g1 = gcurve(color=color.cyan,label="kinetic energy") g2 = gcurve(color=color.red,label="gravitational energy") #Time and time step t = 0 tf = 60*60*24*10 dt = 1 graphv = gdisplay(xmin=-0.25, xmax=1.25, ymin=-12e10, ymax=12e10, ytitle="Energy") g3 = gvbars(gdisplay = graphv, color = color.red, delta = 0.2, label = "Kinetic Energy") g4 = gvbars(gdisplay = graphv, color = color.blue, delta = 0.2, label = "Potential Energy") #MotionMap/Graph pSatelliteMotionMap = MotionMap(Satellite, tf, 200, markerScale=0.2, markerColor=color.blue, labelMarkerOrder=False) #Calculation Loop ev = scene.waitfor('click') while t < tf: rate(6000) g3.delete() g4.delete() Fnet = vector(0,0,0) r = (Earth.pos - Satellite.pos) Fnet = vector(G*mEarth*mSatellite/(mag(r)**2)*(r/mag(r))) pSatellite = pSatellite + Fnet*dt Satellite.pos = Satellite.pos + (pSatellite/mSatellite)*dt if mag(Satellite.pos) < Earth.radius: text(text='You Crashed!!', pos=vec(0, 4e7, 0), color = color.red, depth=1, height= 7e6) break pSatelliteMotionMap.update(t, pSatellite) t = t + dt KE = 1/2*mSatellite*mag(pSatellite/mSatellite)**2 PE = -G*mSatellite*mEarth/mag(r) g1.plot(t, KE) g2.plot(t, PE) g3.plot(0, KE) g4.plot(0.5, PE) #Earth Rotation (IGNORE) theta = 7.29e-5*dt Earth.rotate(angle=theta, axis=vector(0,0,1), origin=Earth.pos)
—-
Part 1
Part 2
GlowScript 2.7 VPython get_library('https://rawgit.com/perlatmsu/physutil/master/js/physutil.js') rom __future__ import division from visual import * from visual.graph import * #Window setup scene.range = 7e7 scene.width = 1024 scene.height = 760 #Objects Earth = sphere(pos=vector(0,0,0), radius=6.4e6, texture=textures.earth) Satellite = sphere(pos=vector(6.6*Earth.radius, 0,0), radius=1e6, color=color.orange, make_trail=True) #Parameters and Initial Conditions mSatellite = 1000 pSatellite = vector(-1500*mSatellite,2598*mSatellite,0) G = 6.67e-11 mEarth = 5.98e24 r = (Earth.pos - Satellite.pos) g1 = gcurve(color=color.cyan,label="kinetic energy") g2 = gcurve(color=color.red,label="gravitational energy") g3 = gcurve(color=color.green,label="total mechanical energy") #Time and time step t = 0 tf = 60*60*24*10 dt = 1 graphv = gdisplay(xmin=-0.25, xmax=1.25, ymin=-12e10, ymax=12e10, ytitle="Energy") g4 = gvbars(gdisplay = graphv, color = color.red, delta = 0.2, label = "Kinetic Energy") g5 = gvbars(gdisplay = graphv, color = color.blue, delta = 0.2, label = "Potential Energy") g6 = gvbars(gdisplay = graphv, color = color.green, delta = 0.2, label = "Total Energy") #MotionMap/Graph FSatelliteMotionMap = MotionMap(Satellite, tf, 200, markerScale=4000, labelMarkerOrder=False) pSatelliteMotionMap = MotionMap(Satellite, tf, 200, markerScale=0.2, markerColor=color.blue, labelMarkerOrder=False) #Calculation Loop ev = scene.waitfor('click') while t < tf: rate(6000) g4.delete() g5.delete() g6.delete() Fnet = vector(0,0,0) r = (Earth.pos - Satellite.pos) Fnet = vector(G*mEarth*mSatellite/(mag(r)**2)*(r/mag(r))) pSatellite = pSatellite + Fnet*dt Satellite.pos = Satellite.pos + (pSatellite/mSatellite)*dt if mag(Satellite.pos) < Earth.radius: text(text='You Crashed!!', pos=vec(0, 4e7, 0), color = color.red, depth=1, height= 7e6) break FSatelliteMotionMap.update(t, Fnet) pSatelliteMotionMap.update(t, pSatellite) t = t + dt KE = 1/2*mSatellite*mag(pSatellite/mSatellite)**2 PE = G*mSatellite*mEarth/mag(r) g1.plot(t, KE) g2.plot(t, PE) g3.plot(t, KE+PE) g4.plot(0, KE) g5.plot(0.5, PE) g6.plot(1.0, KE+PE) #Earth Rotation (IGNORE) theta = 7.29e-5*dt Earth.rotate(angle=theta, axis=vector(0,0,1), origin=Earth.pos)
—-