Main Page: Difference between revisions

From Physics Book
Jump to navigation Jump to search
Line 38: Line 38:




====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">
<div class="mw-collapsible-content">

Revision as of 09:11, 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?

  1. Pick one of the topics from intro physics listed below
  2. Add content to that topic or improve the quality of what is already there.
  3. 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


Physics 1

Week 1

Help with VPython

Vectors and Units

Week 2

Week 3

Analytic Prediction with a Constant Force

Week 4

Week 5

Conservation of Momentum

Week 6

Week 7

Week 8

Work by Non-Constant Forces

Week 9

Week 10

Choice of System

Rotational and Vibrational Energy

Week 11

Different Models of a System

Models of Friction

Week 12

Week 13

Week 14

Week 15

Physics 2

Week 1

Electric force

Electric field of a point particle

Week 2

Week 3

Week 4

Field of a charged rod

Field of a charged ring/disk/capacitor

Week 5

Sign of a potential difference

Week 6

Electric field and potential in an insulator

Moving charges in a magnetic field

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

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.

Electric fields and energy in circuits

Week 9

Electric field and potential in circuits with capacitors

Week 10

Magnetic force

Week 12

Week 13

Semiconductors

Week 14

Circuits revisited

Week 15

Electromagnetic Radiation

Sparks in the air

Physics 3

Week 1

Classical Physics

Week 2

Week 3

Week 4

Matter Waves

Week 5

Week 6

Week 7

The Hydrogen Atom

Week 8

Week 9

Molecules

Week 10

Statistical Physics

Week 11

Condensed Matter Physics

Week 12

The Nucleus

Week 13

Week 14