Wednesday, May 30, 2012

Mass-Spring System Part 1

     The purpose of this lab is to explore a mass-spring system as it is set to oscillate in a plane. Though this scenario could be set up in a physical experiment, the periodicity of the mass spring system would be difficult to study due to dampening effects and potential radical motion from the spring and mass oscillating. This program will allow for more careful observations that are repeatable.



The following is the code provided at the start of the lab:

from __future__ import division
from visual import *
scene.width=600
scene.height = 760
## constants and data
g = 9.8
mball = 1 ## change this to the appropriate mass (in kg) from your mass-spring experiment.
L0 = 0.26  ## this is an approximate relaxed length of your spring in meters measured in lab.
ks = 1     ## change this to the spring stiffness you measured (in N/m)
deltat = .01  
t = 0       ## start counting time at zero
## objects
ceiling = box(pos=(0,0,0), size = (0.2, 0.01, 0.2))      ## origin is at ceiling
ball = sphere(pos=(0,-0.3,0), radius=0.025, color=color.orange) ## note: spring compressed
spring = helix(pos=ceiling.pos,axis=ball.pos-ceiling.pos,color=color.cyan, thickness=.003 , coils=40, radius=0.015) ## change the color to be your spring color
trail = curve(color=ball.color)     ## for leaving a trail behind the ball
## initial values
pball = mball*vector(0,0,0)
Fgrav = mball*g*vector(0,-1,0)
## improve the display
scene.autoscale = False          ## don't let camera zoom in and out as ball moves
scene.center = vector(0,-L0,0)   ## move camera down to improve display visibility
scene.mouse.getclick()           ## Animation doesn't start when you Run Program.
## calculation loop
while t < 30:
   rate(100)
   Fnet = Fgrav
   pball = pball + Fnet*deltat
   ball.pos = ball.pos + pball/mball*deltat
   spring.axis = ball.pos - ceiling.pos
   trail.append(pos=ball.pos) ## this adds the new position of the ball to the trail
   t = t + deltat

     This code is broken and does not model a system that is oscillating. There is no spring force in this program. The program just models a ball in free fall with a helix attached to it. The following is a working version of the program and a video of the program running with the corresponding position graph.

#Physics 4A Lab: Spring-Mass System Lab Part 1
#April 12th 2012
#Chris Cosio
#This is the first part to a Spring-Mass system model.
from __future__ import division
from visual import*
from visual.graph import*
from visual.graph import*
scene.width = 600
scene.height = 760
scene.y = 400

#Constants and Data
g = 9.8
mball = 0.24 #Hanging mass
L_0 = 0.26 #Relaxed length of a hanging spring
ks = 40 #Spring COnstant
deltat = 0.01
t = 0

#Objects
ceiling = box(pos=(0,0,0), size = (0.2,0.01,0.2))#Orgin is at the ceiling
ball = sphere(pos=(-0.10,-0.3,0), radius=0.025, color=color.orange)# note: spring compressed
spring = helix(pos=ceiling.pos,axis=ball.pos-ceiling.pos,collor=color.cyan,
               thickness=0.003, coils=40, radius=0.015)
trail = curve(color=color.yellow)
ygraph = gcurve(color=color.yellow)

#Initial Values
pball = mball*vector(0,0,0)
Fgrav = mball*g*vector(0,-1,0)
#improve the display
scene.autoscale = False
scene.center = vector(0,-L_0,0)
scene.mouse.getclick()


#calculation loop
while t < 30:
   rate(100)
   L = ball.pos-ceiling.pos
   F_spring = -ks*(mag(L)-L_0)*norm(L)
   Fnet = F_spring+Fgrav
   pball = pball + Fnet*deltat
   ball.pos = ball.pos + pball/mball*deltat
   spring.axis = ball.pos - ceiling.pos
   trail.append(pos=ball.pos)
   ygraph.plot(pos=(t,ball.pos.y))
   t = t + deltat





     The position graph depicts a wave envelope where a smaller oscillation is occurring within a larger oscillation. This is due to the spring oscillating up and down as the mass oscillates back and forth. graph never crosses zero in this program because of how the ball position is defined. The periodicity of the envelope can be found by taking the time interval from large peak to large peak. The period can be changed in the program by changing different variables. The spring constant, hanging mass, and initial velocity all can be changed to change the period of the larger oscillation; furthermore, the amplitude can be adjusted by changing the mass or spring constant.

Space Voyage Part 3

     This lab will address a few purposes. The first and foremost purpose will be to look at the potential and kinetic energies in a system involving the earth, moon and a orbiting satellite. The second purpose of this lab will be to examine more limitations with program design.

Orbit and graphs of the different types of energy.




 The following is the working code of the program and a video of the potential/kinetic energy graphs for the satellite. A video of the orbit corresponding to the graphs will also be included.

#Physics 4A Lab: Space Voyage Lab Part 1
#April 12th 2012
#Chris Cosio
#This is the first part to a space voyage simulation.
from __future__ import division
from visual import*
from visual.graph import*

scene.y=400
scene.width =800
scene.height = 800

#CONSTANTS
G = 6.7e-11
mEarth = 6.7e24
mcraft = 15e3
mMoon = 7e22
deltat = 390
#OBJECTS AND INITIAL VALUES
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)
Moon = sphere(pos=vector(4e8,0,0), radius=1.75e6, color=color.white)
craft = sphere(pos=vector(-5*Earth.radius, 0,0), radius=1e6, color=color.yellow)
trail = curve(color=craft.color)    ## for leaving a trail behind the craft
pvector = arrow(color=color.red)
vcraft = vector(0,5077.5,0)
#3050 is a good velocity for an elliptical orbit
pcraft = vcraft*mcraft
t = 0
Kgraph = gcurve(color=color.yellow)
Ugraph = gcurve(color=color.red)
KplusUgraph = gcurve(color=color.cyan)

#CALCULATION LOOP: ALL REPEATED CALCULATIONS GO INSIDE THE LOOP
while t < 10*365*24*60*60:
   rate(1000000) ## slow down motion to make animation look nicer
   pvector.pos = craft.pos # momentum arrow
   r_E = craft.pos-Earth.pos # Earth-Craft position vector
   r_Emag = mag(r_E)# magnitude of Earth-Craft position Vector
   rhat_E = norm(r_E) # unit vector for r in Earth-Craft direction
   F_grav_mag_E=G*mcraft*mEarth/(r_Emag**2)# magnitude of gravitational force from Earth-Craft system
   F_Egrav=-F_grav_mag_E*rhat_E # gravitational force from Earth-Craft system,
   r_M = craft.pos-Moon.pos # Moon-Craft position vector
   r_Mmag = mag(r_M)# magnitude of Moon-Craft position vector r
   rhat_M = norm(r_M) # unit vector for r in Moon-Craft direction
   F_grav_mag_M=G*mcraft*mMoon/(r_Mmag**2)# magnitude of gravitational force from Moon-Craft system
   F_Mgrav=-F_grav_mag_M*rhat_M # gravitational force from Moon-Craft system
   vcraft = vcraft+(F_Egrav/mcraft)*deltat+(F_Mgrav/mcraft)*deltat # craft velocity
   pcraft = pcraft+F_Egrav*deltat+F_Mgrav*deltat # craft momentum
   pvector.axis = 1*pcraft
   craft.pos = craft.pos + (pcraft/mcraft)*deltat
   trail.append(pos=craft.pos) ## this leaves a trail behind the spacecraft
   K = 0.5*mcraft*mag(vcraft)**2 #Kinetic Energy
   U = F_grav_mag_E*r_Emag+F_grav_mag_M*r_Mmag #Potential Energy
   Kgraph.plot(pos=(t,K)) #Kinetic Energy plot
   Ugraph.plot(pos=(t,U)) #Potential Energy Plot
   KplusUgraph.plot(pos=(t,K+U)) #Total Mechanical Energy Plot
   t = t+deltat
  



     The graphs depict total energy (blue), kinetic energy (yellow), and potential energy from the earth/moon (red). As the satellite gets closer to the earth the gravitational potential increases with the acceleration increase; however, there is a trade off with the distance between the satellite and the earth/moon where being too close would eventually cause a decrease in potential energy. As the satellite reaches a three fourths point between the earth and moon, the kinetic energy becomes relatively low as well as the potential energies. This is due to the net forces acting on the satellite at this point being very small. The graph depicts a few local maximums when it is closes to the moon, and one absolute maximum when it is closest to the earth. If the time interval is changed past a certain value to speed up the program, the orbit becomes inaccurate and the program can even fail. The program failing is evident by the earth or moon sling shooting the satellite away at an escape velocity.

Monday, May 28, 2012

Space Voyage Part 2

     The purpose of this lab is to model a satellite trajectory as it passes by the earth and moon. This program will consist of a loop that calculates the gravitational forces acting on the satellite, change in momentum of the craft, and change in position of the satellite. If the program is successful, many different trajectories can be modeled by changing the initial conditions. For the purposes of this lab, the main target trajectory will be a figure eight.



The following is the completed and working form of the program code and a video of the program running.

 #Physics 4A Lab: Space Voyage Lab Part 1
#April 12th 2012
#Chris Cosio
#This is the first part to a space voyage simulaion.
from __future__ import division
from visual import*

scene.width =800
scene.height = 800

#CONSTANTS
G = 6.7e-11
mEarth = 6.7e24
mcraft = 15e3
mMoon = 7e22
deltat = 1
#OBJECTS AND INITIAL VALUES
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)
Moon = sphere(pos=vector(4e8,0,0), radius=1.75e6, color=color.white)
craft = sphere(pos=vector(-5*Earth.radius, 0,0), radius=1e6, color=color.yellow)
trail = curve(color=craft.color)    ## for leaving a trail behind the craft
pvector = arrow(color=color.red)
vcraft = vector(0,5078,0)
#3050
pcraft = vcraft*mcraft
t = 0
#CALCULATION LOOP: ALL REPEATED CALCULATIONS GO INSIDE THE LOOP
while t < 10*365*24*60*60:
   rate(30000) ## slow down motion to make animation look nicer
   r_E = craft.pos-Earth.pos # craft position vector
   pvector.pos = craft.pos # momentum arrow
   r_Emag = mag(r_E)# magnitude of vector r
   rhat_E = norm(r_E) # unit vector in r direction
   F_grav_mag_E=G*mcraft*mEarth/(r_Emag**2)# magnitude of gravitational force
   F_Egrav=-F_grav_mag_E*rhat_E # gravitational force
   r_M = craft.pos-Moon.pos # craft position vector
   r_Mmag = mag(r_M)# magnitude of vector r
   rhat_M = norm(r_M) # unit vector in r direction
   F_grav_mag_M=G*mcraft*mMoon/(r_Mmag**2)# magnitude of gravitational force
   F_Mgrav=-F_grav_mag_M*rhat_M # gravitational force
   vcraft = vcraft+(F_Egrav/mcraft)*deltat+(F_Mgrav/mcraft)*deltat # craft velocity
   pcraft = pcraft+F_Egrav*deltat+F_Mgrav*deltat # craft momentum
   pvector.axis = 1*pcraft
   craft.pos = craft.pos + (pcraft/mcraft)*deltat
   trail.append(pos=craft.pos) ## this leaves a trail behind the spacecraft
   t = t+deltat



      The computational model was successful in depicting different trajectories of the satellite as the initial conditions were changed. There are a few things to consider in this loop other than the physics principles. The time intervals in which the calculations occur greatly affect the accuracy of the program. The theoretical values of the initial velocity might predict a figure eight orbit; however, using that velocity might produce a less than optimal orbit based on the delta t set up in the program. If delta t is very small, then the program will produce a highly accurate trajectory. The draw back to a small delta t is that the program run time increases relative to the smallness of delta t. On the other hand, the simulation will run quicker with larger delta t values. Some notable physical observations about the trajectory is the velocity of the satellite throughout the motion. The satellite's initial velocity can change the trajectory so much that the object might not even come close to the moon or the object could end up in a elliptical orbit around the earth. As the object is subjected to impulse, the momentum changes which in turn changes the velocity. The velocity of the satellite is the lowest as it approaches a point very far from the earth; however, the object is caught in the gravitational field of the moon and starts to pick up speed again. This implies that the object lost so much initial momentum that the impulse from the moon caused a change from the elliptical orbit to the figure eight orbit.

Friday, May 25, 2012

Space Voyage Part 1

     The purpose of this lab is to model the trajectory of an object as it passes by a large body such as a planet, moon, or star. Once the model is complete, it will be possible to explore the affect the initial velocity has on the trajectory.

Picture of predictions

     Initially a barely working code is provided. The lab group was asked to make two predictions. The predictions were what would happen if the program was executed in its current state and what should the motion look like in real life.  The following is the barely working code.

#Physics 4A Lab: Space Voyage Lab Part 1
#April 12th 2012
#Chris Cosio
#This is the first part to a space voyage simulation.
from __future__ import division
from visual import*

scene.width =800
scene.height = 800

#CONSTANTS
G = 6.7e-11
mEarth = 6e24
mcraft = 15e3
deltat = 60
#OBJECTS AND INITIAL VALUES
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)
craft = sphere(pos=vector(-10*Earth.radius, 0,0), radius=1e6, color=color.yellow)
trail = curve(color=craft.color)    ## for leaving a trail behind the craft
vcraft = vector(0,2e3,0)
pcraft = mcraft*vcraft
t = 0
#CALCULATION LOOP: ALL REPEATED CALCULATIONS GO INSIDE THE LOOP
while t < 10*365*24*60*60:
   rate(100)     ## slow down motion to make animation look nicer
   craft.pos = craft.pos + (pcraft/mcraft)*deltat
   trail.append(pos=craft.pos) ## this leaves a trail behind the spacecraft
   t = t+deltat

     The previous two labs provided the frame work for repairing the sample code. The fancart lab provided a loop that updates momentum and the gravitational force lab provided the coding for gravitational forces.

     The following is the updated code and a sample video where in the initial velocity is set for a minimal elliptical orbit.

#Physics 4A Lab: Space Voyage Lab Part 1
#April 12th 2012
#Chris Cosio
#This is the first part to a space voyage simulaion.
from __future__ import division
from visual import*

scene.width =800
scene.height = 800

#CONSTANTS
G = 6.7e-11
mEarth = 6.7e24
mcraft = 15e3
deltat = 1
#OBJECTS AND INITIAL VALUES
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan)
craft = sphere(pos=vector(-5*Earth.radius, -5*Earth.radius,0), radius=1e6, color=color.yellow)
trail = curve(color=craft.color)    ## for leaving a trail behind the craft
pvector = arrow(color=color.red)
vcraft = vector(0,3050,0)
# 3050
pcraft = vcraft*mcraft
t = 0
#CALCULATION LOOP: ALL REPEATED CALCULATIONS GO INSIDE THE LOOP
while t < 10*365*24*60*60:
   rate(10000)                   ## slow down motion to make animation look nicer
   r = craft.pos-Earth.pos # craft position vector
   pvector.pos = craft.pos # momentum arrow
   rmag = mag(r)# magnitude of vector r
   rhat = norm(r) # unit vector in r direction
   F_grav_mag=G*mcraft*mEarth/(rmag**2)# magnitude of gravitational force
   Fgrav=-F_grav_mag*rhat # gravitational force
   vcraft = vcraft+(Fgrav/mcraft)*deltat # craft velocity
   pcraft = pcraft+Fgrav*deltat # craft momentum
   pvector.axis = 1*pcraft
   craft.pos = craft.pos + (pcraft/mcraft)*deltat
   trail.append(pos=craft.pos) ## this leaves a trail behind the spacecraft
   t = t+deltat






     There are a few observations to be made about this model. First, the vector on the orbiting body models the momentum. The vector is tangential to the ellipse. The momentum vector gets larger as the object approaches the planet and the momentum vector gets smaller as the object travels away from the planet. The change in the momentum vector is due to a impulse acting on the orbiting object. The gravitational force is the cause of the impulse. The object can escape the orbit with an initial velocity of <0,8375,0> meters per second. The object can also have a circular orbit with an initial velocity of <3750,0,> meters per second when the object starts at a distance five times the radius of the planet away. Both the escape velocity and circular orbit velocity show the large impact the initial velocity has on the trajectory of the orbiting object. The initial velocity determines the initial momentum and that momentum is affected by the impulse due to gravitational forces. If the object moves with a large initial velocity, the distance between the planet and the object grows enough for the gravitational force to impact the momentum much less. If the initial velocity of the object is too small the gravitational force will overtake the initial momentum and cause the two object to collide. The initial velocity imparted onto the orbiting object determines if it will crash into the planet, be slingshot-ed off in an elliptical orbit, or escape the gravitational pull of the larger object.

Thursday, May 24, 2012

Gravitational Force Lab

     The purpose of this lab has three parts. The first purpose of the lab consists of learning how to calculate gravitational force in Vpython. The second purpose of this lab is to set up the framework for a future lab that involves modeling planetary and orbital motions. The third purpose is to use arrows in modeling the scale and direction of a vector quantities such as force.



     For the first part of the lab, the program will use two objects and one of the two objects will change position. The gravitational force equation will also be used.


 The following is the program code that prints the gravitational force on the smaller object. Following the code, there is a video of the program being run and the print statements of gravitational force with respect to position.

 #Physics 4A Lab: Gravitational Force Lab
#April 11th 2012
#Chris Cosio
#This is a program to similate gravitational forces between two or more objects
from __future__ import division
from visual import*

t=-1
G=6.7e-11 #Gravitational Constatnt
mcraft=15e3 #mass of spacecraft
mplanet=6e24 #mass of planet
rvector=vector(-13e7,6.5e7,0) #initail position of spacecraft
deltar=vector(6.5e7,0,0) #change in position

while t<=3:
    t=t+1#counter for loop
    x=t+1#counter for position
    position=rvector+deltar*t#position definition for spacecraft
    planet=sphere(pos=(0,0,0),radius=6.4e6,color=color.blue) #Planet
    spacecraft=sphere(pos=position,radius=4e6, color=color.orange)#Spacecraft
    r=spacecraft.pos-planet.pos #position vector for spacecraft
    rmag=mag(r)#magnitude of vector r
    F_grav_mag=G*mcraft*mplanet/(rmag**2) #Magnitude of gravitational force
    rhat=r/rmag #Unit vector in the direction of position vector r
    F_grav=-F_grav_mag*rhat#Gravitational force vector
    grav_force_mag=mag(F_grav)
    scalefactor=3e4#scale factor to shrink or enlarge arrow
    arrow(pos=spacecraft.pos,axis=-grav_force_mag*rhat*scalefactor, color=color.yellow)#force
              vector(approximate)
    print('Position', x)
    print('Gravitational Force =',F_grav)
    print ('Magnitude of Gravitational Force =',grav_force_mag )
print('done')



     From the code and the video, it can be seen the purposes two and three have been accomplished. The video depicts the gravitational force acting on the smaller (orange) object. If the object had statements to update the position, it would be possible to model the motion of the object due to gravitational forces. Furthermore, the arrows placed on the orange spheres indicate the direction and approximate size of the net force acting on the sphere. These arrows could be used to also model velocity, acceleration and momentum for the sphere if it had been moving.

Fancart Momentum Lab

     This lab is designed to accomplish a few objectives. The first objective is to design three dimensional square objects. The second objective is to update an object position with a loop to animate the object. The last objective is to update the momentum and position of the object to predict its motion.


     The program has to versions for this lab. The first version of the program is a one dimensional motion that consist of a block with an initial velocity and a constant net force applied in the opposite direction. The force applied over time causes an impulse which in turn changes the momentum. Th cart eventually returns back to the position it started at with the same initial velocity magnitude in the opposite direction.

Code from first version of the program:

#Physics 4A Lab: Fancart Momentum Lab
#April 9th 2012
#Chris Cosio
#This is a program to simulate a fancart that changes momentum over time.
from __future__ import division
from visual import*

mcart=0.80 #mass in kilograms
pcart=mcart*vector(0.5) #momentum of cart
t=0 #initial time
deltat=0.01 #change in time in seconds
F_external=vector(0.0526)
print('cart momentum=',pcart)
track=box(pos=vector(0,-0.025,0), size=(2.0,0.05,0.10), color=color.white)
cart=box(pos=vector(0.95,0.027,0),size=(0.1,0.04,0.06), color=color.magenta)

while t<=15.2:#This loop will change time, momentum, and position incrementally.
    rate(100)
    pcart=pcart-F_external*deltat
    cart.pos=cart.pos-(pcart/mcart)*deltat
    t=t+deltat
print('end of program')

Video of program being executed:




     The second version of the program is a two dimensional motion that consist of a block with an initial 2-D velocity with a 2-D constant net force applied in the opposite direction. The force being applied causes an impuse which in turn changes the momentum. The goal of this program was to create a loop that updated the momentum with an impulse that would return the block back to its original position.

Code from the second version of the program:

#Physics 4A Lab: Fancart Momentum Lab
#April 9th 2012
#Chris Cosio
#This is a program to simulate a fancart that changes momentum over time.
from __future__ import division
from visual import*

mcart=0.80 #mass in kilograms
pcart=mcart*vector(0.5,0,0.15) #momentum of cart
t=0 #initial time
deltat=0.01 #change in time in seconds
F_external=vector(0.0526,0,0.016)#External force acting upon the cart
print('cart momentum=',pcart)
track=box(pos=vector(0,-0.025,0), size=(2.0,0.05,1.75), color=color.white)
cart=box(pos=vector(0.95,0.027,0),size=(0.1,0.04,0.06), color=color.magenta)

while t<=15.2:#This loop will change time, momentum, and position incrementally.
    rate(100)
    pcart=pcart-F_external*deltat
    cart.pos=cart.pos-(pcart/mcart)*deltat
    t=t+deltat
print('end of program')

Video of program being executed:

 
    This lab explored the concepts of loops, momentum and impulse. The loops inside of a program are useful to repeat calculations until a statement is true. This can consist of a value that eventually violates a less than or equal statement. This will cause the program to exit the loop. Both programs utilized two physics principles:

 momentum

impulse

     By using momentum, it was possible to give the block an initial velocity and animate it within the loop. The net force acting on the block caused an impulse which in turn allowed for the block's position to be updated within the loop.


Wednesday, May 23, 2012

Introduction to VPython

     The purpose of this lab is to become acquainted with the python programming language and the visual version of the language Vpython. This lab will consist of using tutorials from YouTube in conjunction with the lab handout to achieve the following tasks:
  • How to use VIDLE
  • The layout for a basic program
  • How to create 3-D objects such as spheres and arrows
  • How to scale
  • How to program and use vectors
  
   For the first part of the lab, the goal was to import the visual python libraries. This was done using the command from visual import*. The next line to follow is a fail safe for the program to run even if it was programmed in an older version of Vpython, the line was from future import*. This serves as the basic framework for a program in Vpython.

     The next step in the lab was to create three dimensional objects such as spheres and arrows.  The  tutorials from http://www.youtube.com/VPythonVideos were used in conjunction with the lab handout. The tutorial led to the creation of the following code and image.

#Physics 4A Lab: Introduction to Vpython
#April 9th 2012
#Chris Cosio
#This is an introductory program writen as an introduction to python.
from __future__ import division
from visual import*

a=sphere(pos=vector(-1,0,0), radius = 0.5, color = color.green)
b=sphere(pos=vector(1,1,0), radius = 0.5, color = color.green)
c=sphere(pos=vector(1,-1,0), radius = 0.5, color = color.green)
arrow(pos=vector(-1,0,0), axis=c.pos-a.pos, color = color.red)
arrow(pos=vector(1,1,0), axis=a.pos-b.pos,color = color.red)
arrow(pos=vector(1,-1,0), axis=b.pos-c.pos,color = color.red)


 

The next step in the lab was to scale the vectors. Following the handout and the tutorials, the next code and image was generated. Furthermore, print statements were added for the position of each sphere.

#Physics 4A Lab: Introduction to Vpython
#April 9th 2012
#Chris Cosio
#This is an introductory program writen as an introduction to python.
from __future__ import division
from visual import*

a=sphere(pos=vector(-2,0,0), radius = 0.5, color = color.green)
b=sphere(pos=vector(1,1,0), radius = 0.5, color = color.green)
c=sphere(pos=vector(1,-1,0), radius = 0.5, color = color.green)
arrow(pos=vector(-2,0,0), axis=c.pos-a.pos, color = color.red)
arrow(pos=vector(1,1,0), axis=a.pos-b.pos,color = color.red)
arrow(pos=vector(1,-1,0), axis=b.pos-c.pos,color = color.red)

print(a.pos)
print(b.pos)
print(c.pos)

This last set of code concluded the lab. In the near future for this class, it will be possible to model situations with this language. For example, If a person wish to model a collision between four different objects at the same time, it would be possible to to use spheres and vectors to model the collision. Programing the aforementioned scenario has the advantages of repeatability and reliability. If a person were to set up a physical version of that collision, there would be many issues with repeating the experiment exactly the same every time. Computational modeling takes out some of those errors.