Main Page: Difference between revisions
Smorrissey3 (talk | contribs) |
|||
Line 36: | Line 36: | ||
<div class="toccolours mw-collapsible mw-collapsed"> | <div class="toccolours mw-collapsible mw-collapsed"> | ||
====Help with VPython==== | ====Help with VPython==== | ||
====Vectors and Units==== | |||
'''The Main Idea''' | |||
This page discusses basic vPython functions and how they can be used to produce a model. vPython uses the same syntax as regular Python; however, vPython also allows you to produce a 3D model simulating the equations and computations your code is producing. | |||
'''Mathematical Model''' | |||
Vpython can be used with any equation. However, you may find some of the following useful: | |||
Momentum Update: | |||
pf = pi + Fnet*deltat | |||
Position Update: | |||
objectf.pos = objecti.pos + (pcart/mcart)*deltat | |||
Gravitational Force: | |||
# CONSTANTS | |||
G = 6.7e-11 | |||
mEarth = 6e24 | |||
mcraft = 15e3 | |||
deltat = 60 | |||
t = 0 | |||
r=craft.pos-Earth.pos #finds the change in position | |||
m=mcraft | |||
rmag= mag(r) #finds the magnitude of change in position | |||
Fmag=(G*mcraft*mEarth)/(rmag**2) | |||
# ^^Calculates the new magnitude of gravitational force | |||
rhat=r/rmag | |||
#^^Calculates the direction of tbe change in position | |||
Fnet=-Fmag*rhat | |||
#^^Calculates net force | |||
Spring Force: | |||
L0 = 0.3 | |||
Lvec = ball.pos - ceiling.pos | |||
Lhat = norm(Lvec) | |||
Lmag = mag(Lvec) | |||
Fspr = (-ks)*(Lmag - L0)*(Lhat) | |||
Kinetic Energy: | |||
Kinetic = (1/2)*(mball*(vel**2)) | |||
''''''Computational Model''' | |||
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. | |||
'''Examples''' | |||
Simple: | |||
Creating Shapes: | |||
Sphere: | |||
sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red) | |||
Arrow: | |||
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan) | |||
Vector: | |||
vector=vector(0, 0, 0) | |||
Trail: | |||
trail = curve(color=sphere.color) | |||
trail.append(pos=sphere.pos) | |||
Setting Scene Range: | |||
scene.range=11*sphere.radius | |||
Helix: | |||
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015) | |||
Intermediate: | |||
Graphs: | |||
## Setup graphing windows | |||
gdisplay(width=500, height=250, x=600, y=1) | |||
ygraph = gcurve(color=color.yellow) | |||
gdisplay(width=500, height=250, x=600, y=300) | |||
##Plotting | |||
pgraph = gcurve(color=color.blue) | |||
ygraph.plot(pos=(time, Fnet.y)) | |||
pgraph.plot(pos=(time, sphere.y)) | |||
Difficult: | |||
Using Loops to update Equations: | |||
# CONSTANTS | |||
G = ? | |||
mEarth = ? | |||
mmoon = ? | |||
mcraft = ? | |||
deltat = ? | |||
t = ? | |||
#OBJECTS AND INITIAL VALUES | |||
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan) | |||
scene.range=11*Earth.radius | |||
Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white) | |||
# Add a radius for the spacecraft. It should be BIG, so it can be seen. | |||
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow) | |||
vcraft = vector(206, 2645,0) | |||
pcraft = mcraft*vcraft | |||
pArrow=arrow(color=color.green) | |||
fArrow=arrow(color=color.cyan) | |||
dpArrow=arrow(color=color.red) | |||
Fnet_tangent_arrow = arrow(color=color.yellow) | |||
Fnet_perp_arrow= arrow(color=color.magenta) | |||
trail = curve(color=craft.color) # This creates a trail for the spacecraft | |||
scene.autoscale = 0 # And this prevents zooming in or out | |||
pscale=Earth.radius/mag(pcraft) | |||
fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2) | |||
dpscale=500*Earth.radius/mag(pcraft) | |||
print("p=", pcraft) | |||
# CALCULATIONS | |||
while t < 165240: #sets time for loop to run | |||
rate(10000) # This slows down the animation (runs faster with bigger number) | |||
# Add statements here for the iterative update of gravitational | |||
# force, momentum, and position. | |||
r = craft.pos-Earth.pos | |||
rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2)) | |||
Fmag= G*mEarth*mcraft/(rmag**2) | |||
rhat= r/rmag | |||
rmoon= craft.pos - Moon.pos | |||
rmoonmag= mag(rmoon) | |||
rmoonhat= norm(rmoon) | |||
Fmoonmag= G*mmoon*mcraft/(rmoonmag**2) | |||
Fmoon= -Fmoonmag*rmoonhat | |||
p_init= mag(pcraft) | |||
pcraft_i=pcraft+vector(0,0,0) | |||
Fearth= -Fmag*rhat | |||
Fnet= Fearth + Fmoon | |||
pcraft=Fnet*deltat+pcraft | |||
p_final=mag(pcraft) | |||
Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat | |||
Fnet_tangent_arrow.pos=craft.pos | |||
Fnet_tangent_arrow.axis=Fnet_tangent*fscale | |||
Fnet_perp = Fnet-Fnet_tangent | |||
Fnet_perp_arrow.pos=craft.pos | |||
Fnet_perp_arrow.axis=Fnet_perp*fscale | |||
vcraft=pcraft/mcraft | |||
craft.pos=vcraft*deltat+craft.pos | |||
pArrow.pos=craft.pos | |||
pArrow.axis=pcraft*pscale | |||
fArrow.pos=craft.pos | |||
fArrow.axis=Fnet*fscale | |||
deltap= pcraft-pcraft_i | |||
dpArrow.pos=craft.pos | |||
dpArrow.axis=deltap*dpscale | |||
scene.center=craft.pos | |||
scene.range=craft.radius*600 | |||
# Uncomment these two lines to exit the loop if | |||
# the spacecraft crashes onto the Earth. | |||
if rmag < Earth.radius: | |||
break | |||
trail.append(pos=craft.pos) | |||
t = t+deltat | |||
'''Connectedness''' | |||
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. | |||
'''History''' | |||
vPython was released in 2008. It was developed by researchers at Carnegie Mellon University. It is largely used for educational purposes especially modeling producing physics models. | |||
''' | |||
References''' | |||
http://vpython.org/contents/history.html | |||
<div class="mw-collapsible-content"> | |||
*[[Vectors]] | |||
*[[SI Units]] | |||
</div> | |||
</div> | |||
<div class="toccolours mw-collapsible mw-collapsed"> | |||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
*[[VPython]] | *[[VPython]] |
Revision as of 09:09, 8 April 2017
Georgia Tech Student Wiki for Introductory Physics.
This resource was created so that students can contribute and curate content to help those with limited or no access to a textbook. When reading this website, please correct any errors you may come across. If you read something that isn't clear, please consider revising it for future students!
Looking to make a contribution?
- Pick one of the topics from intro physics listed below
- Add content to that topic or improve the quality of what is already there.
- Need to make a new topic? Edit this page and add it to the list under the appropriate category. Then copy and paste the default Template into your new page and start editing.
Please remember that this is not a textbook and you are not limited to expressing your ideas with only text and equations. Whenever possible embed: pictures, videos, diagrams, simulations, computational models (e.g. Glowscript), and whatever content you think makes learning physics easier for other students.
Source Material
All of the content added to this resource must be in the public domain or similar free resource. If you are unsure about a source, contact the original author for permission. That said, there is a surprisingly large amount of introductory physics content scattered across the web. Here is an incomplete list of intro physics resources (please update as needed).
- A physics resource written by experts for an expert audience Physics Portal
- A wiki written for students by a physics expert MSU Physics Wiki
- A wiki book on modern physics Modern Physics Wiki
- The MIT open courseware for intro physics MITOCW Wiki
- An online concept map of intro physics HyperPhysics
- Interactive physics simulations PhET
- OpenStax intro physics textbooks: Vol1, Vol2, Vol3
- The Open Source Physics project is a collection of online physics resources OSP
- A resource guide compiled by the AAPT for educators ComPADRE
Resources
- Commonly used wiki commands Wiki Cheatsheet
- A guide to representing equations in math mode Wiki Math Mode
- A page to keep track of all the physics Constants
- A page for review of Vectors and vector operations
- A listing of Notable Scientist with links to their individual pages
Physics 1
Week 1
Help with VPython
Vectors and Units
The Main Idea This page discusses basic vPython functions and how they can be used to produce a model. vPython uses the same syntax as regular Python; however, vPython also allows you to produce a 3D model simulating the equations and computations your code is producing.
Mathematical Model Vpython can be used with any equation. However, you may find some of the following useful:
Momentum Update: pf = pi + Fnet*deltat
Position Update: objectf.pos = objecti.pos + (pcart/mcart)*deltat
Gravitational Force:
- CONSTANTS
G = 6.7e-11 mEarth = 6e24 mcraft = 15e3 deltat = 60 t = 0
r=craft.pos-Earth.pos #finds the change in position m=mcraft rmag= mag(r) #finds the magnitude of change in position Fmag=(G*mcraft*mEarth)/(rmag**2)
# ^^Calculates the new magnitude of gravitational force
rhat=r/rmag
#^^Calculates the direction of tbe change in position
Fnet=-Fmag*rhat
- ^^Calculates net force
Spring Force:
L0 = 0.3 Lvec = ball.pos - ceiling.pos Lhat = norm(Lvec) Lmag = mag(Lvec) Fspr = (-ks)*(Lmag - L0)*(Lhat)
Kinetic Energy:
Kinetic = (1/2)*(mball*(vel**2))
'Computational Model
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.
Examples
Simple:
Creating Shapes:
Sphere: sphere= sphere(pos=vector(-4,-2,5), radius=.4, color=color.red)
Arrow:
bt=arrow(pos=sphere.pos, axis=sphere2.pos-sphere.pos, color=color.cyan)
Vector: vector=vector(0, 0, 0)
Trail: trail = curve(color=sphere.color) trail.append(pos=sphere.pos)
Setting Scene Range:
scene.range=11*sphere.radius
Helix:
spring = helix(pos=ceiling.pos, color=color.cyan, thickness=.003, coils=40, radius=0.015)
Intermediate:
Graphs:
- Setup graphing windows
gdisplay(width=500, height=250, x=600, y=1) ygraph = gcurve(color=color.yellow) gdisplay(width=500, height=250, x=600, y=300)
- Plotting
pgraph = gcurve(color=color.blue) ygraph.plot(pos=(time, Fnet.y)) pgraph.plot(pos=(time, sphere.y))
Difficult:
Using Loops to update Equations:
- CONSTANTS
G = ? mEarth = ? mmoon = ? mcraft = ? deltat = ? t = ?
- OBJECTS AND INITIAL VALUES
Earth = sphere(pos=vector(0,0,0), radius=6.4e6, color=color.cyan) scene.range=11*Earth.radius Moon = sphere(pos=(4e8, 0, 0), radius=1.75e6, color=color.white)
- Add a radius for the spacecraft. It should be BIG, so it can be seen.
craft = sphere(pos=vector(-6.656e7,-3.648e6,0), radius= 10000, color=color.yellow) vcraft = vector(206, 2645,0) pcraft = mcraft*vcraft pArrow=arrow(color=color.green) fArrow=arrow(color=color.cyan) dpArrow=arrow(color=color.red) Fnet_tangent_arrow = arrow(color=color.yellow) Fnet_perp_arrow= arrow(color=color.magenta)
trail = curve(color=craft.color) # This creates a trail for the spacecraft scene.autoscale = 0 # And this prevents zooming in or out pscale=Earth.radius/mag(pcraft) fscale=Earth.radius/((G*mEarth*mcraft)*mag(craft.pos-Earth.pos)**2) dpscale=500*Earth.radius/mag(pcraft) print("p=", pcraft)
- CALCULATIONS
while t < 165240: #sets time for loop to run
rate(10000) # This slows down the animation (runs faster with bigger number)
# Add statements here for the iterative update of gravitational # force, momentum, and position. r = craft.pos-Earth.pos rmag = sqrt(r.x**(2)+r.y**(2)+r.z**(2)) Fmag= G*mEarth*mcraft/(rmag**2) rhat= r/rmag rmoon= craft.pos - Moon.pos rmoonmag= mag(rmoon) rmoonhat= norm(rmoon) Fmoonmag= G*mmoon*mcraft/(rmoonmag**2) Fmoon= -Fmoonmag*rmoonhat p_init= mag(pcraft) pcraft_i=pcraft+vector(0,0,0) Fearth= -Fmag*rhat Fnet= Fearth + Fmoon pcraft=Fnet*deltat+pcraft p_final=mag(pcraft)
Fnet_tangent = (p_final-p_init)*norm(pcraft)/deltat Fnet_tangent_arrow.pos=craft.pos Fnet_tangent_arrow.axis=Fnet_tangent*fscale Fnet_perp = Fnet-Fnet_tangent Fnet_perp_arrow.pos=craft.pos Fnet_perp_arrow.axis=Fnet_perp*fscale vcraft=pcraft/mcraft craft.pos=vcraft*deltat+craft.pos pArrow.pos=craft.pos pArrow.axis=pcraft*pscale fArrow.pos=craft.pos fArrow.axis=Fnet*fscale deltap= pcraft-pcraft_i dpArrow.pos=craft.pos dpArrow.axis=deltap*dpscale scene.center=craft.pos scene.range=craft.radius*600
# Uncomment these two lines to exit the loop if # the spacecraft crashes onto the Earth. if rmag < Earth.radius: break
trail.append(pos=craft.pos) t = t+deltat
Connectedness
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.
History vPython was released in 2008. It was developed by researchers at Carnegie Mellon University. It is largely used for educational purposes especially modeling producing physics models.
References http://vpython.org/contents/history.html
Interactions
Velocity and Momentum
Week 2
Momentum and the Momentum Principle
Iterative Prediction with a Constant Force
Week 3
Analytic Prediction with a Constant Force
Iterative Prediction with a Varying Force
Week 4
Fundamental Interactions
Week 5
Conservation of Momentum
Properties of Matter
Week 6
Identifying Forces
Week 7
Energy Principle
Week 8
Work by Non-Constant Forces
Potential Energy
Week 9
Multiparticle Systems
Week 10
Choice of System
Thermal Energy, Dissipation and Transfer of Energy
Rotational and Vibrational Energy
Week 11
Different Models of a System
Models of Friction
Week 12
Collisions
Week 13
Rotations
Angular Momentum
- Total Angular Momentum
- Translational Angular Momentum
- Rotational Angular Momentum
- The Angular Momentum Principle
- Angular Momentum Compared to Linear Momentum
- Angular Impulse
- Predicting the Position of a Rotating System
- Angular Momentum of Multiparticle Systems
- The Moments of Inertia
- Moment of Inertia for a cylinder
- Right Hand Rule
Week 14
Analyzing Motion with and without Torque
Week 15
Introduction to Quantum Concepts
Physics 2
Week 1
3D Vectors
Electric field
Electric force
Electric field of a point particle
Superposition
Dipoles
Week 2
Interactions of charged objects
Tape experiments
Polarization
Week 3
Insulators
Conductors
Charging and discharging
Week 4
Field of a charged rod
Field of a charged ring/disk/capacitor
Field of a charged sphere
Week 5
Potential energy
Electric potential
Sign of a potential difference
Potential at a single location
Path independence and round trip potential
Week 6
Electric field and potential in an insulator
Moving charges in a magnetic field
Biot-Savart Law
Moving charges, electron current, and conventional current
Week 7
Magnetic field of a wire
Magnetic field of a current-carrying loop
Magnetic field of a Charged Disk
Magnetic dipoles
Atomic structure of magnets
Week 8
Steady state current
Node rule
- Node Rule
- In an electric circuit in series, electrons flow from the negative end of a power source, creating a constant current. This current remains consistent at each point in the circuit in series. Sometimes, a circuit is not simply one constant path and may include parts that are in parallel, where the current must travel down two paths such as this:
- File:Noderule.jpg
- In this case, when the current enters a portion of the circuit where the items are in parallel, the total amount of current in must equal the total amount of current out. Therefore, the currents in each branch of the parallel portion must sum up to the amount of current at any other point in series in the circuit.
- For the previous image, the node rules can be written as I_total = I_1 + I_2 and I_total = I_3 + I_4. It is also true that I_1 + I_2 = I_3 + I_4.
- However, each of these currents are different because each point has a different resistance. The current is different for each because it is equal to V/R, and in a parallel circuit, the voltage drop across each point is equal.