<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.physicsbook.gatech.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MadelynHightower</id>
	<title>Physics Book - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://www.physicsbook.gatech.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=MadelynHightower"/>
	<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/Special:Contributions/MadelynHightower"/>
	<updated>2026-05-17T02:27:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.7</generator>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=28197</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=28197"/>
		<updated>2017-04-09T21:33:58Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Edited by Madelyn Hightower- Spring 2017 &lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
This page discusses basic functioning of vPython and how the program can be used to produce models. While vPython is rather similar to the normal Python and uses the same syntax, vPython is an extension of Python and allows users to produce 3D models. It is frequently used for educational purposes, however it has also been used in research to help scientists visualize 3D models. &lt;br /&gt;
VPython, if used correctly, can be very helpful in learning new concepts in courses like physics, or helping to further study on models that may not be easy to create in real life.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
Before learning how to code vPython, the first step is to download the proper application. If interested, before downloading vPython, glow script is a great resource to practice using vPython. Glow script also creates 3D models and run programs just like vPython, so it is a great resource to try out.&lt;br /&gt;
&lt;br /&gt;
To download vPython, first either install Continuum Anaconda Python Distribution. Choose from either the Anaconda with Python 3.x  (this form is recommended on vypthon.org, especially if &amp;quot;Classic&amp;quot; VPython/Python 2.7 has previously been installed on the device.) &lt;br /&gt;
&lt;br /&gt;
In order to access the necessary download, use this link: [https://www.python.org/downloads/]&lt;br /&gt;
&lt;br /&gt;
For windows, then go to the Power Shell or Command Prompt and type &amp;quot; pip install vpython &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For macs,  go to Terminal and type &amp;quot; pip install vypython &amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Vpython will then be successfully downloaded onto the device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mathematical Model==&lt;br /&gt;
Vpython can compute any equation, but some that may be most helpful and most useful for Physics can be found below. (Keep in mind you can alter these numbers to be whatever you need, these are just to provide an example): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Always start vPython windows with:&lt;br /&gt;
&lt;br /&gt;
from__future__ import division&lt;br /&gt;
&lt;br /&gt;
from visual import*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update momentum:&lt;br /&gt;
&lt;br /&gt;
pf = pi + Fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update position:&lt;br /&gt;
&lt;br /&gt;
objectf.pos = objecti.pos + (pcart/mcart)*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a vector:&lt;br /&gt;
&lt;br /&gt;
vector(0,0,0) -- fill in with whatever numbers the vector should be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gravitational Force:&lt;br /&gt;
&lt;br /&gt;
CONSTANTS&lt;br /&gt;
&lt;br /&gt;
G = 6.7e-11&lt;br /&gt;
&lt;br /&gt;
mEarth = 6e24&lt;br /&gt;
&lt;br /&gt;
mcraft = 15e3&lt;br /&gt;
&lt;br /&gt;
deltat = 60&lt;br /&gt;
&lt;br /&gt;
t = 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finds the change in position:&lt;br /&gt;
&lt;br /&gt;
r=craft.pos-Earth.pos  &lt;br /&gt;
&lt;br /&gt;
m=mcraft&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To find the magnitude of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rmag= mag(r)      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the new magnitude of gravitational force:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fmag=(G*mcraft*mEarth)/(rmag**2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the direction of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rhat=r/rmag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate net force:&lt;br /&gt;
&lt;br /&gt;
Fnet=-Fmag*rhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate spring force:&lt;br /&gt;
&lt;br /&gt;
L0 = 0.3 &lt;br /&gt;
&lt;br /&gt;
Lvec = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
Lhat = norm(Lvec)&lt;br /&gt;
&lt;br /&gt;
Lmag = mag(Lvec)&lt;br /&gt;
&lt;br /&gt;
Fspr = (-ks)*(Lmag - L0)*(Lhat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate kinetic energy:&lt;br /&gt;
&lt;br /&gt;
Kinetic = (1/2)*(mball*(vel**2))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a graph:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add plots to the graph:&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(t, fnet.y))  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Computational Model==&lt;br /&gt;
&lt;br /&gt;
VPython is used to create computational, 3D models of various real world situations in order to better visualize how different equations can manipulate different scenarios. This is very valuable since many of the equations and situations that are coded in vPython are extremely difficult to make a functioning model of in real life. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For instance, the picture below is an example of program that was programmed to show the orbit of a craft around Earth. &lt;br /&gt;
&lt;br /&gt;
[[File:Earthorbits.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This picture shows a graph that tracks.&lt;br /&gt;
[[File:PositionGraph.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Simple:&lt;br /&gt;
&lt;br /&gt;
Creating Shapes:&lt;br /&gt;
&lt;br /&gt;
Sphere:&lt;br /&gt;
&lt;br /&gt;
sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red)&lt;br /&gt;
&lt;br /&gt;
Arrow:&lt;br /&gt;
&lt;br /&gt;
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
Vector:&lt;br /&gt;
&lt;br /&gt;
vector=vector(0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
Trail:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=sphere.color)&lt;br /&gt;
&lt;br /&gt;
trail.append(pos=sphere.pos)&lt;br /&gt;
&lt;br /&gt;
Setting Scene Range:&lt;br /&gt;
&lt;br /&gt;
scene.range=11*sphere.radius&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Helix:&lt;br /&gt;
&lt;br /&gt;
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) &lt;br /&gt;
&lt;br /&gt;
Intermediate:&lt;br /&gt;
&lt;br /&gt;
Graphs:&lt;br /&gt;
&lt;br /&gt;
Setup graphing windows:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph = gcurve(color=color.yellow)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=300)&lt;br /&gt;
&lt;br /&gt;
Plotting:&lt;br /&gt;
&lt;br /&gt;
pgraph = gcurve(color=color.blue)&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(time, Fnet.y))&lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pos=(time, sphere.y))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Difficult:&lt;br /&gt;
&lt;br /&gt;
Using Loops to update Equations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CONSTANTS:&lt;br /&gt;
&lt;br /&gt;
G = ?&lt;br /&gt;
&lt;br /&gt;
mEarth = ?&lt;br /&gt;
&lt;br /&gt;
mmoon = ?&lt;br /&gt;
&lt;br /&gt;
mcraft = ?&lt;br /&gt;
&lt;br /&gt;
deltat = ?&lt;br /&gt;
&lt;br /&gt;
t = ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJECTS AND INITIAL VALUES:&lt;br /&gt;
&lt;br /&gt;
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
scene.range=11*Earth.radius&lt;br /&gt;
&lt;br /&gt;
Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white)&lt;br /&gt;
&lt;br /&gt;
Add a radius for the spacecraft. It should be BIG, so it can be seen:&lt;br /&gt;
&lt;br /&gt;
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow)&lt;br /&gt;
vcraft = vector(206, 2645,0)&lt;br /&gt;
pcraft = mcraft*vcraft&lt;br /&gt;
pArrow=arrow(color=color.green)&lt;br /&gt;
fArrow=arrow(color=color.cyan)&lt;br /&gt;
dpArrow=arrow(color=color.red)&lt;br /&gt;
Fnet_tangent_arrow = arrow(color=color.yellow)&lt;br /&gt;
Fnet_perp_arrow= arrow(color=color.magenta)&lt;br /&gt;
&lt;br /&gt;
This creates a trail for the spacecraft:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=craft.color)  &lt;br /&gt;
&lt;br /&gt;
And this prevents zooming in or out:&lt;br /&gt;
  &lt;br /&gt;
scene.autoscale = 0                 &lt;br /&gt;
pscale=Earth.radius/mag(pcraft)&lt;br /&gt;
fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2)&lt;br /&gt;
dpscale=500*Earth.radius/mag(pcraft)&lt;br /&gt;
print(&amp;quot;p=&amp;quot;, pcraft)&lt;br /&gt;
&lt;br /&gt;
CALCULATIONS:&lt;br /&gt;
&lt;br /&gt;
Sets time for loop to run:&lt;br /&gt;
&lt;br /&gt;
while t &amp;lt; 165240: &lt;br /&gt;
This slows down the animation (runs faster with bigger number):&lt;br /&gt;
    rate(10000)   &lt;br /&gt;
&lt;br /&gt;
     Add statements here for the iterative update of gravitational&lt;br /&gt;
    force, momentum, and position.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    r = craft.pos-Earth.pos&lt;br /&gt;
    rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2))&lt;br /&gt;
    Fmag= G*mEarth*mcraft/(rmag**2)&lt;br /&gt;
    rhat= r/rmag&lt;br /&gt;
    rmoon= craft.pos - Moon.pos&lt;br /&gt;
    rmoonmag= mag(rmoon)&lt;br /&gt;
    rmoonhat= norm(rmoon)&lt;br /&gt;
    Fmoonmag= G*mmoon*mcraft/(rmoonmag**2)&lt;br /&gt;
    Fmoon= -Fmoonmag*rmoonhat&lt;br /&gt;
    p_init= mag(pcraft)&lt;br /&gt;
    pcraft_i=pcraft+vector(0,0,0)&lt;br /&gt;
    Fearth= -Fmag*rhat&lt;br /&gt;
    Fnet= Fearth + Fmoon&lt;br /&gt;
    pcraft=Fnet*deltat+pcraft&lt;br /&gt;
    p_final=mag(pcraft)&lt;br /&gt;
&lt;br /&gt;
    Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat&lt;br /&gt;
    Fnet_tangent_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_tangent_arrow.axis=Fnet_tangent*fscale&lt;br /&gt;
    Fnet_perp = Fnet-Fnet_tangent&lt;br /&gt;
    Fnet_perp_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_perp_arrow.axis=Fnet_perp*fscale&lt;br /&gt;
    vcraft=pcraft/mcraft&lt;br /&gt;
    craft.pos=vcraft*deltat+craft.pos&lt;br /&gt;
    pArrow.pos=craft.pos&lt;br /&gt;
    pArrow.axis=pcraft*pscale&lt;br /&gt;
    fArrow.pos=craft.pos&lt;br /&gt;
    fArrow.axis=Fnet*fscale&lt;br /&gt;
    deltap= pcraft-pcraft_i&lt;br /&gt;
    dpArrow.pos=craft.pos&lt;br /&gt;
    dpArrow.axis=deltap*dpscale&lt;br /&gt;
    scene.center=craft.pos&lt;br /&gt;
    scene.range=craft.radius*600&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Uncomment these two lines to exit the loop if&lt;br /&gt;
   the spacecraft crashes onto the Earth.&lt;br /&gt;
&lt;br /&gt;
    if rmag &amp;lt; Earth.radius: &lt;br /&gt;
        break&lt;br /&gt;
&lt;br /&gt;
    trail.append(pos=craft.pos)  &lt;br /&gt;
    t = t+deltat&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
vPython codes are very useful in modeling situations that may not be easy to construct models of in real life. The ability to map out a real life scenario in code form and then be able to tweak that code and see how the situation changes is priceless to scientists and students alike. Being able to have a visual on VPython for something that may not be able to be easily modeled in real life is what helps make VPython so valuable. In relation to the field of Industrial Engineering, VPython could be useful in modeling different systems and seeing which conditions promote the most optimal results. The computer simulations that VPython produces can assist in production and end up saving companies time and money. In addition, Industrial Engineers use a lot of Python and so their background knowledge of Python makes VPython much more accessible to them. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
A cT language was created in 1997 and was based a language of the PLATO computer-based education system. In 2000 Ruth Chabay, David Scherer, and Bruce Sherwood develop VPython. This form of VPython would be later referred to as &amp;quot;Classic&amp;quot; VPython. From 2002 to 2006 an engineering student named Jonathan Brandmeyer helped make important contributions to VPython 3. As the years went on more and more changes were made in order to make VPython what it is today. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Extra Resources==&lt;br /&gt;
If having trouble while trying to use VPython it made be helpful to watch someone else code using it first. While I do not own any of the following videos, they may be helpful resources to watch in order to become more proficient in VPython. &lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=KbOyKOlWBrs]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=jLHS0ZvYE5Y]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/history.html]&lt;br /&gt;
&lt;br /&gt;
[https://wiki.python.org/moin/VPython]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/experienced.html]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/announcements/get-vpython.html]&lt;br /&gt;
&lt;br /&gt;
[https://matterandinteractions.wordpress.com/2016/04/27/a-time-line-for-vpython-development/]&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=28196</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=28196"/>
		<updated>2017-04-09T21:32:38Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Claimed by Madelyn Hightower- Spring 2017 &lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
This page discusses basic functioning of vPython and how the program can be used to produce models. While vPython is rather similar to the normal Python and uses the same syntax, vPython is an extension of Python and allows users to produce 3D models. It is frequently used for educational purposes, however it has also been used in research to help scientists visualize 3D models. &lt;br /&gt;
VPython, if used correctly, can be very helpful in learning new concepts in courses like physics, or helping to further study on models that may not be easy to create in real life.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
Before learning how to code vPython, the first step is to download the proper application. If interested, before downloading vPython, glow script is a great resource to practice using vPython. Glow script also creates 3D models and run programs just like vPython, so it is a great resource to try out.&lt;br /&gt;
&lt;br /&gt;
To download vPython, first either install Continuum Anaconda Python Distribution. Choose from either the Anaconda with Python 3.x  (this form is recommended on vypthon.org, especially if &amp;quot;Classic&amp;quot; VPython/Python 2.7 has previously been installed on the device.) &lt;br /&gt;
&lt;br /&gt;
In order to access the necessary download, use this link: [https://www.python.org/downloads/]&lt;br /&gt;
&lt;br /&gt;
For windows, then go to the Power Shell or Command Prompt and type &amp;quot; pip install vpython &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For macs,  go to Terminal and type &amp;quot; pip install vypython &amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Vpython will then be successfully downloaded onto the device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mathematical Model==&lt;br /&gt;
Vpython can compute any equation, but some that may be most helpful and most useful for Physics can be found below. (Keep in mind you can alter these numbers to be whatever you need, these are just to provide an example): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Always start vPython windows with:&lt;br /&gt;
&lt;br /&gt;
from__future__ import division&lt;br /&gt;
&lt;br /&gt;
from visual import*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update momentum:&lt;br /&gt;
&lt;br /&gt;
pf = pi + Fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update position:&lt;br /&gt;
&lt;br /&gt;
objectf.pos = objecti.pos + (pcart/mcart)*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a vector:&lt;br /&gt;
&lt;br /&gt;
vector(0,0,0) -- fill in with whatever numbers the vector should be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gravitational Force:&lt;br /&gt;
&lt;br /&gt;
CONSTANTS&lt;br /&gt;
&lt;br /&gt;
G = 6.7e-11&lt;br /&gt;
&lt;br /&gt;
mEarth = 6e24&lt;br /&gt;
&lt;br /&gt;
mcraft = 15e3&lt;br /&gt;
&lt;br /&gt;
deltat = 60&lt;br /&gt;
&lt;br /&gt;
t = 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finds the change in position:&lt;br /&gt;
&lt;br /&gt;
r=craft.pos-Earth.pos  &lt;br /&gt;
&lt;br /&gt;
m=mcraft&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To find the magnitude of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rmag= mag(r)      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the new magnitude of gravitational force:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fmag=(G*mcraft*mEarth)/(rmag**2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the direction of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rhat=r/rmag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate net force:&lt;br /&gt;
&lt;br /&gt;
Fnet=-Fmag*rhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate spring force:&lt;br /&gt;
&lt;br /&gt;
L0 = 0.3 &lt;br /&gt;
&lt;br /&gt;
Lvec = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
Lhat = norm(Lvec)&lt;br /&gt;
&lt;br /&gt;
Lmag = mag(Lvec)&lt;br /&gt;
&lt;br /&gt;
Fspr = (-ks)*(Lmag - L0)*(Lhat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate kinetic energy:&lt;br /&gt;
&lt;br /&gt;
Kinetic = (1/2)*(mball*(vel**2))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a graph:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add plots to the graph:&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(t, fnet.y))  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Computational Model==&lt;br /&gt;
&lt;br /&gt;
VPython is used to create computational, 3D models of various real world situations in order to better visualize how different equations can manipulate different scenarios. This is very valuable since many of the equations and situations that are coded in vPython are extremely difficult to make a functioning model of in real life. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For instance, the picture below is an example of program that was programmed to show the orbit of a craft around Earth. &lt;br /&gt;
&lt;br /&gt;
[[File:Earthorbits.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This picture shows a graph that tracks.&lt;br /&gt;
[[File:PositionGraph.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Simple:&lt;br /&gt;
&lt;br /&gt;
Creating Shapes:&lt;br /&gt;
&lt;br /&gt;
Sphere:&lt;br /&gt;
&lt;br /&gt;
sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red)&lt;br /&gt;
&lt;br /&gt;
Arrow:&lt;br /&gt;
&lt;br /&gt;
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
Vector:&lt;br /&gt;
&lt;br /&gt;
vector=vector(0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
Trail:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=sphere.color)&lt;br /&gt;
&lt;br /&gt;
trail.append(pos=sphere.pos)&lt;br /&gt;
&lt;br /&gt;
Setting Scene Range:&lt;br /&gt;
&lt;br /&gt;
scene.range=11*sphere.radius&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Helix:&lt;br /&gt;
&lt;br /&gt;
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) &lt;br /&gt;
&lt;br /&gt;
Intermediate:&lt;br /&gt;
&lt;br /&gt;
Graphs:&lt;br /&gt;
&lt;br /&gt;
Setup graphing windows:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph = gcurve(color=color.yellow)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=300)&lt;br /&gt;
&lt;br /&gt;
Plotting:&lt;br /&gt;
&lt;br /&gt;
pgraph = gcurve(color=color.blue)&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(time, Fnet.y))&lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pos=(time, sphere.y))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Difficult:&lt;br /&gt;
&lt;br /&gt;
Using Loops to update Equations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CONSTANTS:&lt;br /&gt;
&lt;br /&gt;
G = ?&lt;br /&gt;
&lt;br /&gt;
mEarth = ?&lt;br /&gt;
&lt;br /&gt;
mmoon = ?&lt;br /&gt;
&lt;br /&gt;
mcraft = ?&lt;br /&gt;
&lt;br /&gt;
deltat = ?&lt;br /&gt;
&lt;br /&gt;
t = ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJECTS AND INITIAL VALUES:&lt;br /&gt;
&lt;br /&gt;
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
scene.range=11*Earth.radius&lt;br /&gt;
&lt;br /&gt;
Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white)&lt;br /&gt;
&lt;br /&gt;
Add a radius for the spacecraft. It should be BIG, so it can be seen:&lt;br /&gt;
&lt;br /&gt;
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow)&lt;br /&gt;
vcraft = vector(206, 2645,0)&lt;br /&gt;
pcraft = mcraft*vcraft&lt;br /&gt;
pArrow=arrow(color=color.green)&lt;br /&gt;
fArrow=arrow(color=color.cyan)&lt;br /&gt;
dpArrow=arrow(color=color.red)&lt;br /&gt;
Fnet_tangent_arrow = arrow(color=color.yellow)&lt;br /&gt;
Fnet_perp_arrow= arrow(color=color.magenta)&lt;br /&gt;
&lt;br /&gt;
This creates a trail for the spacecraft:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=craft.color)  &lt;br /&gt;
&lt;br /&gt;
And this prevents zooming in or out:&lt;br /&gt;
  &lt;br /&gt;
scene.autoscale = 0                 &lt;br /&gt;
pscale=Earth.radius/mag(pcraft)&lt;br /&gt;
fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2)&lt;br /&gt;
dpscale=500*Earth.radius/mag(pcraft)&lt;br /&gt;
print(&amp;quot;p=&amp;quot;, pcraft)&lt;br /&gt;
&lt;br /&gt;
CALCULATIONS:&lt;br /&gt;
&lt;br /&gt;
Sets time for loop to run:&lt;br /&gt;
&lt;br /&gt;
while t &amp;lt; 165240: &lt;br /&gt;
This slows down the animation (runs faster with bigger number):&lt;br /&gt;
    rate(10000)   &lt;br /&gt;
&lt;br /&gt;
     Add statements here for the iterative update of gravitational&lt;br /&gt;
    force, momentum, and position.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    r = craft.pos-Earth.pos&lt;br /&gt;
    rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2))&lt;br /&gt;
    Fmag= G*mEarth*mcraft/(rmag**2)&lt;br /&gt;
    rhat= r/rmag&lt;br /&gt;
    rmoon= craft.pos - Moon.pos&lt;br /&gt;
    rmoonmag= mag(rmoon)&lt;br /&gt;
    rmoonhat= norm(rmoon)&lt;br /&gt;
    Fmoonmag= G*mmoon*mcraft/(rmoonmag**2)&lt;br /&gt;
    Fmoon= -Fmoonmag*rmoonhat&lt;br /&gt;
    p_init= mag(pcraft)&lt;br /&gt;
    pcraft_i=pcraft+vector(0,0,0)&lt;br /&gt;
    Fearth= -Fmag*rhat&lt;br /&gt;
    Fnet= Fearth + Fmoon&lt;br /&gt;
    pcraft=Fnet*deltat+pcraft&lt;br /&gt;
    p_final=mag(pcraft)&lt;br /&gt;
&lt;br /&gt;
    Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat&lt;br /&gt;
    Fnet_tangent_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_tangent_arrow.axis=Fnet_tangent*fscale&lt;br /&gt;
    Fnet_perp = Fnet-Fnet_tangent&lt;br /&gt;
    Fnet_perp_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_perp_arrow.axis=Fnet_perp*fscale&lt;br /&gt;
    vcraft=pcraft/mcraft&lt;br /&gt;
    craft.pos=vcraft*deltat+craft.pos&lt;br /&gt;
    pArrow.pos=craft.pos&lt;br /&gt;
    pArrow.axis=pcraft*pscale&lt;br /&gt;
    fArrow.pos=craft.pos&lt;br /&gt;
    fArrow.axis=Fnet*fscale&lt;br /&gt;
    deltap= pcraft-pcraft_i&lt;br /&gt;
    dpArrow.pos=craft.pos&lt;br /&gt;
    dpArrow.axis=deltap*dpscale&lt;br /&gt;
    scene.center=craft.pos&lt;br /&gt;
    scene.range=craft.radius*600&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Uncomment these two lines to exit the loop if&lt;br /&gt;
   the spacecraft crashes onto the Earth.&lt;br /&gt;
&lt;br /&gt;
    if rmag &amp;lt; Earth.radius: &lt;br /&gt;
        break&lt;br /&gt;
&lt;br /&gt;
    trail.append(pos=craft.pos)  &lt;br /&gt;
    t = t+deltat&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
vPython codes are very useful in modeling situations that may not be easy to construct models of in real life. The ability to map out a real life scenario in code form and then be able to tweak that code and see how the situation changes is priceless to scientists and students alike. Being able to have a visual on VPython for something that may not be able to be easily modeled in real life is what helps make VPython so valuable. In relation to the field of Industrial Engineering, VPython could be useful in modeling different systems and seeing which conditions promote the most optimal results. The computer simulations that VPython produces can assist in production and end up saving companies time and money. In addition, Industrial Engineers use a lot of Python and so their background knowledge of Python makes VPython much more accessible to them. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
A cT language was created in 1997 and was based a language of the PLATO computer-based education system. In 2000 Ruth Chabay, David Scherer, and Bruce Sherwood develop VPython. This form of VPython would be later referred to as &amp;quot;Classic&amp;quot; VPython. From 2002 to 2006 an engineering student named Jonathan Brandmeyer helped make important contributions to VPython 3. As the years went on more and more changes were made in order to make VPython what it is today. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Extra Resources==&lt;br /&gt;
If having trouble while trying to use VPython it made be helpful to watch someone else code using it first. While I do not own any of the following videos, they may be helpful resources to watch in order to become more proficient in VPython. &lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=KbOyKOlWBrs]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=jLHS0ZvYE5Y]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/history.html]&lt;br /&gt;
&lt;br /&gt;
[https://wiki.python.org/moin/VPython]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/experienced.html]&lt;br /&gt;
&lt;br /&gt;
[http://vpython.org/contents/announcements/get-vpython.html]&lt;br /&gt;
&lt;br /&gt;
[https://matterandinteractions.wordpress.com/2016/04/27/a-time-line-for-vpython-development/]&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=File:PositionGraph.jpg&amp;diff=28194</id>
		<title>File:PositionGraph.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=File:PositionGraph.jpg&amp;diff=28194"/>
		<updated>2017-04-09T21:31:27Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=28191</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=28191"/>
		<updated>2017-04-09T21:30:28Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Claimed by Madelyn Hightower- Spring 2017 &lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
This page discusses basic functioning of vPython and how the program can be used to produce models. While vPython is rather similar to the normal Python and uses the same syntax, vPython is an extension of Python and allows users to produce 3D models. It is frequently used for educational purposes, however it has also been used in research to help scientists visualize 3D models. &lt;br /&gt;
VPython, if used correctly, can be very helpful in learning new concepts in courses like physics, or helping to further study on models that may not be easy to create in real life.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
Before learning how to code vPython, the first step is to download the proper application. If interested, before downloading vPython, glow script is a great resource to practice using vPython. Glow script also creates 3D models and run programs just like vPython, so it is a great resource to try out.&lt;br /&gt;
&lt;br /&gt;
To download vPython, first either install Continuum Anaconda Python Distribution. Choose from either the Anaconda with Python 3.x  (this form is recommended on vypthon.org, especially if &amp;quot;Classic&amp;quot; VPython/Python 2.7 has previously been installed on the device.) &lt;br /&gt;
&lt;br /&gt;
In order to access the necessary download, use this link: https://www.python.org/downloads/&lt;br /&gt;
&lt;br /&gt;
For windows, then go to the Power Shell or Command Prompt and type &amp;quot; pip install vpython &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For macs,  go to Terminal and type &amp;quot; pip install vypython &amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Vpython will then be successfully downloaded onto the device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mathematical Model==&lt;br /&gt;
Vpython can compute any equation, but some that may be most helpful and most useful for Physics can be found below. (Keep in mind you can alter these numbers to be whatever you need, these are just to provide an example): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Always start vPython windows with:&lt;br /&gt;
&lt;br /&gt;
from__future__ import division&lt;br /&gt;
&lt;br /&gt;
from visual import*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update momentum:&lt;br /&gt;
&lt;br /&gt;
pf = pi + Fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update position:&lt;br /&gt;
&lt;br /&gt;
objectf.pos = objecti.pos + (pcart/mcart)*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a vector:&lt;br /&gt;
&lt;br /&gt;
vector(0,0,0) -- fill in with whatever numbers the vector should be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gravitational Force:&lt;br /&gt;
&lt;br /&gt;
CONSTANTS&lt;br /&gt;
&lt;br /&gt;
G = 6.7e-11&lt;br /&gt;
&lt;br /&gt;
mEarth = 6e24&lt;br /&gt;
&lt;br /&gt;
mcraft = 15e3&lt;br /&gt;
&lt;br /&gt;
deltat = 60&lt;br /&gt;
&lt;br /&gt;
t = 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finds the change in position:&lt;br /&gt;
&lt;br /&gt;
r=craft.pos-Earth.pos  &lt;br /&gt;
&lt;br /&gt;
m=mcraft&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To find the magnitude of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rmag= mag(r)      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the new magnitude of gravitational force:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fmag=(G*mcraft*mEarth)/(rmag**2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the direction of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rhat=r/rmag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate net force:&lt;br /&gt;
&lt;br /&gt;
Fnet=-Fmag*rhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate spring force:&lt;br /&gt;
&lt;br /&gt;
L0 = 0.3 &lt;br /&gt;
&lt;br /&gt;
Lvec = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
Lhat = norm(Lvec)&lt;br /&gt;
&lt;br /&gt;
Lmag = mag(Lvec)&lt;br /&gt;
&lt;br /&gt;
Fspr = (-ks)*(Lmag - L0)*(Lhat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate kinetic energy:&lt;br /&gt;
&lt;br /&gt;
Kinetic = (1/2)*(mball*(vel**2))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a graph:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add plots to the graph:&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(t, fnet.y))  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Computational Model==&lt;br /&gt;
&lt;br /&gt;
VPython is used to create computational, 3D models of various real world situations in order to better visualize how different equations can manipulate different scenarios. This is very valuable since many of the equations and situations that are coded in vPython are extremely difficult to make a functioning model of in real life. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For instance, the picture below is an example of program that was programmed to show the orbit of a craft around Earth. &lt;br /&gt;
&lt;br /&gt;
[[File:Earthorbits.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This picture shows a graph that tracks.&lt;br /&gt;
[[File:PositionGraph.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Simple:&lt;br /&gt;
&lt;br /&gt;
Creating Shapes:&lt;br /&gt;
&lt;br /&gt;
Sphere:&lt;br /&gt;
&lt;br /&gt;
sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red)&lt;br /&gt;
&lt;br /&gt;
Arrow:&lt;br /&gt;
&lt;br /&gt;
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
Vector:&lt;br /&gt;
&lt;br /&gt;
vector=vector(0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
Trail:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=sphere.color)&lt;br /&gt;
&lt;br /&gt;
trail.append(pos=sphere.pos)&lt;br /&gt;
&lt;br /&gt;
Setting Scene Range:&lt;br /&gt;
&lt;br /&gt;
scene.range=11*sphere.radius&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Helix:&lt;br /&gt;
&lt;br /&gt;
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) &lt;br /&gt;
&lt;br /&gt;
Intermediate:&lt;br /&gt;
&lt;br /&gt;
Graphs:&lt;br /&gt;
&lt;br /&gt;
Setup graphing windows:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph = gcurve(color=color.yellow)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=300)&lt;br /&gt;
&lt;br /&gt;
Plotting:&lt;br /&gt;
&lt;br /&gt;
pgraph = gcurve(color=color.blue)&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(time, Fnet.y))&lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pos=(time, sphere.y))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Difficult:&lt;br /&gt;
&lt;br /&gt;
Using Loops to update Equations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CONSTANTS:&lt;br /&gt;
&lt;br /&gt;
G = ?&lt;br /&gt;
&lt;br /&gt;
mEarth = ?&lt;br /&gt;
&lt;br /&gt;
mmoon = ?&lt;br /&gt;
&lt;br /&gt;
mcraft = ?&lt;br /&gt;
&lt;br /&gt;
deltat = ?&lt;br /&gt;
&lt;br /&gt;
t = ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJECTS AND INITIAL VALUES:&lt;br /&gt;
&lt;br /&gt;
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
scene.range=11*Earth.radius&lt;br /&gt;
&lt;br /&gt;
Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white)&lt;br /&gt;
&lt;br /&gt;
Add a radius for the spacecraft. It should be BIG, so it can be seen:&lt;br /&gt;
&lt;br /&gt;
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow)&lt;br /&gt;
vcraft = vector(206, 2645,0)&lt;br /&gt;
pcraft = mcraft*vcraft&lt;br /&gt;
pArrow=arrow(color=color.green)&lt;br /&gt;
fArrow=arrow(color=color.cyan)&lt;br /&gt;
dpArrow=arrow(color=color.red)&lt;br /&gt;
Fnet_tangent_arrow = arrow(color=color.yellow)&lt;br /&gt;
Fnet_perp_arrow= arrow(color=color.magenta)&lt;br /&gt;
&lt;br /&gt;
This creates a trail for the spacecraft:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=craft.color)  &lt;br /&gt;
&lt;br /&gt;
And this prevents zooming in or out:&lt;br /&gt;
  &lt;br /&gt;
scene.autoscale = 0                 &lt;br /&gt;
pscale=Earth.radius/mag(pcraft)&lt;br /&gt;
fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2)&lt;br /&gt;
dpscale=500*Earth.radius/mag(pcraft)&lt;br /&gt;
print(&amp;quot;p=&amp;quot;, pcraft)&lt;br /&gt;
&lt;br /&gt;
CALCULATIONS:&lt;br /&gt;
&lt;br /&gt;
Sets time for loop to run:&lt;br /&gt;
&lt;br /&gt;
while t &amp;lt; 165240: &lt;br /&gt;
This slows down the animation (runs faster with bigger number):&lt;br /&gt;
    rate(10000)   &lt;br /&gt;
&lt;br /&gt;
     Add statements here for the iterative update of gravitational&lt;br /&gt;
    force, momentum, and position.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    r = craft.pos-Earth.pos&lt;br /&gt;
    rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2))&lt;br /&gt;
    Fmag= G*mEarth*mcraft/(rmag**2)&lt;br /&gt;
    rhat= r/rmag&lt;br /&gt;
    rmoon= craft.pos - Moon.pos&lt;br /&gt;
    rmoonmag= mag(rmoon)&lt;br /&gt;
    rmoonhat= norm(rmoon)&lt;br /&gt;
    Fmoonmag= G*mmoon*mcraft/(rmoonmag**2)&lt;br /&gt;
    Fmoon= -Fmoonmag*rmoonhat&lt;br /&gt;
    p_init= mag(pcraft)&lt;br /&gt;
    pcraft_i=pcraft+vector(0,0,0)&lt;br /&gt;
    Fearth= -Fmag*rhat&lt;br /&gt;
    Fnet= Fearth + Fmoon&lt;br /&gt;
    pcraft=Fnet*deltat+pcraft&lt;br /&gt;
    p_final=mag(pcraft)&lt;br /&gt;
&lt;br /&gt;
    Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat&lt;br /&gt;
    Fnet_tangent_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_tangent_arrow.axis=Fnet_tangent*fscale&lt;br /&gt;
    Fnet_perp = Fnet-Fnet_tangent&lt;br /&gt;
    Fnet_perp_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_perp_arrow.axis=Fnet_perp*fscale&lt;br /&gt;
    vcraft=pcraft/mcraft&lt;br /&gt;
    craft.pos=vcraft*deltat+craft.pos&lt;br /&gt;
    pArrow.pos=craft.pos&lt;br /&gt;
    pArrow.axis=pcraft*pscale&lt;br /&gt;
    fArrow.pos=craft.pos&lt;br /&gt;
    fArrow.axis=Fnet*fscale&lt;br /&gt;
    deltap= pcraft-pcraft_i&lt;br /&gt;
    dpArrow.pos=craft.pos&lt;br /&gt;
    dpArrow.axis=deltap*dpscale&lt;br /&gt;
    scene.center=craft.pos&lt;br /&gt;
    scene.range=craft.radius*600&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Uncomment these two lines to exit the loop if&lt;br /&gt;
   the spacecraft crashes onto the Earth.&lt;br /&gt;
&lt;br /&gt;
    if rmag &amp;lt; Earth.radius: &lt;br /&gt;
        break&lt;br /&gt;
&lt;br /&gt;
    trail.append(pos=craft.pos)  &lt;br /&gt;
    t = t+deltat&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
vPython codes are very useful in modeling situations that may not be easy to construct models of in real life. The ability to map out a real life scenario in code form and then be able to tweak that code and see how the situation changes is priceless to scientists and students alike. Being able to have a visual on VPython for something that may not be able to be easily modeled in real life is what helps make VPython so valuable. In relation to the field of Industrial Engineering, VPython could be useful in modeling different systems and seeing which conditions promote the most optimal results. The computer simulations that VPython produces can assist in production and end up saving companies time and money. In addition, Industrial Engineers use a lot of Python and so their background knowledge of Python makes VPython much more accessible to them. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
A cT language was created in 1997 and was based a language of the PLATO computer-based education system. In 2000 Ruth Chabay, David Scherer, and Bruce Sherwood develop VPython. This form of VPython would be later referred to as &amp;quot;Classic&amp;quot; VPython. From 2002 to 2006 an engineering student named Jonathan Brandmeyer helped make important contributions to VPython 3. As the years went on more and more changes were made in order to make VPython what it is today. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Extra Resources==&lt;br /&gt;
If having trouble while trying to use VPython it made be helpful to watch someone else code using it first. While I do not own any of the following videos, they may be helpful resources to watch in order to become more proficient in VPython. &lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=KbOyKOlWBrs]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=jLHS0ZvYE5Y]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
http://vpython.org/contents/history.html&lt;br /&gt;
&lt;br /&gt;
https://wiki.python.org/moin/VPython&lt;br /&gt;
&lt;br /&gt;
http://vpython.org/contents/experienced.html&lt;br /&gt;
&lt;br /&gt;
http://vpython.org/contents/announcements/get-vpython.html&lt;br /&gt;
&lt;br /&gt;
https://matterandinteractions.wordpress.com/2016/04/27/a-time-line-for-vpython-development/&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=28186</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=28186"/>
		<updated>2017-04-09T21:18:44Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Claimed by Madelyn Hightower- Spring 2017 &lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
This page discusses basic functioning of vPython and how the program can be used to produce models. While vPython is rather similar to the normal Python and uses the same syntax, vPython is an extension of Python and allows users to produce 3D models. It is frequently used for educational purposes, however it has also been used in research to help scientists visualize 3D models. &lt;br /&gt;
VPython, if used correctly, can be very helpful in learning new concepts in courses like physics, or helping to further study on models that may not be easy to create in real life.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
Before learning how to code vPython, the first step is to download the proper application. If interested, before downloading vPython, glow script is a great resource to practice using vPython. Glow script also creates 3D models and run programs just like vPython, so it is a great resource to try out.&lt;br /&gt;
&lt;br /&gt;
To download vPython, first either install Continuum Anaconda Python Distribution. Choose from either the Anaconda with Python 3.x  (this form is recommended on vypthon.org, especially if &amp;quot;Classic&amp;quot; VPython/Python 2.7 has previously been installed on the device.) &lt;br /&gt;
&lt;br /&gt;
In order to access the necessary download, use this link: https://www.python.org/downloads/&lt;br /&gt;
&lt;br /&gt;
For windows, then go to the Power Shell or Command Prompt and type &amp;quot; pip install vpython &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For macs,  go to Terminal and type &amp;quot; pip install vypython &amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Vpython will then be successfully downloaded onto the device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mathematical Model==&lt;br /&gt;
Vpython can compute any equation, but some that may be most helpful and most useful for Physics can be found below. (Keep in mind you can alter these numbers to be whatever you need, these are just to provide an example): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Always start vPython windows with:&lt;br /&gt;
&lt;br /&gt;
from__future__ import division&lt;br /&gt;
&lt;br /&gt;
from visual import*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update momentum:&lt;br /&gt;
&lt;br /&gt;
pf = pi + Fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update position:&lt;br /&gt;
&lt;br /&gt;
objectf.pos = objecti.pos + (pcart/mcart)*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a vector:&lt;br /&gt;
&lt;br /&gt;
vector(0,0,0) -- fill in with whatever numbers the vector should be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gravitational Force:&lt;br /&gt;
&lt;br /&gt;
CONSTANTS&lt;br /&gt;
&lt;br /&gt;
G = 6.7e-11&lt;br /&gt;
&lt;br /&gt;
mEarth = 6e24&lt;br /&gt;
&lt;br /&gt;
mcraft = 15e3&lt;br /&gt;
&lt;br /&gt;
deltat = 60&lt;br /&gt;
&lt;br /&gt;
t = 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finds the change in position:&lt;br /&gt;
&lt;br /&gt;
r=craft.pos-Earth.pos  &lt;br /&gt;
&lt;br /&gt;
m=mcraft&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To find the magnitude of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rmag= mag(r)      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the new magnitude of gravitational force:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fmag=(G*mcraft*mEarth)/(rmag**2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the direction of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rhat=r/rmag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate net force:&lt;br /&gt;
&lt;br /&gt;
Fnet=-Fmag*rhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate spring force:&lt;br /&gt;
&lt;br /&gt;
L0 = 0.3 &lt;br /&gt;
&lt;br /&gt;
Lvec = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
Lhat = norm(Lvec)&lt;br /&gt;
&lt;br /&gt;
Lmag = mag(Lvec)&lt;br /&gt;
&lt;br /&gt;
Fspr = (-ks)*(Lmag - L0)*(Lhat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate kinetic energy:&lt;br /&gt;
&lt;br /&gt;
Kinetic = (1/2)*(mball*(vel**2))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a graph:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
pgraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add plots to the graph:&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(t, fnet.y))  &lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pot=(t, ball.p.y))&lt;br /&gt;
&lt;br /&gt;
==Computational Model==&lt;br /&gt;
&lt;br /&gt;
VPython is used to create computational, 3D models of various real world situations in order to better visualize how different equations can manipulate different scenarios. This is very valuable since many of the equations and situations that are coded in vPython are extremely difficult to make a functioning model of in real life. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For instance, the picture below is an example of program that was programmed to show the orbit of a craft around Earth. &lt;br /&gt;
&lt;br /&gt;
[[File:Earthorbits.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This picture shows a graph that tracks&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Simple:&lt;br /&gt;
&lt;br /&gt;
Creating Shapes:&lt;br /&gt;
&lt;br /&gt;
Sphere:&lt;br /&gt;
&lt;br /&gt;
sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red)&lt;br /&gt;
&lt;br /&gt;
Arrow:&lt;br /&gt;
&lt;br /&gt;
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
Vector:&lt;br /&gt;
&lt;br /&gt;
vector=vector(0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
Trail:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=sphere.color)&lt;br /&gt;
&lt;br /&gt;
trail.append(pos=sphere.pos)&lt;br /&gt;
&lt;br /&gt;
Setting Scene Range:&lt;br /&gt;
&lt;br /&gt;
scene.range=11*sphere.radius&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Helix:&lt;br /&gt;
&lt;br /&gt;
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) &lt;br /&gt;
&lt;br /&gt;
Intermediate:&lt;br /&gt;
&lt;br /&gt;
Graphs:&lt;br /&gt;
&lt;br /&gt;
Setup graphing windows:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph = gcurve(color=color.yellow)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=300)&lt;br /&gt;
&lt;br /&gt;
Plotting:&lt;br /&gt;
&lt;br /&gt;
pgraph = gcurve(color=color.blue)&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(time, Fnet.y))&lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pos=(time, sphere.y))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Difficult:&lt;br /&gt;
&lt;br /&gt;
Using Loops to update Equations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CONSTANTS:&lt;br /&gt;
&lt;br /&gt;
G = ?&lt;br /&gt;
&lt;br /&gt;
mEarth = ?&lt;br /&gt;
&lt;br /&gt;
mmoon = ?&lt;br /&gt;
&lt;br /&gt;
mcraft = ?&lt;br /&gt;
&lt;br /&gt;
deltat = ?&lt;br /&gt;
&lt;br /&gt;
t = ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJECTS AND INITIAL VALUES:&lt;br /&gt;
&lt;br /&gt;
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
scene.range=11*Earth.radius&lt;br /&gt;
&lt;br /&gt;
Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white)&lt;br /&gt;
&lt;br /&gt;
Add a radius for the spacecraft. It should be BIG, so it can be seen:&lt;br /&gt;
&lt;br /&gt;
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow)&lt;br /&gt;
vcraft = vector(206, 2645,0)&lt;br /&gt;
pcraft = mcraft*vcraft&lt;br /&gt;
pArrow=arrow(color=color.green)&lt;br /&gt;
fArrow=arrow(color=color.cyan)&lt;br /&gt;
dpArrow=arrow(color=color.red)&lt;br /&gt;
Fnet_tangent_arrow = arrow(color=color.yellow)&lt;br /&gt;
Fnet_perp_arrow= arrow(color=color.magenta)&lt;br /&gt;
&lt;br /&gt;
This creates a trail for the spacecraft:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=craft.color)  &lt;br /&gt;
&lt;br /&gt;
And this prevents zooming in or out:&lt;br /&gt;
  &lt;br /&gt;
scene.autoscale = 0                 &lt;br /&gt;
pscale=Earth.radius/mag(pcraft)&lt;br /&gt;
fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2)&lt;br /&gt;
dpscale=500*Earth.radius/mag(pcraft)&lt;br /&gt;
print(&amp;quot;p=&amp;quot;, pcraft)&lt;br /&gt;
&lt;br /&gt;
CALCULATIONS:&lt;br /&gt;
&lt;br /&gt;
Sets time for loop to run:&lt;br /&gt;
&lt;br /&gt;
while t &amp;lt; 165240: &lt;br /&gt;
This slows down the animation (runs faster with bigger number):&lt;br /&gt;
    rate(10000)   &lt;br /&gt;
&lt;br /&gt;
     Add statements here for the iterative update of gravitational&lt;br /&gt;
    force, momentum, and position.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    r = craft.pos-Earth.pos&lt;br /&gt;
    rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2))&lt;br /&gt;
    Fmag= G*mEarth*mcraft/(rmag**2)&lt;br /&gt;
    rhat= r/rmag&lt;br /&gt;
    rmoon= craft.pos - Moon.pos&lt;br /&gt;
    rmoonmag= mag(rmoon)&lt;br /&gt;
    rmoonhat= norm(rmoon)&lt;br /&gt;
    Fmoonmag= G*mmoon*mcraft/(rmoonmag**2)&lt;br /&gt;
    Fmoon= -Fmoonmag*rmoonhat&lt;br /&gt;
    p_init= mag(pcraft)&lt;br /&gt;
    pcraft_i=pcraft+vector(0,0,0)&lt;br /&gt;
    Fearth= -Fmag*rhat&lt;br /&gt;
    Fnet= Fearth + Fmoon&lt;br /&gt;
    pcraft=Fnet*deltat+pcraft&lt;br /&gt;
    p_final=mag(pcraft)&lt;br /&gt;
&lt;br /&gt;
    Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat&lt;br /&gt;
    Fnet_tangent_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_tangent_arrow.axis=Fnet_tangent*fscale&lt;br /&gt;
    Fnet_perp = Fnet-Fnet_tangent&lt;br /&gt;
    Fnet_perp_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_perp_arrow.axis=Fnet_perp*fscale&lt;br /&gt;
    vcraft=pcraft/mcraft&lt;br /&gt;
    craft.pos=vcraft*deltat+craft.pos&lt;br /&gt;
    pArrow.pos=craft.pos&lt;br /&gt;
    pArrow.axis=pcraft*pscale&lt;br /&gt;
    fArrow.pos=craft.pos&lt;br /&gt;
    fArrow.axis=Fnet*fscale&lt;br /&gt;
    deltap= pcraft-pcraft_i&lt;br /&gt;
    dpArrow.pos=craft.pos&lt;br /&gt;
    dpArrow.axis=deltap*dpscale&lt;br /&gt;
    scene.center=craft.pos&lt;br /&gt;
    scene.range=craft.radius*600&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Uncomment these two lines to exit the loop if&lt;br /&gt;
   the spacecraft crashes onto the Earth.&lt;br /&gt;
&lt;br /&gt;
    if rmag &amp;lt; Earth.radius: &lt;br /&gt;
        break&lt;br /&gt;
&lt;br /&gt;
    trail.append(pos=craft.pos)  &lt;br /&gt;
    t = t+deltat&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
vPython codes are very useful in modeling situations that may not be easy to construct models of in real life. The ability to map out a real life scenario in code form and then be able to tweak that code and see how the situation changes is priceless to scientists and students alike. Being able to have a visual in &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vPython codes are extremely useful for modeling physics situations. However, the coding skills learned in this class can be applied to almost anything. For example, Aerospace Engineers are becoming increasingly dependent on computer simulations to test ideas before prototyping to reduce costs.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
A cT language was created in 1997 and was based a language of the PLATO computer-based education system. In 2000 Ruth Chabay, David Scherer, and Bruce Sherwood develop VPython. This form of VPython would be later referred to as &amp;quot;Classic&amp;quot; VPython. From 2002 to 2006 an engineering student named Jonathan Brandmeyer helped make important contributions to VPython 3. As the years went on more and more changes were made in order to make VPython what it is today. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
http://vpython.org/contents/history.html&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=File:Earthorbits.jpg&amp;diff=28149</id>
		<title>File:Earthorbits.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=File:Earthorbits.jpg&amp;diff=28149"/>
		<updated>2017-04-09T20:43:01Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=28148</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=28148"/>
		<updated>2017-04-09T20:42:34Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: /* Computational Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Claimed by Madelyn Hightower- Spring 2017 &lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
This page discusses basic functioning of vPython and how the program can be used to produce models. While vPython is rather similar to the normal Python and uses the same syntax, vPython is an extension of Python and allows users to produce 3D models. It is frequently used for educational purposes, however it has also been used in research to help scientists visualize 3D models. &lt;br /&gt;
VPython, if used correctly, can be very helpful in learning new concepts in courses like physics, or helping to further study on models that may not be easy to create in real life.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
Before learning how to code vPython, the first step is to download the proper application. If interested, before downloading vPython, glow script is a great resource to practice using vPython. Glow script also creates 3D models and run programs just like vPython, so it is a great resource to try out.&lt;br /&gt;
&lt;br /&gt;
To download vPython, first either install Continuum Anaconda Python Distribution. Choose from either the Anaconda with Python 3.x  (this form is recommended on vypthon.org, especially if &amp;quot;Classic&amp;quot; VPython/Python 2.7 has previously been installed on the device.) &lt;br /&gt;
&lt;br /&gt;
In order to access the necessary download, use this link: https://www.python.org/downloads/&lt;br /&gt;
&lt;br /&gt;
For windows, then go to the Power Shell or Command Prompt and type &amp;quot; pip install vpython &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For macs,  go to Terminal and type &amp;quot; pip install vypython &amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Vpython will then be successfully downloaded onto the device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mathematical Model==&lt;br /&gt;
Vpython can compute any equation, but some that may be most helpful and most useful for Physics can be found below. (Keep in mind you can alter these numbers to be whatever you need, these are just to provide an example): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Always start vPython windows with:&lt;br /&gt;
&lt;br /&gt;
from__future__ import division&lt;br /&gt;
&lt;br /&gt;
from visual import*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update momentum:&lt;br /&gt;
&lt;br /&gt;
pf = pi + Fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update position:&lt;br /&gt;
&lt;br /&gt;
objectf.pos = objecti.pos + (pcart/mcart)*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a vector:&lt;br /&gt;
&lt;br /&gt;
vector(0,0,0) -- fill in with whatever numbers the vector should be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gravitational Force:&lt;br /&gt;
&lt;br /&gt;
CONSTANTS&lt;br /&gt;
&lt;br /&gt;
G = 6.7e-11&lt;br /&gt;
&lt;br /&gt;
mEarth = 6e24&lt;br /&gt;
&lt;br /&gt;
mcraft = 15e3&lt;br /&gt;
&lt;br /&gt;
deltat = 60&lt;br /&gt;
&lt;br /&gt;
t = 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finds the change in position:&lt;br /&gt;
&lt;br /&gt;
r=craft.pos-Earth.pos  &lt;br /&gt;
&lt;br /&gt;
m=mcraft&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To find the magnitude of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rmag= mag(r)      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the new magnitude of gravitational force:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fmag=(G*mcraft*mEarth)/(rmag**2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the direction of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rhat=r/rmag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate net force:&lt;br /&gt;
&lt;br /&gt;
Fnet=-Fmag*rhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate spring force:&lt;br /&gt;
&lt;br /&gt;
L0 = 0.3 &lt;br /&gt;
&lt;br /&gt;
Lvec = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
Lhat = norm(Lvec)&lt;br /&gt;
&lt;br /&gt;
Lmag = mag(Lvec)&lt;br /&gt;
&lt;br /&gt;
Fspr = (-ks)*(Lmag - L0)*(Lhat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate kinetic energy:&lt;br /&gt;
&lt;br /&gt;
Kinetic = (1/2)*(mball*(vel**2))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a graph:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
pgraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add plots to the graph:&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(t, fnet.y))  &lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pot=(t, ball.p.y))&lt;br /&gt;
&lt;br /&gt;
==Computational Model==&lt;br /&gt;
&lt;br /&gt;
VPython is used to create computational, 3D models of various real world situations in order to better visualize how different equations can manipulate different scenarios. This is very valuable since many of the equations and situations that are coded in vPython are extremely difficult to make a functioning model of in real life. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For instance, the picture below is an example of program that was programmed to show the orbit of a craft around Earth. &lt;br /&gt;
&lt;br /&gt;
[[File:Earthorbits.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This picture shows a graph that tracks&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Simple:&lt;br /&gt;
&lt;br /&gt;
Creating Shapes:&lt;br /&gt;
&lt;br /&gt;
Sphere:&lt;br /&gt;
&lt;br /&gt;
sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red)&lt;br /&gt;
&lt;br /&gt;
Arrow:&lt;br /&gt;
&lt;br /&gt;
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
Vector:&lt;br /&gt;
&lt;br /&gt;
vector=vector(0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
Trail:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=sphere.color)&lt;br /&gt;
&lt;br /&gt;
trail.append(pos=sphere.pos)&lt;br /&gt;
&lt;br /&gt;
Setting Scene Range:&lt;br /&gt;
&lt;br /&gt;
scene.range=11*sphere.radius&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Helix:&lt;br /&gt;
&lt;br /&gt;
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) &lt;br /&gt;
&lt;br /&gt;
Intermediate:&lt;br /&gt;
&lt;br /&gt;
Graphs:&lt;br /&gt;
&lt;br /&gt;
Setup graphing windows:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph = gcurve(color=color.yellow)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=300)&lt;br /&gt;
&lt;br /&gt;
Plotting:&lt;br /&gt;
&lt;br /&gt;
pgraph = gcurve(color=color.blue)&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(time, Fnet.y))&lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pos=(time, sphere.y))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Difficult:&lt;br /&gt;
&lt;br /&gt;
Using Loops to update Equations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CONSTANTS:&lt;br /&gt;
&lt;br /&gt;
G = ?&lt;br /&gt;
&lt;br /&gt;
mEarth = ?&lt;br /&gt;
&lt;br /&gt;
mmoon = ?&lt;br /&gt;
&lt;br /&gt;
mcraft = ?&lt;br /&gt;
&lt;br /&gt;
deltat = ?&lt;br /&gt;
&lt;br /&gt;
t = ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJECTS AND INITIAL VALUES:&lt;br /&gt;
&lt;br /&gt;
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
scene.range=11*Earth.radius&lt;br /&gt;
&lt;br /&gt;
Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white)&lt;br /&gt;
&lt;br /&gt;
Add a radius for the spacecraft. It should be BIG, so it can be seen:&lt;br /&gt;
&lt;br /&gt;
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow)&lt;br /&gt;
vcraft = vector(206, 2645,0)&lt;br /&gt;
pcraft = mcraft*vcraft&lt;br /&gt;
pArrow=arrow(color=color.green)&lt;br /&gt;
fArrow=arrow(color=color.cyan)&lt;br /&gt;
dpArrow=arrow(color=color.red)&lt;br /&gt;
Fnet_tangent_arrow = arrow(color=color.yellow)&lt;br /&gt;
Fnet_perp_arrow= arrow(color=color.magenta)&lt;br /&gt;
&lt;br /&gt;
This creates a trail for the spacecraft:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=craft.color)  &lt;br /&gt;
&lt;br /&gt;
And this prevents zooming in or out:&lt;br /&gt;
  &lt;br /&gt;
scene.autoscale = 0                 &lt;br /&gt;
pscale=Earth.radius/mag(pcraft)&lt;br /&gt;
fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2)&lt;br /&gt;
dpscale=500*Earth.radius/mag(pcraft)&lt;br /&gt;
print(&amp;quot;p=&amp;quot;, pcraft)&lt;br /&gt;
&lt;br /&gt;
CALCULATIONS:&lt;br /&gt;
&lt;br /&gt;
Sets time for loop to run:&lt;br /&gt;
&lt;br /&gt;
while t &amp;lt; 165240: &lt;br /&gt;
This slows down the animation (runs faster with bigger number):&lt;br /&gt;
    rate(10000)   &lt;br /&gt;
&lt;br /&gt;
     Add statements here for the iterative update of gravitational&lt;br /&gt;
    force, momentum, and position.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    r = craft.pos-Earth.pos&lt;br /&gt;
    rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2))&lt;br /&gt;
    Fmag= G*mEarth*mcraft/(rmag**2)&lt;br /&gt;
    rhat= r/rmag&lt;br /&gt;
    rmoon= craft.pos - Moon.pos&lt;br /&gt;
    rmoonmag= mag(rmoon)&lt;br /&gt;
    rmoonhat= norm(rmoon)&lt;br /&gt;
    Fmoonmag= G*mmoon*mcraft/(rmoonmag**2)&lt;br /&gt;
    Fmoon= -Fmoonmag*rmoonhat&lt;br /&gt;
    p_init= mag(pcraft)&lt;br /&gt;
    pcraft_i=pcraft+vector(0,0,0)&lt;br /&gt;
    Fearth= -Fmag*rhat&lt;br /&gt;
    Fnet= Fearth + Fmoon&lt;br /&gt;
    pcraft=Fnet*deltat+pcraft&lt;br /&gt;
    p_final=mag(pcraft)&lt;br /&gt;
&lt;br /&gt;
    Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat&lt;br /&gt;
    Fnet_tangent_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_tangent_arrow.axis=Fnet_tangent*fscale&lt;br /&gt;
    Fnet_perp = Fnet-Fnet_tangent&lt;br /&gt;
    Fnet_perp_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_perp_arrow.axis=Fnet_perp*fscale&lt;br /&gt;
    vcraft=pcraft/mcraft&lt;br /&gt;
    craft.pos=vcraft*deltat+craft.pos&lt;br /&gt;
    pArrow.pos=craft.pos&lt;br /&gt;
    pArrow.axis=pcraft*pscale&lt;br /&gt;
    fArrow.pos=craft.pos&lt;br /&gt;
    fArrow.axis=Fnet*fscale&lt;br /&gt;
    deltap= pcraft-pcraft_i&lt;br /&gt;
    dpArrow.pos=craft.pos&lt;br /&gt;
    dpArrow.axis=deltap*dpscale&lt;br /&gt;
    scene.center=craft.pos&lt;br /&gt;
    scene.range=craft.radius*600&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Uncomment these two lines to exit the loop if&lt;br /&gt;
   the spacecraft crashes onto the Earth.&lt;br /&gt;
&lt;br /&gt;
    if rmag &amp;lt; Earth.radius: &lt;br /&gt;
        break&lt;br /&gt;
&lt;br /&gt;
    trail.append(pos=craft.pos)  &lt;br /&gt;
    t = t+deltat&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
vPython codes are very useful in modeling situations that may not be easy to construct models of in real life. The ability to map out a real life scenario in code form and then be able to tweak that code and see how the situation changes is priceless to scientists and students alike. Being able to have a visual &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vPython codes are extremely useful for modeling physics situations. However, the coding skills learned in this class can be applied to almost anything. For example, Aerospace Engineers are becoming increasingly dependent on computer simulations to test ideas before prototyping to reduce costs.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
vPython was released in 2008. It was developed by researchers at Carnegie Mellon University. It is largely used for educational purposes especially producing physics models.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
http://vpython.org/contents/history.html&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=28146</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=28146"/>
		<updated>2017-04-09T20:41:34Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Claimed by Madelyn Hightower- Spring 2017 &lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
This page discusses basic functioning of vPython and how the program can be used to produce models. While vPython is rather similar to the normal Python and uses the same syntax, vPython is an extension of Python and allows users to produce 3D models. It is frequently used for educational purposes, however it has also been used in research to help scientists visualize 3D models. &lt;br /&gt;
VPython, if used correctly, can be very helpful in learning new concepts in courses like physics, or helping to further study on models that may not be easy to create in real life.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
Before learning how to code vPython, the first step is to download the proper application. If interested, before downloading vPython, glow script is a great resource to practice using vPython. Glow script also creates 3D models and run programs just like vPython, so it is a great resource to try out.&lt;br /&gt;
&lt;br /&gt;
To download vPython, first either install Continuum Anaconda Python Distribution. Choose from either the Anaconda with Python 3.x  (this form is recommended on vypthon.org, especially if &amp;quot;Classic&amp;quot; VPython/Python 2.7 has previously been installed on the device.) &lt;br /&gt;
&lt;br /&gt;
In order to access the necessary download, use this link: https://www.python.org/downloads/&lt;br /&gt;
&lt;br /&gt;
For windows, then go to the Power Shell or Command Prompt and type &amp;quot; pip install vpython &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For macs,  go to Terminal and type &amp;quot; pip install vypython &amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Vpython will then be successfully downloaded onto the device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mathematical Model==&lt;br /&gt;
Vpython can compute any equation, but some that may be most helpful and most useful for Physics can be found below. (Keep in mind you can alter these numbers to be whatever you need, these are just to provide an example): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Always start vPython windows with:&lt;br /&gt;
&lt;br /&gt;
from__future__ import division&lt;br /&gt;
&lt;br /&gt;
from visual import*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update momentum:&lt;br /&gt;
&lt;br /&gt;
pf = pi + Fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update position:&lt;br /&gt;
&lt;br /&gt;
objectf.pos = objecti.pos + (pcart/mcart)*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a vector:&lt;br /&gt;
&lt;br /&gt;
vector(0,0,0) -- fill in with whatever numbers the vector should be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gravitational Force:&lt;br /&gt;
&lt;br /&gt;
CONSTANTS&lt;br /&gt;
&lt;br /&gt;
G = 6.7e-11&lt;br /&gt;
&lt;br /&gt;
mEarth = 6e24&lt;br /&gt;
&lt;br /&gt;
mcraft = 15e3&lt;br /&gt;
&lt;br /&gt;
deltat = 60&lt;br /&gt;
&lt;br /&gt;
t = 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finds the change in position:&lt;br /&gt;
&lt;br /&gt;
r=craft.pos-Earth.pos  &lt;br /&gt;
&lt;br /&gt;
m=mcraft&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To find the magnitude of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rmag= mag(r)      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the new magnitude of gravitational force:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fmag=(G*mcraft*mEarth)/(rmag**2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the direction of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rhat=r/rmag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate net force:&lt;br /&gt;
&lt;br /&gt;
Fnet=-Fmag*rhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate spring force:&lt;br /&gt;
&lt;br /&gt;
L0 = 0.3 &lt;br /&gt;
&lt;br /&gt;
Lvec = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
Lhat = norm(Lvec)&lt;br /&gt;
&lt;br /&gt;
Lmag = mag(Lvec)&lt;br /&gt;
&lt;br /&gt;
Fspr = (-ks)*(Lmag - L0)*(Lhat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate kinetic energy:&lt;br /&gt;
&lt;br /&gt;
Kinetic = (1/2)*(mball*(vel**2))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a graph:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
pgraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add plots to the graph:&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(t, fnet.y))  &lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pot=(t, ball.p.y))&lt;br /&gt;
&lt;br /&gt;
==Computational Model==&lt;br /&gt;
&lt;br /&gt;
VPython is used to create computational, 3D models of various real world situations in order to better visualize how different equations can manipulate different scenarios. This is very valuable since many of the equations and situations that are coded in vPython are extremely difficult to make a functioning model of in real life. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For instance, the picture below is an example of program that was programmed to show the orbit of a craft around Earth. &lt;br /&gt;
&lt;br /&gt;
[[File:Earthorbit.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This picture shows a graph that tracks&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Simple:&lt;br /&gt;
&lt;br /&gt;
Creating Shapes:&lt;br /&gt;
&lt;br /&gt;
Sphere:&lt;br /&gt;
&lt;br /&gt;
sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red)&lt;br /&gt;
&lt;br /&gt;
Arrow:&lt;br /&gt;
&lt;br /&gt;
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
Vector:&lt;br /&gt;
&lt;br /&gt;
vector=vector(0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
Trail:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=sphere.color)&lt;br /&gt;
&lt;br /&gt;
trail.append(pos=sphere.pos)&lt;br /&gt;
&lt;br /&gt;
Setting Scene Range:&lt;br /&gt;
&lt;br /&gt;
scene.range=11*sphere.radius&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Helix:&lt;br /&gt;
&lt;br /&gt;
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) &lt;br /&gt;
&lt;br /&gt;
Intermediate:&lt;br /&gt;
&lt;br /&gt;
Graphs:&lt;br /&gt;
&lt;br /&gt;
Setup graphing windows:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph = gcurve(color=color.yellow)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=300)&lt;br /&gt;
&lt;br /&gt;
Plotting:&lt;br /&gt;
&lt;br /&gt;
pgraph = gcurve(color=color.blue)&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(time, Fnet.y))&lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pos=(time, sphere.y))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Difficult:&lt;br /&gt;
&lt;br /&gt;
Using Loops to update Equations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CONSTANTS:&lt;br /&gt;
&lt;br /&gt;
G = ?&lt;br /&gt;
&lt;br /&gt;
mEarth = ?&lt;br /&gt;
&lt;br /&gt;
mmoon = ?&lt;br /&gt;
&lt;br /&gt;
mcraft = ?&lt;br /&gt;
&lt;br /&gt;
deltat = ?&lt;br /&gt;
&lt;br /&gt;
t = ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJECTS AND INITIAL VALUES:&lt;br /&gt;
&lt;br /&gt;
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
scene.range=11*Earth.radius&lt;br /&gt;
&lt;br /&gt;
Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white)&lt;br /&gt;
&lt;br /&gt;
Add a radius for the spacecraft. It should be BIG, so it can be seen:&lt;br /&gt;
&lt;br /&gt;
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow)&lt;br /&gt;
vcraft = vector(206, 2645,0)&lt;br /&gt;
pcraft = mcraft*vcraft&lt;br /&gt;
pArrow=arrow(color=color.green)&lt;br /&gt;
fArrow=arrow(color=color.cyan)&lt;br /&gt;
dpArrow=arrow(color=color.red)&lt;br /&gt;
Fnet_tangent_arrow = arrow(color=color.yellow)&lt;br /&gt;
Fnet_perp_arrow= arrow(color=color.magenta)&lt;br /&gt;
&lt;br /&gt;
This creates a trail for the spacecraft:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=craft.color)  &lt;br /&gt;
&lt;br /&gt;
And this prevents zooming in or out:&lt;br /&gt;
  &lt;br /&gt;
scene.autoscale = 0                 &lt;br /&gt;
pscale=Earth.radius/mag(pcraft)&lt;br /&gt;
fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2)&lt;br /&gt;
dpscale=500*Earth.radius/mag(pcraft)&lt;br /&gt;
print(&amp;quot;p=&amp;quot;, pcraft)&lt;br /&gt;
&lt;br /&gt;
CALCULATIONS:&lt;br /&gt;
&lt;br /&gt;
Sets time for loop to run:&lt;br /&gt;
&lt;br /&gt;
while t &amp;lt; 165240: &lt;br /&gt;
This slows down the animation (runs faster with bigger number):&lt;br /&gt;
    rate(10000)   &lt;br /&gt;
&lt;br /&gt;
     Add statements here for the iterative update of gravitational&lt;br /&gt;
    force, momentum, and position.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    r = craft.pos-Earth.pos&lt;br /&gt;
    rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2))&lt;br /&gt;
    Fmag= G*mEarth*mcraft/(rmag**2)&lt;br /&gt;
    rhat= r/rmag&lt;br /&gt;
    rmoon= craft.pos - Moon.pos&lt;br /&gt;
    rmoonmag= mag(rmoon)&lt;br /&gt;
    rmoonhat= norm(rmoon)&lt;br /&gt;
    Fmoonmag= G*mmoon*mcraft/(rmoonmag**2)&lt;br /&gt;
    Fmoon= -Fmoonmag*rmoonhat&lt;br /&gt;
    p_init= mag(pcraft)&lt;br /&gt;
    pcraft_i=pcraft+vector(0,0,0)&lt;br /&gt;
    Fearth= -Fmag*rhat&lt;br /&gt;
    Fnet= Fearth + Fmoon&lt;br /&gt;
    pcraft=Fnet*deltat+pcraft&lt;br /&gt;
    p_final=mag(pcraft)&lt;br /&gt;
&lt;br /&gt;
    Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat&lt;br /&gt;
    Fnet_tangent_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_tangent_arrow.axis=Fnet_tangent*fscale&lt;br /&gt;
    Fnet_perp = Fnet-Fnet_tangent&lt;br /&gt;
    Fnet_perp_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_perp_arrow.axis=Fnet_perp*fscale&lt;br /&gt;
    vcraft=pcraft/mcraft&lt;br /&gt;
    craft.pos=vcraft*deltat+craft.pos&lt;br /&gt;
    pArrow.pos=craft.pos&lt;br /&gt;
    pArrow.axis=pcraft*pscale&lt;br /&gt;
    fArrow.pos=craft.pos&lt;br /&gt;
    fArrow.axis=Fnet*fscale&lt;br /&gt;
    deltap= pcraft-pcraft_i&lt;br /&gt;
    dpArrow.pos=craft.pos&lt;br /&gt;
    dpArrow.axis=deltap*dpscale&lt;br /&gt;
    scene.center=craft.pos&lt;br /&gt;
    scene.range=craft.radius*600&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Uncomment these two lines to exit the loop if&lt;br /&gt;
   the spacecraft crashes onto the Earth.&lt;br /&gt;
&lt;br /&gt;
    if rmag &amp;lt; Earth.radius: &lt;br /&gt;
        break&lt;br /&gt;
&lt;br /&gt;
    trail.append(pos=craft.pos)  &lt;br /&gt;
    t = t+deltat&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
vPython codes are very useful in modeling situations that may not be easy to construct models of in real life. The ability to map out a real life scenario in code form and then be able to tweak that code and see how the situation changes is priceless to scientists and students alike. Being able to have a visual &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vPython codes are extremely useful for modeling physics situations. However, the coding skills learned in this class can be applied to almost anything. For example, Aerospace Engineers are becoming increasingly dependent on computer simulations to test ideas before prototyping to reduce costs.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
vPython was released in 2008. It was developed by researchers at Carnegie Mellon University. It is largely used for educational purposes especially producing physics models.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
http://vpython.org/contents/history.html&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=27981</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=27981"/>
		<updated>2017-04-09T17:18:51Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: /* Connectedness */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Claimed by Madelyn Hightower- Spring 2017 &lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
This page discusses basic functioning of vPython and how the program can be used to produce models. While vPython is rather similar to the normal Python and uses the same syntax, vPython is an extension of Python and allows users to produce 3D models. It is frequently used for educational purposes, however it has also been used in research to help scientists visualize 3D models. &lt;br /&gt;
VPython, if used correctly, can be very helpful in learning new concepts in courses like physics, or helping to further study on models that may not be easy to create in real life.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
Before learning how to code vPython, the first step is to download the proper application. If interested, before downloading vPython, glow script is a great resource to practice using vPython. Glow script also creates 3D models and run programs just like vPython, so it is a great resource to try out.&lt;br /&gt;
&lt;br /&gt;
To download vPython, first either install Continuum Anaconda Python Distribution. Choose from either the Anaconda with Python 3.x  (this form is recommended on vypthon.org, especially if &amp;quot;Classic&amp;quot; VPython/Python 2.7 has previously been installed on the device.) &lt;br /&gt;
&lt;br /&gt;
In order to access the necessary download, use this link: https://www.python.org/downloads/&lt;br /&gt;
&lt;br /&gt;
For windows, then go to the Power Shell or Command Prompt and type &amp;quot; pip install vpython &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For macs,  go to Terminal and type &amp;quot; pip install vypython &amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Vpython will then be successfully downloaded onto the device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mathematical Model==&lt;br /&gt;
Vpython can compute any equation, but some that may be most helpful and most useful for Physics can be found below. (Keep in mind you can alter these numbers to be whatever you need, these are just to provide an example): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Always start vPython windows with:&lt;br /&gt;
&lt;br /&gt;
from__future__ import division&lt;br /&gt;
&lt;br /&gt;
from visual import*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update momentum:&lt;br /&gt;
&lt;br /&gt;
pf = pi + Fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update position:&lt;br /&gt;
&lt;br /&gt;
objectf.pos = objecti.pos + (pcart/mcart)*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a vector:&lt;br /&gt;
&lt;br /&gt;
vector(0,0,0) -- fill in with whatever numbers the vector should be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gravitational Force:&lt;br /&gt;
&lt;br /&gt;
CONSTANTS&lt;br /&gt;
&lt;br /&gt;
G = 6.7e-11&lt;br /&gt;
&lt;br /&gt;
mEarth = 6e24&lt;br /&gt;
&lt;br /&gt;
mcraft = 15e3&lt;br /&gt;
&lt;br /&gt;
deltat = 60&lt;br /&gt;
&lt;br /&gt;
t = 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finds the change in position:&lt;br /&gt;
&lt;br /&gt;
r=craft.pos-Earth.pos  &lt;br /&gt;
&lt;br /&gt;
m=mcraft&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To find the magnitude of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rmag= mag(r)      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the new magnitude of gravitational force:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fmag=(G*mcraft*mEarth)/(rmag**2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the direction of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rhat=r/rmag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate net force:&lt;br /&gt;
&lt;br /&gt;
Fnet=-Fmag*rhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate spring force:&lt;br /&gt;
&lt;br /&gt;
L0 = 0.3 &lt;br /&gt;
&lt;br /&gt;
Lvec = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
Lhat = norm(Lvec)&lt;br /&gt;
&lt;br /&gt;
Lmag = mag(Lvec)&lt;br /&gt;
&lt;br /&gt;
Fspr = (-ks)*(Lmag - L0)*(Lhat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate kinetic energy:&lt;br /&gt;
&lt;br /&gt;
Kinetic = (1/2)*(mball*(vel**2))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a graph:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
pgraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add plots to the graph:&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(t, fnet.y))  &lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pot=(t, ball.p.y))&lt;br /&gt;
&lt;br /&gt;
==Computational Model==&lt;br /&gt;
&lt;br /&gt;
VPython is used to create computational, 3D models of various real world situations in order to better visualize how different equations can manipulate different scenarios. This is very valuable since many of the equations and situations that are coded in vPython are extremely difficult to make a functioning model of in real life. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For instance, the picture below is an example of program that was programmed to show the orbit of a craft around Earth. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This picture shows a graph that tracks&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Simple:&lt;br /&gt;
&lt;br /&gt;
Creating Shapes:&lt;br /&gt;
&lt;br /&gt;
Sphere:&lt;br /&gt;
&lt;br /&gt;
sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red)&lt;br /&gt;
&lt;br /&gt;
Arrow:&lt;br /&gt;
&lt;br /&gt;
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
Vector:&lt;br /&gt;
&lt;br /&gt;
vector=vector(0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
Trail:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=sphere.color)&lt;br /&gt;
&lt;br /&gt;
trail.append(pos=sphere.pos)&lt;br /&gt;
&lt;br /&gt;
Setting Scene Range:&lt;br /&gt;
&lt;br /&gt;
scene.range=11*sphere.radius&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Helix:&lt;br /&gt;
&lt;br /&gt;
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) &lt;br /&gt;
&lt;br /&gt;
Intermediate:&lt;br /&gt;
&lt;br /&gt;
Graphs:&lt;br /&gt;
&lt;br /&gt;
Setup graphing windows:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph = gcurve(color=color.yellow)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=300)&lt;br /&gt;
&lt;br /&gt;
Plotting:&lt;br /&gt;
&lt;br /&gt;
pgraph = gcurve(color=color.blue)&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(time, Fnet.y))&lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pos=(time, sphere.y))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Difficult:&lt;br /&gt;
&lt;br /&gt;
Using Loops to update Equations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CONSTANTS:&lt;br /&gt;
&lt;br /&gt;
G = ?&lt;br /&gt;
&lt;br /&gt;
mEarth = ?&lt;br /&gt;
&lt;br /&gt;
mmoon = ?&lt;br /&gt;
&lt;br /&gt;
mcraft = ?&lt;br /&gt;
&lt;br /&gt;
deltat = ?&lt;br /&gt;
&lt;br /&gt;
t = ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJECTS AND INITIAL VALUES:&lt;br /&gt;
&lt;br /&gt;
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
scene.range=11*Earth.radius&lt;br /&gt;
&lt;br /&gt;
Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white)&lt;br /&gt;
&lt;br /&gt;
Add a radius for the spacecraft. It should be BIG, so it can be seen:&lt;br /&gt;
&lt;br /&gt;
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow)&lt;br /&gt;
vcraft = vector(206, 2645,0)&lt;br /&gt;
pcraft = mcraft*vcraft&lt;br /&gt;
pArrow=arrow(color=color.green)&lt;br /&gt;
fArrow=arrow(color=color.cyan)&lt;br /&gt;
dpArrow=arrow(color=color.red)&lt;br /&gt;
Fnet_tangent_arrow = arrow(color=color.yellow)&lt;br /&gt;
Fnet_perp_arrow= arrow(color=color.magenta)&lt;br /&gt;
&lt;br /&gt;
This creates a trail for the spacecraft:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=craft.color)  &lt;br /&gt;
&lt;br /&gt;
And this prevents zooming in or out:&lt;br /&gt;
  &lt;br /&gt;
scene.autoscale = 0                 &lt;br /&gt;
pscale=Earth.radius/mag(pcraft)&lt;br /&gt;
fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2)&lt;br /&gt;
dpscale=500*Earth.radius/mag(pcraft)&lt;br /&gt;
print(&amp;quot;p=&amp;quot;, pcraft)&lt;br /&gt;
&lt;br /&gt;
CALCULATIONS:&lt;br /&gt;
&lt;br /&gt;
Sets time for loop to run:&lt;br /&gt;
&lt;br /&gt;
while t &amp;lt; 165240: &lt;br /&gt;
This slows down the animation (runs faster with bigger number):&lt;br /&gt;
    rate(10000)   &lt;br /&gt;
&lt;br /&gt;
     Add statements here for the iterative update of gravitational&lt;br /&gt;
    force, momentum, and position.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    r = craft.pos-Earth.pos&lt;br /&gt;
    rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2))&lt;br /&gt;
    Fmag= G*mEarth*mcraft/(rmag**2)&lt;br /&gt;
    rhat= r/rmag&lt;br /&gt;
    rmoon= craft.pos - Moon.pos&lt;br /&gt;
    rmoonmag= mag(rmoon)&lt;br /&gt;
    rmoonhat= norm(rmoon)&lt;br /&gt;
    Fmoonmag= G*mmoon*mcraft/(rmoonmag**2)&lt;br /&gt;
    Fmoon= -Fmoonmag*rmoonhat&lt;br /&gt;
    p_init= mag(pcraft)&lt;br /&gt;
    pcraft_i=pcraft+vector(0,0,0)&lt;br /&gt;
    Fearth= -Fmag*rhat&lt;br /&gt;
    Fnet= Fearth + Fmoon&lt;br /&gt;
    pcraft=Fnet*deltat+pcraft&lt;br /&gt;
    p_final=mag(pcraft)&lt;br /&gt;
&lt;br /&gt;
    Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat&lt;br /&gt;
    Fnet_tangent_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_tangent_arrow.axis=Fnet_tangent*fscale&lt;br /&gt;
    Fnet_perp = Fnet-Fnet_tangent&lt;br /&gt;
    Fnet_perp_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_perp_arrow.axis=Fnet_perp*fscale&lt;br /&gt;
    vcraft=pcraft/mcraft&lt;br /&gt;
    craft.pos=vcraft*deltat+craft.pos&lt;br /&gt;
    pArrow.pos=craft.pos&lt;br /&gt;
    pArrow.axis=pcraft*pscale&lt;br /&gt;
    fArrow.pos=craft.pos&lt;br /&gt;
    fArrow.axis=Fnet*fscale&lt;br /&gt;
    deltap= pcraft-pcraft_i&lt;br /&gt;
    dpArrow.pos=craft.pos&lt;br /&gt;
    dpArrow.axis=deltap*dpscale&lt;br /&gt;
    scene.center=craft.pos&lt;br /&gt;
    scene.range=craft.radius*600&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Uncomment these two lines to exit the loop if&lt;br /&gt;
   the spacecraft crashes onto the Earth.&lt;br /&gt;
&lt;br /&gt;
    if rmag &amp;lt; Earth.radius: &lt;br /&gt;
        break&lt;br /&gt;
&lt;br /&gt;
    trail.append(pos=craft.pos)  &lt;br /&gt;
    t = t+deltat&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
vPython codes are very useful in modeling situations that may not be easy to construct models of in real life. The ability to map out a real life scenario in code form and then be able to tweak that code and see how the situation changes is priceless to scientists and students alike. Being able to have a visual &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vPython codes are extremely useful for modeling physics situations. However, the coding skills learned in this class can be applied to almost anything. For example, Aerospace Engineers are becoming increasingly dependent on computer simulations to test ideas before prototyping to reduce costs.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
vPython was released in 2008. It was developed by researchers at Carnegie Mellon University. It is largely used for educational purposes especially producing physics models.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
http://vpython.org/contents/history.html&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=27978</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=27978"/>
		<updated>2017-04-09T17:10:40Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: /* Computational Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Claimed by Madelyn Hightower- Spring 2017 &lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
This page discusses basic functioning of vPython and how the program can be used to produce models. While vPython is rather similar to the normal Python and uses the same syntax, vPython is an extension of Python and allows users to produce 3D models. It is frequently used for educational purposes, however it has also been used in research to help scientists visualize 3D models. &lt;br /&gt;
VPython, if used correctly, can be very helpful in learning new concepts in courses like physics, or helping to further study on models that may not be easy to create in real life.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
Before learning how to code vPython, the first step is to download the proper application. If interested, before downloading vPython, glow script is a great resource to practice using vPython. Glow script also creates 3D models and run programs just like vPython, so it is a great resource to try out.&lt;br /&gt;
&lt;br /&gt;
To download vPython, first either install Continuum Anaconda Python Distribution. Choose from either the Anaconda with Python 3.x  (this form is recommended on vypthon.org, especially if &amp;quot;Classic&amp;quot; VPython/Python 2.7 has previously been installed on the device.) &lt;br /&gt;
&lt;br /&gt;
In order to access the necessary download, use this link: https://www.python.org/downloads/&lt;br /&gt;
&lt;br /&gt;
For windows, then go to the Power Shell or Command Prompt and type &amp;quot; pip install vpython &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For macs,  go to Terminal and type &amp;quot; pip install vypython &amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Vpython will then be successfully downloaded onto the device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mathematical Model==&lt;br /&gt;
Vpython can compute any equation, but some that may be most helpful and most useful for Physics can be found below. (Keep in mind you can alter these numbers to be whatever you need, these are just to provide an example): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Always start vPython windows with:&lt;br /&gt;
&lt;br /&gt;
from__future__ import division&lt;br /&gt;
&lt;br /&gt;
from visual import*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update momentum:&lt;br /&gt;
&lt;br /&gt;
pf = pi + Fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update position:&lt;br /&gt;
&lt;br /&gt;
objectf.pos = objecti.pos + (pcart/mcart)*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a vector:&lt;br /&gt;
&lt;br /&gt;
vector(0,0,0) -- fill in with whatever numbers the vector should be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gravitational Force:&lt;br /&gt;
&lt;br /&gt;
CONSTANTS&lt;br /&gt;
&lt;br /&gt;
G = 6.7e-11&lt;br /&gt;
&lt;br /&gt;
mEarth = 6e24&lt;br /&gt;
&lt;br /&gt;
mcraft = 15e3&lt;br /&gt;
&lt;br /&gt;
deltat = 60&lt;br /&gt;
&lt;br /&gt;
t = 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finds the change in position:&lt;br /&gt;
&lt;br /&gt;
r=craft.pos-Earth.pos  &lt;br /&gt;
&lt;br /&gt;
m=mcraft&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To find the magnitude of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rmag= mag(r)      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the new magnitude of gravitational force:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fmag=(G*mcraft*mEarth)/(rmag**2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the direction of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rhat=r/rmag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate net force:&lt;br /&gt;
&lt;br /&gt;
Fnet=-Fmag*rhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate spring force:&lt;br /&gt;
&lt;br /&gt;
L0 = 0.3 &lt;br /&gt;
&lt;br /&gt;
Lvec = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
Lhat = norm(Lvec)&lt;br /&gt;
&lt;br /&gt;
Lmag = mag(Lvec)&lt;br /&gt;
&lt;br /&gt;
Fspr = (-ks)*(Lmag - L0)*(Lhat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate kinetic energy:&lt;br /&gt;
&lt;br /&gt;
Kinetic = (1/2)*(mball*(vel**2))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a graph:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
pgraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add plots to the graph:&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(t, fnet.y))  &lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pot=(t, ball.p.y))&lt;br /&gt;
&lt;br /&gt;
==Computational Model==&lt;br /&gt;
&lt;br /&gt;
VPython is used to create computational, 3D models of various real world situations in order to better visualize how different equations can manipulate different scenarios. This is very valuable since many of the equations and situations that are coded in vPython are extremely difficult to make a functioning model of in real life. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For instance, the picture below is an example of program that was programmed to show the orbit of a craft around Earth. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This picture shows a graph that tracks&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Simple:&lt;br /&gt;
&lt;br /&gt;
Creating Shapes:&lt;br /&gt;
&lt;br /&gt;
Sphere:&lt;br /&gt;
&lt;br /&gt;
sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red)&lt;br /&gt;
&lt;br /&gt;
Arrow:&lt;br /&gt;
&lt;br /&gt;
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
Vector:&lt;br /&gt;
&lt;br /&gt;
vector=vector(0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
Trail:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=sphere.color)&lt;br /&gt;
&lt;br /&gt;
trail.append(pos=sphere.pos)&lt;br /&gt;
&lt;br /&gt;
Setting Scene Range:&lt;br /&gt;
&lt;br /&gt;
scene.range=11*sphere.radius&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Helix:&lt;br /&gt;
&lt;br /&gt;
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) &lt;br /&gt;
&lt;br /&gt;
Intermediate:&lt;br /&gt;
&lt;br /&gt;
Graphs:&lt;br /&gt;
&lt;br /&gt;
Setup graphing windows:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph = gcurve(color=color.yellow)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=300)&lt;br /&gt;
&lt;br /&gt;
Plotting:&lt;br /&gt;
&lt;br /&gt;
pgraph = gcurve(color=color.blue)&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(time, Fnet.y))&lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pos=(time, sphere.y))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Difficult:&lt;br /&gt;
&lt;br /&gt;
Using Loops to update Equations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CONSTANTS:&lt;br /&gt;
&lt;br /&gt;
G = ?&lt;br /&gt;
&lt;br /&gt;
mEarth = ?&lt;br /&gt;
&lt;br /&gt;
mmoon = ?&lt;br /&gt;
&lt;br /&gt;
mcraft = ?&lt;br /&gt;
&lt;br /&gt;
deltat = ?&lt;br /&gt;
&lt;br /&gt;
t = ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJECTS AND INITIAL VALUES:&lt;br /&gt;
&lt;br /&gt;
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
scene.range=11*Earth.radius&lt;br /&gt;
&lt;br /&gt;
Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white)&lt;br /&gt;
&lt;br /&gt;
Add a radius for the spacecraft. It should be BIG, so it can be seen:&lt;br /&gt;
&lt;br /&gt;
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow)&lt;br /&gt;
vcraft = vector(206, 2645,0)&lt;br /&gt;
pcraft = mcraft*vcraft&lt;br /&gt;
pArrow=arrow(color=color.green)&lt;br /&gt;
fArrow=arrow(color=color.cyan)&lt;br /&gt;
dpArrow=arrow(color=color.red)&lt;br /&gt;
Fnet_tangent_arrow = arrow(color=color.yellow)&lt;br /&gt;
Fnet_perp_arrow= arrow(color=color.magenta)&lt;br /&gt;
&lt;br /&gt;
This creates a trail for the spacecraft:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=craft.color)  &lt;br /&gt;
&lt;br /&gt;
And this prevents zooming in or out:&lt;br /&gt;
  &lt;br /&gt;
scene.autoscale = 0                 &lt;br /&gt;
pscale=Earth.radius/mag(pcraft)&lt;br /&gt;
fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2)&lt;br /&gt;
dpscale=500*Earth.radius/mag(pcraft)&lt;br /&gt;
print(&amp;quot;p=&amp;quot;, pcraft)&lt;br /&gt;
&lt;br /&gt;
CALCULATIONS:&lt;br /&gt;
&lt;br /&gt;
Sets time for loop to run:&lt;br /&gt;
&lt;br /&gt;
while t &amp;lt; 165240: &lt;br /&gt;
This slows down the animation (runs faster with bigger number):&lt;br /&gt;
    rate(10000)   &lt;br /&gt;
&lt;br /&gt;
     Add statements here for the iterative update of gravitational&lt;br /&gt;
    force, momentum, and position.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    r = craft.pos-Earth.pos&lt;br /&gt;
    rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2))&lt;br /&gt;
    Fmag= G*mEarth*mcraft/(rmag**2)&lt;br /&gt;
    rhat= r/rmag&lt;br /&gt;
    rmoon= craft.pos - Moon.pos&lt;br /&gt;
    rmoonmag= mag(rmoon)&lt;br /&gt;
    rmoonhat= norm(rmoon)&lt;br /&gt;
    Fmoonmag= G*mmoon*mcraft/(rmoonmag**2)&lt;br /&gt;
    Fmoon= -Fmoonmag*rmoonhat&lt;br /&gt;
    p_init= mag(pcraft)&lt;br /&gt;
    pcraft_i=pcraft+vector(0,0,0)&lt;br /&gt;
    Fearth= -Fmag*rhat&lt;br /&gt;
    Fnet= Fearth + Fmoon&lt;br /&gt;
    pcraft=Fnet*deltat+pcraft&lt;br /&gt;
    p_final=mag(pcraft)&lt;br /&gt;
&lt;br /&gt;
    Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat&lt;br /&gt;
    Fnet_tangent_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_tangent_arrow.axis=Fnet_tangent*fscale&lt;br /&gt;
    Fnet_perp = Fnet-Fnet_tangent&lt;br /&gt;
    Fnet_perp_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_perp_arrow.axis=Fnet_perp*fscale&lt;br /&gt;
    vcraft=pcraft/mcraft&lt;br /&gt;
    craft.pos=vcraft*deltat+craft.pos&lt;br /&gt;
    pArrow.pos=craft.pos&lt;br /&gt;
    pArrow.axis=pcraft*pscale&lt;br /&gt;
    fArrow.pos=craft.pos&lt;br /&gt;
    fArrow.axis=Fnet*fscale&lt;br /&gt;
    deltap= pcraft-pcraft_i&lt;br /&gt;
    dpArrow.pos=craft.pos&lt;br /&gt;
    dpArrow.axis=deltap*dpscale&lt;br /&gt;
    scene.center=craft.pos&lt;br /&gt;
    scene.range=craft.radius*600&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Uncomment these two lines to exit the loop if&lt;br /&gt;
   the spacecraft crashes onto the Earth.&lt;br /&gt;
&lt;br /&gt;
    if rmag &amp;lt; Earth.radius: &lt;br /&gt;
        break&lt;br /&gt;
&lt;br /&gt;
    trail.append(pos=craft.pos)  &lt;br /&gt;
    t = t+deltat&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
vPython codes are extremely useful for modeling physics situations. However, the coding skills learned in this class can be applied to almost anything. For example, Aerospace Engineers are becoming increasingly dependent on computer simulations to test ideas before prototyping to reduce costs.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
vPython was released in 2008. It was developed by researchers at Carnegie Mellon University. It is largely used for educational purposes especially producing physics models.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
http://vpython.org/contents/history.html&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=File:Earthorbit.jpg&amp;diff=27977</id>
		<title>File:Earthorbit.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=File:Earthorbit.jpg&amp;diff=27977"/>
		<updated>2017-04-09T17:09:01Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=27976</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=27976"/>
		<updated>2017-04-09T17:08:41Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: /* Computational Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Claimed by Madelyn Hightower- Spring 2017 &lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
This page discusses basic functioning of vPython and how the program can be used to produce models. While vPython is rather similar to the normal Python and uses the same syntax, vPython is an extension of Python and allows users to produce 3D models. It is frequently used for educational purposes, however it has also been used in research to help scientists visualize 3D models. &lt;br /&gt;
VPython, if used correctly, can be very helpful in learning new concepts in courses like physics, or helping to further study on models that may not be easy to create in real life.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
Before learning how to code vPython, the first step is to download the proper application. If interested, before downloading vPython, glow script is a great resource to practice using vPython. Glow script also creates 3D models and run programs just like vPython, so it is a great resource to try out.&lt;br /&gt;
&lt;br /&gt;
To download vPython, first either install Continuum Anaconda Python Distribution. Choose from either the Anaconda with Python 3.x  (this form is recommended on vypthon.org, especially if &amp;quot;Classic&amp;quot; VPython/Python 2.7 has previously been installed on the device.) &lt;br /&gt;
&lt;br /&gt;
In order to access the necessary download, use this link: https://www.python.org/downloads/&lt;br /&gt;
&lt;br /&gt;
For windows, then go to the Power Shell or Command Prompt and type &amp;quot; pip install vpython &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For macs,  go to Terminal and type &amp;quot; pip install vypython &amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Vpython will then be successfully downloaded onto the device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mathematical Model==&lt;br /&gt;
Vpython can compute any equation, but some that may be most helpful and most useful for Physics can be found below. (Keep in mind you can alter these numbers to be whatever you need, these are just to provide an example): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Always start vPython windows with:&lt;br /&gt;
&lt;br /&gt;
from__future__ import division&lt;br /&gt;
&lt;br /&gt;
from visual import*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update momentum:&lt;br /&gt;
&lt;br /&gt;
pf = pi + Fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update position:&lt;br /&gt;
&lt;br /&gt;
objectf.pos = objecti.pos + (pcart/mcart)*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a vector:&lt;br /&gt;
&lt;br /&gt;
vector(0,0,0) -- fill in with whatever numbers the vector should be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gravitational Force:&lt;br /&gt;
&lt;br /&gt;
CONSTANTS&lt;br /&gt;
&lt;br /&gt;
G = 6.7e-11&lt;br /&gt;
&lt;br /&gt;
mEarth = 6e24&lt;br /&gt;
&lt;br /&gt;
mcraft = 15e3&lt;br /&gt;
&lt;br /&gt;
deltat = 60&lt;br /&gt;
&lt;br /&gt;
t = 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finds the change in position:&lt;br /&gt;
&lt;br /&gt;
r=craft.pos-Earth.pos  &lt;br /&gt;
&lt;br /&gt;
m=mcraft&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To find the magnitude of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rmag= mag(r)      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the new magnitude of gravitational force:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fmag=(G*mcraft*mEarth)/(rmag**2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the direction of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rhat=r/rmag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate net force:&lt;br /&gt;
&lt;br /&gt;
Fnet=-Fmag*rhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate spring force:&lt;br /&gt;
&lt;br /&gt;
L0 = 0.3 &lt;br /&gt;
&lt;br /&gt;
Lvec = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
Lhat = norm(Lvec)&lt;br /&gt;
&lt;br /&gt;
Lmag = mag(Lvec)&lt;br /&gt;
&lt;br /&gt;
Fspr = (-ks)*(Lmag - L0)*(Lhat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate kinetic energy:&lt;br /&gt;
&lt;br /&gt;
Kinetic = (1/2)*(mball*(vel**2))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a graph:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
pgraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add plots to the graph:&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(t, fnet.y))  &lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pot=(t, ball.p.y))&lt;br /&gt;
&lt;br /&gt;
==Computational Model==&lt;br /&gt;
&lt;br /&gt;
VPython is used to create computational, 3D models of various real world situations in order to better visualize how different equations can manipulate different scenarios. This is very valuable since many of the equations and situations that are coded in vPython are extremely difficult to make a functioning model of in real life. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For instance, the picture below is an example of program that was programmed to show the orbit of a craft around Earth. &lt;br /&gt;
[[File:Earthorbit.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Simple:&lt;br /&gt;
&lt;br /&gt;
Creating Shapes:&lt;br /&gt;
&lt;br /&gt;
Sphere:&lt;br /&gt;
&lt;br /&gt;
sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red)&lt;br /&gt;
&lt;br /&gt;
Arrow:&lt;br /&gt;
&lt;br /&gt;
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
Vector:&lt;br /&gt;
&lt;br /&gt;
vector=vector(0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
Trail:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=sphere.color)&lt;br /&gt;
&lt;br /&gt;
trail.append(pos=sphere.pos)&lt;br /&gt;
&lt;br /&gt;
Setting Scene Range:&lt;br /&gt;
&lt;br /&gt;
scene.range=11*sphere.radius&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Helix:&lt;br /&gt;
&lt;br /&gt;
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) &lt;br /&gt;
&lt;br /&gt;
Intermediate:&lt;br /&gt;
&lt;br /&gt;
Graphs:&lt;br /&gt;
&lt;br /&gt;
Setup graphing windows:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph = gcurve(color=color.yellow)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=300)&lt;br /&gt;
&lt;br /&gt;
Plotting:&lt;br /&gt;
&lt;br /&gt;
pgraph = gcurve(color=color.blue)&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(time, Fnet.y))&lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pos=(time, sphere.y))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Difficult:&lt;br /&gt;
&lt;br /&gt;
Using Loops to update Equations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CONSTANTS:&lt;br /&gt;
&lt;br /&gt;
G = ?&lt;br /&gt;
&lt;br /&gt;
mEarth = ?&lt;br /&gt;
&lt;br /&gt;
mmoon = ?&lt;br /&gt;
&lt;br /&gt;
mcraft = ?&lt;br /&gt;
&lt;br /&gt;
deltat = ?&lt;br /&gt;
&lt;br /&gt;
t = ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJECTS AND INITIAL VALUES:&lt;br /&gt;
&lt;br /&gt;
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
scene.range=11*Earth.radius&lt;br /&gt;
&lt;br /&gt;
Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white)&lt;br /&gt;
&lt;br /&gt;
Add a radius for the spacecraft. It should be BIG, so it can be seen:&lt;br /&gt;
&lt;br /&gt;
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow)&lt;br /&gt;
vcraft = vector(206, 2645,0)&lt;br /&gt;
pcraft = mcraft*vcraft&lt;br /&gt;
pArrow=arrow(color=color.green)&lt;br /&gt;
fArrow=arrow(color=color.cyan)&lt;br /&gt;
dpArrow=arrow(color=color.red)&lt;br /&gt;
Fnet_tangent_arrow = arrow(color=color.yellow)&lt;br /&gt;
Fnet_perp_arrow= arrow(color=color.magenta)&lt;br /&gt;
&lt;br /&gt;
This creates a trail for the spacecraft:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=craft.color)  &lt;br /&gt;
&lt;br /&gt;
And this prevents zooming in or out:&lt;br /&gt;
  &lt;br /&gt;
scene.autoscale = 0                 &lt;br /&gt;
pscale=Earth.radius/mag(pcraft)&lt;br /&gt;
fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2)&lt;br /&gt;
dpscale=500*Earth.radius/mag(pcraft)&lt;br /&gt;
print(&amp;quot;p=&amp;quot;, pcraft)&lt;br /&gt;
&lt;br /&gt;
CALCULATIONS:&lt;br /&gt;
&lt;br /&gt;
Sets time for loop to run:&lt;br /&gt;
&lt;br /&gt;
while t &amp;lt; 165240: &lt;br /&gt;
This slows down the animation (runs faster with bigger number):&lt;br /&gt;
    rate(10000)   &lt;br /&gt;
&lt;br /&gt;
     Add statements here for the iterative update of gravitational&lt;br /&gt;
    force, momentum, and position.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    r = craft.pos-Earth.pos&lt;br /&gt;
    rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2))&lt;br /&gt;
    Fmag= G*mEarth*mcraft/(rmag**2)&lt;br /&gt;
    rhat= r/rmag&lt;br /&gt;
    rmoon= craft.pos - Moon.pos&lt;br /&gt;
    rmoonmag= mag(rmoon)&lt;br /&gt;
    rmoonhat= norm(rmoon)&lt;br /&gt;
    Fmoonmag= G*mmoon*mcraft/(rmoonmag**2)&lt;br /&gt;
    Fmoon= -Fmoonmag*rmoonhat&lt;br /&gt;
    p_init= mag(pcraft)&lt;br /&gt;
    pcraft_i=pcraft+vector(0,0,0)&lt;br /&gt;
    Fearth= -Fmag*rhat&lt;br /&gt;
    Fnet= Fearth + Fmoon&lt;br /&gt;
    pcraft=Fnet*deltat+pcraft&lt;br /&gt;
    p_final=mag(pcraft)&lt;br /&gt;
&lt;br /&gt;
    Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat&lt;br /&gt;
    Fnet_tangent_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_tangent_arrow.axis=Fnet_tangent*fscale&lt;br /&gt;
    Fnet_perp = Fnet-Fnet_tangent&lt;br /&gt;
    Fnet_perp_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_perp_arrow.axis=Fnet_perp*fscale&lt;br /&gt;
    vcraft=pcraft/mcraft&lt;br /&gt;
    craft.pos=vcraft*deltat+craft.pos&lt;br /&gt;
    pArrow.pos=craft.pos&lt;br /&gt;
    pArrow.axis=pcraft*pscale&lt;br /&gt;
    fArrow.pos=craft.pos&lt;br /&gt;
    fArrow.axis=Fnet*fscale&lt;br /&gt;
    deltap= pcraft-pcraft_i&lt;br /&gt;
    dpArrow.pos=craft.pos&lt;br /&gt;
    dpArrow.axis=deltap*dpscale&lt;br /&gt;
    scene.center=craft.pos&lt;br /&gt;
    scene.range=craft.radius*600&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Uncomment these two lines to exit the loop if&lt;br /&gt;
   the spacecraft crashes onto the Earth.&lt;br /&gt;
&lt;br /&gt;
    if rmag &amp;lt; Earth.radius: &lt;br /&gt;
        break&lt;br /&gt;
&lt;br /&gt;
    trail.append(pos=craft.pos)  &lt;br /&gt;
    t = t+deltat&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
vPython codes are extremely useful for modeling physics situations. However, the coding skills learned in this class can be applied to almost anything. For example, Aerospace Engineers are becoming increasingly dependent on computer simulations to test ideas before prototyping to reduce costs.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
vPython was released in 2008. It was developed by researchers at Carnegie Mellon University. It is largely used for educational purposes especially producing physics models.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
http://vpython.org/contents/history.html&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=27974</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=27974"/>
		<updated>2017-04-09T17:01:51Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: /* Mathematical Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Claimed by Madelyn Hightower- Spring 2017 &lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
This page discusses basic functioning of vPython and how the program can be used to produce models. While vPython is rather similar to the normal Python and uses the same syntax, vPython is an extension of Python and allows users to produce 3D models. It is frequently used for educational purposes, however it has also been used in research to help scientists visualize 3D models. &lt;br /&gt;
VPython, if used correctly, can be very helpful in learning new concepts in courses like physics, or helping to further study on models that may not be easy to create in real life.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
Before learning how to code vPython, the first step is to download the proper application. If interested, before downloading vPython, glow script is a great resource to practice using vPython. Glow script also creates 3D models and run programs just like vPython, so it is a great resource to try out.&lt;br /&gt;
&lt;br /&gt;
To download vPython, first either install Continuum Anaconda Python Distribution. Choose from either the Anaconda with Python 3.x  (this form is recommended on vypthon.org, especially if &amp;quot;Classic&amp;quot; VPython/Python 2.7 has previously been installed on the device.) &lt;br /&gt;
&lt;br /&gt;
In order to access the necessary download, use this link: https://www.python.org/downloads/&lt;br /&gt;
&lt;br /&gt;
For windows, then go to the Power Shell or Command Prompt and type &amp;quot; pip install vpython &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For macs,  go to Terminal and type &amp;quot; pip install vypython &amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Vpython will then be successfully downloaded onto the device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mathematical Model==&lt;br /&gt;
Vpython can compute any equation, but some that may be most helpful and most useful for Physics can be found below. (Keep in mind you can alter these numbers to be whatever you need, these are just to provide an example): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Always start vPython windows with:&lt;br /&gt;
&lt;br /&gt;
from__future__ import division&lt;br /&gt;
&lt;br /&gt;
from visual import*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update momentum:&lt;br /&gt;
&lt;br /&gt;
pf = pi + Fnet*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To update position:&lt;br /&gt;
&lt;br /&gt;
objectf.pos = objecti.pos + (pcart/mcart)*deltat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a vector:&lt;br /&gt;
&lt;br /&gt;
vector(0,0,0) -- fill in with whatever numbers the vector should be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gravitational Force:&lt;br /&gt;
&lt;br /&gt;
CONSTANTS&lt;br /&gt;
&lt;br /&gt;
G = 6.7e-11&lt;br /&gt;
&lt;br /&gt;
mEarth = 6e24&lt;br /&gt;
&lt;br /&gt;
mcraft = 15e3&lt;br /&gt;
&lt;br /&gt;
deltat = 60&lt;br /&gt;
&lt;br /&gt;
t = 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finds the change in position:&lt;br /&gt;
&lt;br /&gt;
r=craft.pos-Earth.pos  &lt;br /&gt;
&lt;br /&gt;
m=mcraft&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To find the magnitude of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rmag= mag(r)      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the new magnitude of gravitational force:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fmag=(G*mcraft*mEarth)/(rmag**2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate the direction of the change in position:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rhat=r/rmag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate net force:&lt;br /&gt;
&lt;br /&gt;
Fnet=-Fmag*rhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate spring force:&lt;br /&gt;
&lt;br /&gt;
L0 = 0.3 &lt;br /&gt;
&lt;br /&gt;
Lvec = ball.pos - ceiling.pos&lt;br /&gt;
&lt;br /&gt;
Lhat = norm(Lvec)&lt;br /&gt;
&lt;br /&gt;
Lmag = mag(Lvec)&lt;br /&gt;
&lt;br /&gt;
Fspr = (-ks)*(Lmag - L0)*(Lhat)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To calculate kinetic energy:&lt;br /&gt;
&lt;br /&gt;
Kinetic = (1/2)*(mball*(vel**2))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create a graph:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
pgraph= gcurve(color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add plots to the graph:&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(t, fnet.y))  &lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pot=(t, ball.p.y))&lt;br /&gt;
&lt;br /&gt;
==Computational Model==&lt;br /&gt;
&lt;br /&gt;
VPython is used to create computational models of various real world situations so that we can see how these equations used in the code can manipulate these situations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Simple:&lt;br /&gt;
&lt;br /&gt;
Creating Shapes:&lt;br /&gt;
&lt;br /&gt;
Sphere:&lt;br /&gt;
&lt;br /&gt;
sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red)&lt;br /&gt;
&lt;br /&gt;
Arrow:&lt;br /&gt;
&lt;br /&gt;
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
Vector:&lt;br /&gt;
&lt;br /&gt;
vector=vector(0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
Trail:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=sphere.color)&lt;br /&gt;
&lt;br /&gt;
trail.append(pos=sphere.pos)&lt;br /&gt;
&lt;br /&gt;
Setting Scene Range:&lt;br /&gt;
&lt;br /&gt;
scene.range=11*sphere.radius&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Helix:&lt;br /&gt;
&lt;br /&gt;
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) &lt;br /&gt;
&lt;br /&gt;
Intermediate:&lt;br /&gt;
&lt;br /&gt;
Graphs:&lt;br /&gt;
&lt;br /&gt;
Setup graphing windows:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph = gcurve(color=color.yellow)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=300)&lt;br /&gt;
&lt;br /&gt;
Plotting:&lt;br /&gt;
&lt;br /&gt;
pgraph = gcurve(color=color.blue)&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(time, Fnet.y))&lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pos=(time, sphere.y))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Difficult:&lt;br /&gt;
&lt;br /&gt;
Using Loops to update Equations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CONSTANTS:&lt;br /&gt;
&lt;br /&gt;
G = ?&lt;br /&gt;
&lt;br /&gt;
mEarth = ?&lt;br /&gt;
&lt;br /&gt;
mmoon = ?&lt;br /&gt;
&lt;br /&gt;
mcraft = ?&lt;br /&gt;
&lt;br /&gt;
deltat = ?&lt;br /&gt;
&lt;br /&gt;
t = ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJECTS AND INITIAL VALUES:&lt;br /&gt;
&lt;br /&gt;
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
scene.range=11*Earth.radius&lt;br /&gt;
&lt;br /&gt;
Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white)&lt;br /&gt;
&lt;br /&gt;
Add a radius for the spacecraft. It should be BIG, so it can be seen:&lt;br /&gt;
&lt;br /&gt;
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow)&lt;br /&gt;
vcraft = vector(206, 2645,0)&lt;br /&gt;
pcraft = mcraft*vcraft&lt;br /&gt;
pArrow=arrow(color=color.green)&lt;br /&gt;
fArrow=arrow(color=color.cyan)&lt;br /&gt;
dpArrow=arrow(color=color.red)&lt;br /&gt;
Fnet_tangent_arrow = arrow(color=color.yellow)&lt;br /&gt;
Fnet_perp_arrow= arrow(color=color.magenta)&lt;br /&gt;
&lt;br /&gt;
This creates a trail for the spacecraft:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=craft.color)  &lt;br /&gt;
&lt;br /&gt;
And this prevents zooming in or out:&lt;br /&gt;
  &lt;br /&gt;
scene.autoscale = 0                 &lt;br /&gt;
pscale=Earth.radius/mag(pcraft)&lt;br /&gt;
fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2)&lt;br /&gt;
dpscale=500*Earth.radius/mag(pcraft)&lt;br /&gt;
print(&amp;quot;p=&amp;quot;, pcraft)&lt;br /&gt;
&lt;br /&gt;
CALCULATIONS:&lt;br /&gt;
&lt;br /&gt;
Sets time for loop to run:&lt;br /&gt;
&lt;br /&gt;
while t &amp;lt; 165240: &lt;br /&gt;
This slows down the animation (runs faster with bigger number):&lt;br /&gt;
    rate(10000)   &lt;br /&gt;
&lt;br /&gt;
     Add statements here for the iterative update of gravitational&lt;br /&gt;
    force, momentum, and position.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    r = craft.pos-Earth.pos&lt;br /&gt;
    rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2))&lt;br /&gt;
    Fmag= G*mEarth*mcraft/(rmag**2)&lt;br /&gt;
    rhat= r/rmag&lt;br /&gt;
    rmoon= craft.pos - Moon.pos&lt;br /&gt;
    rmoonmag= mag(rmoon)&lt;br /&gt;
    rmoonhat= norm(rmoon)&lt;br /&gt;
    Fmoonmag= G*mmoon*mcraft/(rmoonmag**2)&lt;br /&gt;
    Fmoon= -Fmoonmag*rmoonhat&lt;br /&gt;
    p_init= mag(pcraft)&lt;br /&gt;
    pcraft_i=pcraft+vector(0,0,0)&lt;br /&gt;
    Fearth= -Fmag*rhat&lt;br /&gt;
    Fnet= Fearth + Fmoon&lt;br /&gt;
    pcraft=Fnet*deltat+pcraft&lt;br /&gt;
    p_final=mag(pcraft)&lt;br /&gt;
&lt;br /&gt;
    Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat&lt;br /&gt;
    Fnet_tangent_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_tangent_arrow.axis=Fnet_tangent*fscale&lt;br /&gt;
    Fnet_perp = Fnet-Fnet_tangent&lt;br /&gt;
    Fnet_perp_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_perp_arrow.axis=Fnet_perp*fscale&lt;br /&gt;
    vcraft=pcraft/mcraft&lt;br /&gt;
    craft.pos=vcraft*deltat+craft.pos&lt;br /&gt;
    pArrow.pos=craft.pos&lt;br /&gt;
    pArrow.axis=pcraft*pscale&lt;br /&gt;
    fArrow.pos=craft.pos&lt;br /&gt;
    fArrow.axis=Fnet*fscale&lt;br /&gt;
    deltap= pcraft-pcraft_i&lt;br /&gt;
    dpArrow.pos=craft.pos&lt;br /&gt;
    dpArrow.axis=deltap*dpscale&lt;br /&gt;
    scene.center=craft.pos&lt;br /&gt;
    scene.range=craft.radius*600&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Uncomment these two lines to exit the loop if&lt;br /&gt;
   the spacecraft crashes onto the Earth.&lt;br /&gt;
&lt;br /&gt;
    if rmag &amp;lt; Earth.radius: &lt;br /&gt;
        break&lt;br /&gt;
&lt;br /&gt;
    trail.append(pos=craft.pos)  &lt;br /&gt;
    t = t+deltat&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
vPython codes are extremely useful for modeling physics situations. However, the coding skills learned in this class can be applied to almost anything. For example, Aerospace Engineers are becoming increasingly dependent on computer simulations to test ideas before prototyping to reduce costs.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
vPython was released in 2008. It was developed by researchers at Carnegie Mellon University. It is largely used for educational purposes especially producing physics models.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
http://vpython.org/contents/history.html&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=27971</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=27971"/>
		<updated>2017-04-09T16:54:09Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: /* Downloading vPython */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Claimed by Madelyn Hightower- Spring 2017 &lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
This page discusses basic functioning of vPython and how the program can be used to produce models. While vPython is rather similar to the normal Python and uses the same syntax, vPython is an extension of Python and allows users to produce 3D models. It is frequently used for educational purposes, however it has also been used in research to help scientists visualize 3D models. &lt;br /&gt;
VPython, if used correctly, can be very helpful in learning new concepts in courses like physics, or helping to further study on models that may not be easy to create in real life.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
Before learning how to code vPython, the first step is to download the proper application. If interested, before downloading vPython, glow script is a great resource to practice using vPython. Glow script also creates 3D models and run programs just like vPython, so it is a great resource to try out.&lt;br /&gt;
&lt;br /&gt;
To download vPython, first either install Continuum Anaconda Python Distribution. Choose from either the Anaconda with Python 3.x  (this form is recommended on vypthon.org, especially if &amp;quot;Classic&amp;quot; VPython/Python 2.7 has previously been installed on the device.) &lt;br /&gt;
&lt;br /&gt;
In order to access the necessary download, use this link: https://www.python.org/downloads/&lt;br /&gt;
&lt;br /&gt;
For windows, then go to the Power Shell or Command Prompt and type &amp;quot; pip install vpython &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For macs,  go to Terminal and type &amp;quot; pip install vypython &amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Vpython will then be successfully downloaded onto the device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mathematical Model==&lt;br /&gt;
Vpython can compute any equation, but some that may be most helpful and most useful for Physics can be found below: &lt;br /&gt;
&lt;br /&gt;
Always start vPython windows with:&lt;br /&gt;
&lt;br /&gt;
from__future__ import division&lt;br /&gt;
&lt;br /&gt;
from visual import*&lt;br /&gt;
&lt;br /&gt;
To update momentum:&lt;br /&gt;
&lt;br /&gt;
pf = pi + Fnet*deltat&lt;br /&gt;
&lt;br /&gt;
To update position:&lt;br /&gt;
&lt;br /&gt;
objectf.pos = objecti.pos + (pcart/mcart)*deltat&lt;br /&gt;
&lt;br /&gt;
To create a vector:&lt;br /&gt;
&lt;br /&gt;
vector(0,0,0) -- fill in with whatever numbers the vector should be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gravitational Force:&lt;br /&gt;
&lt;br /&gt;
CONSTANTS&lt;br /&gt;
G = 6.7e-11&lt;br /&gt;
mEarth = 6e24&lt;br /&gt;
mcraft = 15e3&lt;br /&gt;
deltat = 60&lt;br /&gt;
t = 0&lt;br /&gt;
&lt;br /&gt;
Finds the change in position:&lt;br /&gt;
&lt;br /&gt;
r=craft.pos-Earth.pos  &lt;br /&gt;
m=mcraft&lt;br /&gt;
&lt;br /&gt;
To find the magnitude of the change in position:&lt;br /&gt;
&lt;br /&gt;
rmag= mag(r)      &lt;br /&gt;
&lt;br /&gt;
To calculate the new magnitude of gravitational force:&lt;br /&gt;
&lt;br /&gt;
Fmag=(G*mcraft*mEarth)/(rmag**2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Calculates the direction of tbe change in position:&lt;br /&gt;
&lt;br /&gt;
rhat=r/rmag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Calculates net force:&lt;br /&gt;
&lt;br /&gt;
Fnet=-Fmag*rhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Spring Force:&lt;br /&gt;
&lt;br /&gt;
L0 = 0.3 &lt;br /&gt;
Lvec = ball.pos - ceiling.pos&lt;br /&gt;
Lhat = norm(Lvec)&lt;br /&gt;
Lmag = mag(Lvec)&lt;br /&gt;
Fspr = (-ks)*(Lmag - L0)*(Lhat)&lt;br /&gt;
&lt;br /&gt;
Kinetic Energy:&lt;br /&gt;
&lt;br /&gt;
Kinetic = (1/2)*(mball*(vel**2))&lt;br /&gt;
&lt;br /&gt;
==Computational Model==&lt;br /&gt;
&lt;br /&gt;
VPython is used to create computational models of various real world situations so that we can see how these equations used in the code can manipulate these situations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Simple:&lt;br /&gt;
&lt;br /&gt;
Creating Shapes:&lt;br /&gt;
&lt;br /&gt;
Sphere:&lt;br /&gt;
&lt;br /&gt;
sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red)&lt;br /&gt;
&lt;br /&gt;
Arrow:&lt;br /&gt;
&lt;br /&gt;
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
Vector:&lt;br /&gt;
&lt;br /&gt;
vector=vector(0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
Trail:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=sphere.color)&lt;br /&gt;
&lt;br /&gt;
trail.append(pos=sphere.pos)&lt;br /&gt;
&lt;br /&gt;
Setting Scene Range:&lt;br /&gt;
&lt;br /&gt;
scene.range=11*sphere.radius&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Helix:&lt;br /&gt;
&lt;br /&gt;
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) &lt;br /&gt;
&lt;br /&gt;
Intermediate:&lt;br /&gt;
&lt;br /&gt;
Graphs:&lt;br /&gt;
&lt;br /&gt;
Setup graphing windows:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph = gcurve(color=color.yellow)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=300)&lt;br /&gt;
&lt;br /&gt;
Plotting:&lt;br /&gt;
&lt;br /&gt;
pgraph = gcurve(color=color.blue)&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(time, Fnet.y))&lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pos=(time, sphere.y))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Difficult:&lt;br /&gt;
&lt;br /&gt;
Using Loops to update Equations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CONSTANTS:&lt;br /&gt;
&lt;br /&gt;
G = ?&lt;br /&gt;
&lt;br /&gt;
mEarth = ?&lt;br /&gt;
&lt;br /&gt;
mmoon = ?&lt;br /&gt;
&lt;br /&gt;
mcraft = ?&lt;br /&gt;
&lt;br /&gt;
deltat = ?&lt;br /&gt;
&lt;br /&gt;
t = ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJECTS AND INITIAL VALUES:&lt;br /&gt;
&lt;br /&gt;
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
scene.range=11*Earth.radius&lt;br /&gt;
&lt;br /&gt;
Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white)&lt;br /&gt;
&lt;br /&gt;
Add a radius for the spacecraft. It should be BIG, so it can be seen:&lt;br /&gt;
&lt;br /&gt;
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow)&lt;br /&gt;
vcraft = vector(206, 2645,0)&lt;br /&gt;
pcraft = mcraft*vcraft&lt;br /&gt;
pArrow=arrow(color=color.green)&lt;br /&gt;
fArrow=arrow(color=color.cyan)&lt;br /&gt;
dpArrow=arrow(color=color.red)&lt;br /&gt;
Fnet_tangent_arrow = arrow(color=color.yellow)&lt;br /&gt;
Fnet_perp_arrow= arrow(color=color.magenta)&lt;br /&gt;
&lt;br /&gt;
This creates a trail for the spacecraft:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=craft.color)  &lt;br /&gt;
&lt;br /&gt;
And this prevents zooming in or out:&lt;br /&gt;
  &lt;br /&gt;
scene.autoscale = 0                 &lt;br /&gt;
pscale=Earth.radius/mag(pcraft)&lt;br /&gt;
fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2)&lt;br /&gt;
dpscale=500*Earth.radius/mag(pcraft)&lt;br /&gt;
print(&amp;quot;p=&amp;quot;, pcraft)&lt;br /&gt;
&lt;br /&gt;
CALCULATIONS:&lt;br /&gt;
&lt;br /&gt;
Sets time for loop to run:&lt;br /&gt;
&lt;br /&gt;
while t &amp;lt; 165240: &lt;br /&gt;
This slows down the animation (runs faster with bigger number):&lt;br /&gt;
    rate(10000)   &lt;br /&gt;
&lt;br /&gt;
     Add statements here for the iterative update of gravitational&lt;br /&gt;
    force, momentum, and position.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    r = craft.pos-Earth.pos&lt;br /&gt;
    rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2))&lt;br /&gt;
    Fmag= G*mEarth*mcraft/(rmag**2)&lt;br /&gt;
    rhat= r/rmag&lt;br /&gt;
    rmoon= craft.pos - Moon.pos&lt;br /&gt;
    rmoonmag= mag(rmoon)&lt;br /&gt;
    rmoonhat= norm(rmoon)&lt;br /&gt;
    Fmoonmag= G*mmoon*mcraft/(rmoonmag**2)&lt;br /&gt;
    Fmoon= -Fmoonmag*rmoonhat&lt;br /&gt;
    p_init= mag(pcraft)&lt;br /&gt;
    pcraft_i=pcraft+vector(0,0,0)&lt;br /&gt;
    Fearth= -Fmag*rhat&lt;br /&gt;
    Fnet= Fearth + Fmoon&lt;br /&gt;
    pcraft=Fnet*deltat+pcraft&lt;br /&gt;
    p_final=mag(pcraft)&lt;br /&gt;
&lt;br /&gt;
    Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat&lt;br /&gt;
    Fnet_tangent_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_tangent_arrow.axis=Fnet_tangent*fscale&lt;br /&gt;
    Fnet_perp = Fnet-Fnet_tangent&lt;br /&gt;
    Fnet_perp_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_perp_arrow.axis=Fnet_perp*fscale&lt;br /&gt;
    vcraft=pcraft/mcraft&lt;br /&gt;
    craft.pos=vcraft*deltat+craft.pos&lt;br /&gt;
    pArrow.pos=craft.pos&lt;br /&gt;
    pArrow.axis=pcraft*pscale&lt;br /&gt;
    fArrow.pos=craft.pos&lt;br /&gt;
    fArrow.axis=Fnet*fscale&lt;br /&gt;
    deltap= pcraft-pcraft_i&lt;br /&gt;
    dpArrow.pos=craft.pos&lt;br /&gt;
    dpArrow.axis=deltap*dpscale&lt;br /&gt;
    scene.center=craft.pos&lt;br /&gt;
    scene.range=craft.radius*600&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Uncomment these two lines to exit the loop if&lt;br /&gt;
   the spacecraft crashes onto the Earth.&lt;br /&gt;
&lt;br /&gt;
    if rmag &amp;lt; Earth.radius: &lt;br /&gt;
        break&lt;br /&gt;
&lt;br /&gt;
    trail.append(pos=craft.pos)  &lt;br /&gt;
    t = t+deltat&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
vPython codes are extremely useful for modeling physics situations. However, the coding skills learned in this class can be applied to almost anything. For example, Aerospace Engineers are becoming increasingly dependent on computer simulations to test ideas before prototyping to reduce costs.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
vPython was released in 2008. It was developed by researchers at Carnegie Mellon University. It is largely used for educational purposes especially producing physics models.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
http://vpython.org/contents/history.html&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=27970</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=27970"/>
		<updated>2017-04-09T16:53:56Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: /* Mathematical Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Claimed by Madelyn Hightower- Spring 2017 &lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
This page discusses basic functioning of vPython and how the program can be used to produce models. While vPython is rather similar to the normal Python and uses the same syntax, vPython is an extension of Python and allows users to produce 3D models. It is frequently used for educational purposes, however it has also been used in research to help scientists visualize 3D models. &lt;br /&gt;
VPython, if used correctly, can be very helpful in learning new concepts in courses like physics, or helping to further study on models that may not be easy to create in real life.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
Before learning how to code vPython, the first step is to download the proper application. If interested, before downloading vPython, glow script is a great resource to practice using vPython. Glow script also creates 3D models and run programs just like vPython, so it is a great resource to try out.&lt;br /&gt;
&lt;br /&gt;
To download vPython, first either install Continuum Anaconda Python Distribution. Choose from either the Anaconda with Python 3.x  (this form is recommended on vypthon.org, especially if &amp;quot;Classic&amp;quot; VPython/Python 2.7 has previously been installed on the device.) &lt;br /&gt;
&lt;br /&gt;
In order to access the necessary download, use this link: https://www.python.org/downloads/&lt;br /&gt;
&lt;br /&gt;
For windows, then go to the Power Shell or Command Prompt and type &amp;quot; pip install vpython &amp;quot;.&lt;br /&gt;
For macs,  go to Terminal and type &amp;quot; pip install vypython &amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Vpython will then be successfully downloaded onto the device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Mathematical Model==&lt;br /&gt;
Vpython can compute any equation, but some that may be most helpful and most useful for Physics can be found below: &lt;br /&gt;
&lt;br /&gt;
Always start vPython windows with:&lt;br /&gt;
&lt;br /&gt;
from__future__ import division&lt;br /&gt;
&lt;br /&gt;
from visual import*&lt;br /&gt;
&lt;br /&gt;
To update momentum:&lt;br /&gt;
&lt;br /&gt;
pf = pi + Fnet*deltat&lt;br /&gt;
&lt;br /&gt;
To update position:&lt;br /&gt;
&lt;br /&gt;
objectf.pos = objecti.pos + (pcart/mcart)*deltat&lt;br /&gt;
&lt;br /&gt;
To create a vector:&lt;br /&gt;
&lt;br /&gt;
vector(0,0,0) -- fill in with whatever numbers the vector should be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gravitational Force:&lt;br /&gt;
&lt;br /&gt;
CONSTANTS&lt;br /&gt;
G = 6.7e-11&lt;br /&gt;
mEarth = 6e24&lt;br /&gt;
mcraft = 15e3&lt;br /&gt;
deltat = 60&lt;br /&gt;
t = 0&lt;br /&gt;
&lt;br /&gt;
Finds the change in position:&lt;br /&gt;
&lt;br /&gt;
r=craft.pos-Earth.pos  &lt;br /&gt;
m=mcraft&lt;br /&gt;
&lt;br /&gt;
To find the magnitude of the change in position:&lt;br /&gt;
&lt;br /&gt;
rmag= mag(r)      &lt;br /&gt;
&lt;br /&gt;
To calculate the new magnitude of gravitational force:&lt;br /&gt;
&lt;br /&gt;
Fmag=(G*mcraft*mEarth)/(rmag**2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Calculates the direction of tbe change in position:&lt;br /&gt;
&lt;br /&gt;
rhat=r/rmag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Calculates net force:&lt;br /&gt;
&lt;br /&gt;
Fnet=-Fmag*rhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Spring Force:&lt;br /&gt;
&lt;br /&gt;
L0 = 0.3 &lt;br /&gt;
Lvec = ball.pos - ceiling.pos&lt;br /&gt;
Lhat = norm(Lvec)&lt;br /&gt;
Lmag = mag(Lvec)&lt;br /&gt;
Fspr = (-ks)*(Lmag - L0)*(Lhat)&lt;br /&gt;
&lt;br /&gt;
Kinetic Energy:&lt;br /&gt;
&lt;br /&gt;
Kinetic = (1/2)*(mball*(vel**2))&lt;br /&gt;
&lt;br /&gt;
==Computational Model==&lt;br /&gt;
&lt;br /&gt;
VPython is used to create computational models of various real world situations so that we can see how these equations used in the code can manipulate these situations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Simple:&lt;br /&gt;
&lt;br /&gt;
Creating Shapes:&lt;br /&gt;
&lt;br /&gt;
Sphere:&lt;br /&gt;
&lt;br /&gt;
sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red)&lt;br /&gt;
&lt;br /&gt;
Arrow:&lt;br /&gt;
&lt;br /&gt;
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
Vector:&lt;br /&gt;
&lt;br /&gt;
vector=vector(0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
Trail:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=sphere.color)&lt;br /&gt;
&lt;br /&gt;
trail.append(pos=sphere.pos)&lt;br /&gt;
&lt;br /&gt;
Setting Scene Range:&lt;br /&gt;
&lt;br /&gt;
scene.range=11*sphere.radius&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Helix:&lt;br /&gt;
&lt;br /&gt;
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) &lt;br /&gt;
&lt;br /&gt;
Intermediate:&lt;br /&gt;
&lt;br /&gt;
Graphs:&lt;br /&gt;
&lt;br /&gt;
Setup graphing windows:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph = gcurve(color=color.yellow)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=300)&lt;br /&gt;
&lt;br /&gt;
Plotting:&lt;br /&gt;
&lt;br /&gt;
pgraph = gcurve(color=color.blue)&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(time, Fnet.y))&lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pos=(time, sphere.y))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Difficult:&lt;br /&gt;
&lt;br /&gt;
Using Loops to update Equations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CONSTANTS:&lt;br /&gt;
&lt;br /&gt;
G = ?&lt;br /&gt;
&lt;br /&gt;
mEarth = ?&lt;br /&gt;
&lt;br /&gt;
mmoon = ?&lt;br /&gt;
&lt;br /&gt;
mcraft = ?&lt;br /&gt;
&lt;br /&gt;
deltat = ?&lt;br /&gt;
&lt;br /&gt;
t = ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJECTS AND INITIAL VALUES:&lt;br /&gt;
&lt;br /&gt;
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
scene.range=11*Earth.radius&lt;br /&gt;
&lt;br /&gt;
Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white)&lt;br /&gt;
&lt;br /&gt;
Add a radius for the spacecraft. It should be BIG, so it can be seen:&lt;br /&gt;
&lt;br /&gt;
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow)&lt;br /&gt;
vcraft = vector(206, 2645,0)&lt;br /&gt;
pcraft = mcraft*vcraft&lt;br /&gt;
pArrow=arrow(color=color.green)&lt;br /&gt;
fArrow=arrow(color=color.cyan)&lt;br /&gt;
dpArrow=arrow(color=color.red)&lt;br /&gt;
Fnet_tangent_arrow = arrow(color=color.yellow)&lt;br /&gt;
Fnet_perp_arrow= arrow(color=color.magenta)&lt;br /&gt;
&lt;br /&gt;
This creates a trail for the spacecraft:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=craft.color)  &lt;br /&gt;
&lt;br /&gt;
And this prevents zooming in or out:&lt;br /&gt;
  &lt;br /&gt;
scene.autoscale = 0                 &lt;br /&gt;
pscale=Earth.radius/mag(pcraft)&lt;br /&gt;
fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2)&lt;br /&gt;
dpscale=500*Earth.radius/mag(pcraft)&lt;br /&gt;
print(&amp;quot;p=&amp;quot;, pcraft)&lt;br /&gt;
&lt;br /&gt;
CALCULATIONS:&lt;br /&gt;
&lt;br /&gt;
Sets time for loop to run:&lt;br /&gt;
&lt;br /&gt;
while t &amp;lt; 165240: &lt;br /&gt;
This slows down the animation (runs faster with bigger number):&lt;br /&gt;
    rate(10000)   &lt;br /&gt;
&lt;br /&gt;
     Add statements here for the iterative update of gravitational&lt;br /&gt;
    force, momentum, and position.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    r = craft.pos-Earth.pos&lt;br /&gt;
    rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2))&lt;br /&gt;
    Fmag= G*mEarth*mcraft/(rmag**2)&lt;br /&gt;
    rhat= r/rmag&lt;br /&gt;
    rmoon= craft.pos - Moon.pos&lt;br /&gt;
    rmoonmag= mag(rmoon)&lt;br /&gt;
    rmoonhat= norm(rmoon)&lt;br /&gt;
    Fmoonmag= G*mmoon*mcraft/(rmoonmag**2)&lt;br /&gt;
    Fmoon= -Fmoonmag*rmoonhat&lt;br /&gt;
    p_init= mag(pcraft)&lt;br /&gt;
    pcraft_i=pcraft+vector(0,0,0)&lt;br /&gt;
    Fearth= -Fmag*rhat&lt;br /&gt;
    Fnet= Fearth + Fmoon&lt;br /&gt;
    pcraft=Fnet*deltat+pcraft&lt;br /&gt;
    p_final=mag(pcraft)&lt;br /&gt;
&lt;br /&gt;
    Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat&lt;br /&gt;
    Fnet_tangent_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_tangent_arrow.axis=Fnet_tangent*fscale&lt;br /&gt;
    Fnet_perp = Fnet-Fnet_tangent&lt;br /&gt;
    Fnet_perp_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_perp_arrow.axis=Fnet_perp*fscale&lt;br /&gt;
    vcraft=pcraft/mcraft&lt;br /&gt;
    craft.pos=vcraft*deltat+craft.pos&lt;br /&gt;
    pArrow.pos=craft.pos&lt;br /&gt;
    pArrow.axis=pcraft*pscale&lt;br /&gt;
    fArrow.pos=craft.pos&lt;br /&gt;
    fArrow.axis=Fnet*fscale&lt;br /&gt;
    deltap= pcraft-pcraft_i&lt;br /&gt;
    dpArrow.pos=craft.pos&lt;br /&gt;
    dpArrow.axis=deltap*dpscale&lt;br /&gt;
    scene.center=craft.pos&lt;br /&gt;
    scene.range=craft.radius*600&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Uncomment these two lines to exit the loop if&lt;br /&gt;
   the spacecraft crashes onto the Earth.&lt;br /&gt;
&lt;br /&gt;
    if rmag &amp;lt; Earth.radius: &lt;br /&gt;
        break&lt;br /&gt;
&lt;br /&gt;
    trail.append(pos=craft.pos)  &lt;br /&gt;
    t = t+deltat&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
vPython codes are extremely useful for modeling physics situations. However, the coding skills learned in this class can be applied to almost anything. For example, Aerospace Engineers are becoming increasingly dependent on computer simulations to test ideas before prototyping to reduce costs.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
vPython was released in 2008. It was developed by researchers at Carnegie Mellon University. It is largely used for educational purposes especially producing physics models.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
http://vpython.org/contents/history.html&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
	<entry>
		<id>http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=27912</id>
		<title>Python Syntax</title>
		<link rel="alternate" type="text/html" href="http://www.physicsbook.gatech.edu/index.php?title=Python_Syntax&amp;diff=27912"/>
		<updated>2017-04-09T14:29:35Z</updated>

		<summary type="html">&lt;p&gt;MadelynHightower: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Claimed by Madelyn Hightower- Spring 2017 &lt;br /&gt;
&lt;br /&gt;
==The Main Idea==&lt;br /&gt;
This page discusses basic functioning of vPython and how the program can be used to produce models. While vPython is rather similar to the normal Python and uses the same syntax, vPython is an extension of Python and allows users to produce 3D models. It is frequently used for educational purposes, however it has also been used in research to help scientists visualize 3D models. &lt;br /&gt;
VPython, if used correctly, can be very helpful in learning new concepts in courses like physics, or helping to further study on models that may not be easy to create in real life.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Downloading vPython==&lt;br /&gt;
Before learning how to code vPython, the first step is to download the proper application. If interested, before downloading vPython, glow script is a great resource to practice using vPython. Glow script also creates 3D models and run programs just like vPython, so it is a great resource to try out.&lt;br /&gt;
&lt;br /&gt;
To download vPython, first either install Continuum Anaconda Python Distribution. Choose from either the Anaconda with Python 3.x  (this form is recommended on vypthon.org, especially if &amp;quot;Classic&amp;quot; VPython/Python 2.7 has previously been installed on the device.) &lt;br /&gt;
&lt;br /&gt;
In order to access the necessary download, use this link: https://www.python.org/downloads/&lt;br /&gt;
&lt;br /&gt;
For windows, then go to the Power Shell or Command Prompt and type &amp;quot; pip install vpython &amp;quot;.&lt;br /&gt;
For macs,  go to Terminal and type &amp;quot; pip install vypython &amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Vpython will then be successfully downloaded onto the device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{spaces|2}}--&amp;gt;&lt;br /&gt;
==Mathematical Model==&lt;br /&gt;
Vpython can compute any equation, but some that may be most helpful and most useful for Physics can be found below: &lt;br /&gt;
&lt;br /&gt;
Always start vPython windows with:&lt;br /&gt;
from__future__ import division&lt;br /&gt;
from visual import*&lt;br /&gt;
&lt;br /&gt;
To update momentum:&lt;br /&gt;
&lt;br /&gt;
pf = pi + Fnet*deltat&lt;br /&gt;
&lt;br /&gt;
To update position:&lt;br /&gt;
&lt;br /&gt;
objectf.pos = objecti.pos + (pcart/mcart)*deltat&lt;br /&gt;
&lt;br /&gt;
To create a vector:&lt;br /&gt;
vector(0,0,0) -- fill in with whatever numbers the vector should be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gravitational Force:&lt;br /&gt;
&lt;br /&gt;
CONSTANTS&lt;br /&gt;
G = 6.7e-11&lt;br /&gt;
mEarth = 6e24&lt;br /&gt;
mcraft = 15e3&lt;br /&gt;
deltat = 60&lt;br /&gt;
t = 0&lt;br /&gt;
&lt;br /&gt;
Finds the change in position:&lt;br /&gt;
&lt;br /&gt;
r=craft.pos-Earth.pos  &lt;br /&gt;
m=mcraft&lt;br /&gt;
&lt;br /&gt;
To find the magnitude of the change in position:&lt;br /&gt;
&lt;br /&gt;
rmag= mag(r)      &lt;br /&gt;
&lt;br /&gt;
To calculate the new magnitude of gravitational force:&lt;br /&gt;
&lt;br /&gt;
Fmag=(G*mcraft*mEarth)/(rmag**2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Calculates the direction of tbe change in position:&lt;br /&gt;
&lt;br /&gt;
rhat=r/rmag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Calculates net force:&lt;br /&gt;
&lt;br /&gt;
Fnet=-Fmag*rhat&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Spring Force:&lt;br /&gt;
&lt;br /&gt;
L0 = 0.3 &lt;br /&gt;
Lvec = ball.pos - ceiling.pos&lt;br /&gt;
Lhat = norm(Lvec)&lt;br /&gt;
Lmag = mag(Lvec)&lt;br /&gt;
Fspr = (-ks)*(Lmag - L0)*(Lhat)&lt;br /&gt;
&lt;br /&gt;
Kinetic Energy:&lt;br /&gt;
&lt;br /&gt;
Kinetic = (1/2)*(mball*(vel**2))&lt;br /&gt;
&lt;br /&gt;
==Computational Model==&lt;br /&gt;
&lt;br /&gt;
VPython is used to create computational models of various real world situations so that we can see how these equations used in the code can manipulate these situations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
Simple:&lt;br /&gt;
&lt;br /&gt;
Creating Shapes:&lt;br /&gt;
&lt;br /&gt;
Sphere:&lt;br /&gt;
&lt;br /&gt;
sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red)&lt;br /&gt;
&lt;br /&gt;
Arrow:&lt;br /&gt;
&lt;br /&gt;
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
Vector:&lt;br /&gt;
&lt;br /&gt;
vector=vector(0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
Trail:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=sphere.color)&lt;br /&gt;
&lt;br /&gt;
trail.append(pos=sphere.pos)&lt;br /&gt;
&lt;br /&gt;
Setting Scene Range:&lt;br /&gt;
&lt;br /&gt;
scene.range=11*sphere.radius&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Helix:&lt;br /&gt;
&lt;br /&gt;
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) &lt;br /&gt;
&lt;br /&gt;
Intermediate:&lt;br /&gt;
&lt;br /&gt;
Graphs:&lt;br /&gt;
&lt;br /&gt;
Setup graphing windows:&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=1)&lt;br /&gt;
&lt;br /&gt;
ygraph = gcurve(color=color.yellow)&lt;br /&gt;
&lt;br /&gt;
gdisplay(width=500, height=250, x=600, y=300)&lt;br /&gt;
&lt;br /&gt;
Plotting:&lt;br /&gt;
&lt;br /&gt;
pgraph = gcurve(color=color.blue)&lt;br /&gt;
&lt;br /&gt;
ygraph.plot(pos=(time, Fnet.y))&lt;br /&gt;
&lt;br /&gt;
pgraph.plot(pos=(time, sphere.y))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Difficult:&lt;br /&gt;
&lt;br /&gt;
Using Loops to update Equations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CONSTANTS:&lt;br /&gt;
&lt;br /&gt;
G = ?&lt;br /&gt;
&lt;br /&gt;
mEarth = ?&lt;br /&gt;
&lt;br /&gt;
mmoon = ?&lt;br /&gt;
&lt;br /&gt;
mcraft = ?&lt;br /&gt;
&lt;br /&gt;
deltat = ?&lt;br /&gt;
&lt;br /&gt;
t = ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OBJECTS AND INITIAL VALUES:&lt;br /&gt;
&lt;br /&gt;
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)&lt;br /&gt;
&lt;br /&gt;
scene.range=11*Earth.radius&lt;br /&gt;
&lt;br /&gt;
Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white)&lt;br /&gt;
&lt;br /&gt;
Add a radius for the spacecraft. It should be BIG, so it can be seen:&lt;br /&gt;
&lt;br /&gt;
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow)&lt;br /&gt;
vcraft = vector(206, 2645,0)&lt;br /&gt;
pcraft = mcraft*vcraft&lt;br /&gt;
pArrow=arrow(color=color.green)&lt;br /&gt;
fArrow=arrow(color=color.cyan)&lt;br /&gt;
dpArrow=arrow(color=color.red)&lt;br /&gt;
Fnet_tangent_arrow = arrow(color=color.yellow)&lt;br /&gt;
Fnet_perp_arrow= arrow(color=color.magenta)&lt;br /&gt;
&lt;br /&gt;
This creates a trail for the spacecraft:&lt;br /&gt;
&lt;br /&gt;
trail = curve(color=craft.color)  &lt;br /&gt;
&lt;br /&gt;
And this prevents zooming in or out:&lt;br /&gt;
  &lt;br /&gt;
scene.autoscale = 0                 &lt;br /&gt;
pscale=Earth.radius/mag(pcraft)&lt;br /&gt;
fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2)&lt;br /&gt;
dpscale=500*Earth.radius/mag(pcraft)&lt;br /&gt;
print(&amp;quot;p=&amp;quot;, pcraft)&lt;br /&gt;
&lt;br /&gt;
CALCULATIONS:&lt;br /&gt;
&lt;br /&gt;
Sets time for loop to run:&lt;br /&gt;
&lt;br /&gt;
while t &amp;lt; 165240: &lt;br /&gt;
This slows down the animation (runs faster with bigger number):&lt;br /&gt;
    rate(10000)   &lt;br /&gt;
&lt;br /&gt;
     Add statements here for the iterative update of gravitational&lt;br /&gt;
    force, momentum, and position.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    r = craft.pos-Earth.pos&lt;br /&gt;
    rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2))&lt;br /&gt;
    Fmag= G*mEarth*mcraft/(rmag**2)&lt;br /&gt;
    rhat= r/rmag&lt;br /&gt;
    rmoon= craft.pos - Moon.pos&lt;br /&gt;
    rmoonmag= mag(rmoon)&lt;br /&gt;
    rmoonhat= norm(rmoon)&lt;br /&gt;
    Fmoonmag= G*mmoon*mcraft/(rmoonmag**2)&lt;br /&gt;
    Fmoon= -Fmoonmag*rmoonhat&lt;br /&gt;
    p_init= mag(pcraft)&lt;br /&gt;
    pcraft_i=pcraft+vector(0,0,0)&lt;br /&gt;
    Fearth= -Fmag*rhat&lt;br /&gt;
    Fnet= Fearth + Fmoon&lt;br /&gt;
    pcraft=Fnet*deltat+pcraft&lt;br /&gt;
    p_final=mag(pcraft)&lt;br /&gt;
&lt;br /&gt;
    Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat&lt;br /&gt;
    Fnet_tangent_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_tangent_arrow.axis=Fnet_tangent*fscale&lt;br /&gt;
    Fnet_perp = Fnet-Fnet_tangent&lt;br /&gt;
    Fnet_perp_arrow.pos=craft.pos&lt;br /&gt;
    Fnet_perp_arrow.axis=Fnet_perp*fscale&lt;br /&gt;
    vcraft=pcraft/mcraft&lt;br /&gt;
    craft.pos=vcraft*deltat+craft.pos&lt;br /&gt;
    pArrow.pos=craft.pos&lt;br /&gt;
    pArrow.axis=pcraft*pscale&lt;br /&gt;
    fArrow.pos=craft.pos&lt;br /&gt;
    fArrow.axis=Fnet*fscale&lt;br /&gt;
    deltap= pcraft-pcraft_i&lt;br /&gt;
    dpArrow.pos=craft.pos&lt;br /&gt;
    dpArrow.axis=deltap*dpscale&lt;br /&gt;
    scene.center=craft.pos&lt;br /&gt;
    scene.range=craft.radius*600&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   Uncomment these two lines to exit the loop if&lt;br /&gt;
   the spacecraft crashes onto the Earth.&lt;br /&gt;
&lt;br /&gt;
    if rmag &amp;lt; Earth.radius: &lt;br /&gt;
        break&lt;br /&gt;
&lt;br /&gt;
    trail.append(pos=craft.pos)  &lt;br /&gt;
    t = t+deltat&lt;br /&gt;
&lt;br /&gt;
==Connectedness==&lt;br /&gt;
&lt;br /&gt;
vPython codes are extremely useful for modeling physics situations. However, the coding skills learned in this class can be applied to almost anything. For example, Aerospace Engineers are becoming increasingly dependent on computer simulations to test ideas before prototyping to reduce costs.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
&lt;br /&gt;
vPython was released in 2008. It was developed by researchers at Carnegie Mellon University. It is largely used for educational purposes especially producing physics models.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
http://vpython.org/contents/history.html&lt;/div&gt;</summary>
		<author><name>MadelynHightower</name></author>
	</entry>
</feed>