# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

14 Pages

### lec3

Course: PHY 307, Fall 2008
School: Syracuse
Rating:

Word Count: 761

#### Document Preview

Graphing, Lec3 multiple displays Many particles - Newtonian gravity Higher order integrators 1 Graphing So far we have used Python to animate a simulation of simple motion. For more quantitative work need to be able to plot aspects of the motion. Eg. for the 1D harmonic oscillator problem graph solution x(t) Luckily, VPython provides the gcurve and gdisplay objects to facilitate this We can also...

Register Now

#### Unformatted Document Excerpt

Coursehero >> New York >> Syracuse >> PHY 307

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Graphing, Lec3 multiple displays Many particles - Newtonian gravity Higher order integrators 1 Graphing So far we have used Python to animate a simulation of simple motion. For more quantitative work need to be able to plot aspects of the motion. Eg. for the 1D harmonic oscillator problem graph solution x(t) Luckily, VPython provides the gcurve and gdisplay objects to facilitate this We can also create more than 1 display screen 2 Drawing graphs - I # stuff to initialize graphics from visual import * from visual.graph import * scene=display(x=0,y=0,width=400,height=400, title="simulation") scene.autoscale=0 scene.range=10.0 pic=gdisplay(x=400,y=0,width=400,height=400, title="x vs t", xtitle="t",ytitle="x", xmax=20.0,xmin=0, ymax=8.0,ymin=-8.0) xplot=gcurve(color=color.blue) 3 Drawing graphs - II # simulation/plotting code # use def force(pos,vel,t) from before here .... ball=sphere(radius=0.5,pos=vector(4.0,0.0,0), track=curve(radius=0.1,display=scene), mass=1.0,display=scene) ball.vel=vector(0,0,0) dt=0.01 t=0 while (t<20.0) : rate(100) t=t+dt ball.pos=ball.pos+ball.vel*dt ball.vel=ball.vel+ (force(ball.pos,ball.vel,t)/ball.mass)*dt ball.track.append(pos=ball.pos) xplot.plot(pos=(t,ball.pos.x)) 4 Time step errors The Euler method we have used so far has its limitations solution accurate to O(dt) only See this by computing energy E = 1/2mv 2 + 1/2kx2 Plot as function of time ... 5 Energy (non)conservation Just add a line to compute the energy and plot it now instead of x(t) energy=0.5*ball.mass*ball.vel.x*ball.vel.x+ 0.5*ball.pos.x*ball.pos.x xplot.plot(pos=(t,energy)) Should see that E is not constant. E dt (Euler) E Here, error remains finite as t - not always so. Often large enough dt > dtc discrete equations unstable x(t) blows up .. Solution ? Better algorithm than Euler 6 More accurate integrators Using Taylor .... x(t + dt) = x(t) + v(t)dt + a(t)dt2 /2 + O(dt3 ) leading to xn+1 = xn + vndt + andt2 /2 Also taking velocity from symmetric difference xn+2 - xn vn+1 = 2dt Substiting for xn+1 using previous equation: dt vn+1 = vn + (an + an+1) 2 Verlet or leap-frog algorithm Accurate to O(dt2 ) 7 Code needed a1=force(ball.pos,ball.vel,t)/ball.mass a2=force(ball.pos,ball.vel,t)/ball.mass ball.pos=ball.pos+ball.vel*dt+a1*0.5*dt*dt ball.vel=ball.vel+(a1+a2)*dt*0.5 See much smaller errors in energy. Consistent with E dt2 E 8 Many particles Consider two masses a and b interacting via some mutual force Denote force on a due to b as Fab. Likewise force on b due to a as Fba By Newton's third law Fab = -Fba vector statement Given a specific force law can we solve Newton's 2nd law for both particles numerically simulate the system ? 9 Python lists and for Useful to introduce a list to store the objects which are interacting system=[balla,ballb] In general lists can comprise arbitrary abstract objects enclosed in square brackets eg. a=[1,2,3] b=[4,5,6] The statement c=a+b concatenates the lists. To process lists we often use the for command for i in list: .... 10 Modules Useful to package related functions and data into modules. Typically a module (eg the visual module used for graphics) contains extensions to Python to help code some new functionality. Simply make a text file with the new commands and save it with the .py extension eg. usefulstuff.py Then to use it in some other piece of code use the command {\tt from usefulstuff import *} 11 Integrator Module I from visual import * G=1.0 ## Force on a due to b def force(a,b): diff=b.pos-a.pos return G*b.mass*a.mass*no...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Syracuse - PHY - 307
Lec5 Nonlinear systems chaos Phase space, Poincare maps, strange attractors Period doubling Lorenz model, balls in boxes .1Real pendulumVariables (t), (t) equation of motion: d g d = - sin () - k + F sin (D t) dt l dt d = dt Integrate/s
Syracuse - PHY - 307
Lab 12 - The Ising ModelThursday 16 November, 2006 - Due: t.b.a. In this lab, you will study a simple model of ferromagnetism, called the Ising model. As always, please include in your writeup any sections of Python code you write. there was no Lab
Syracuse - PHY - 307
Lab 9 - Complex Dynamics: Julia SetsThursday 25 October, 2006 - Due: Thursday 3 November In this lab, you will take a closer look at a particular Complex Dynamical System, called a Julia Set. Since we will need complex numbers, you'll learn about wo
Syracuse - PHY - 307
Lab 10 - Sand[piles] and Earth[quakes]Thursday 2 November, 2006 - Due: Thursday 9 November In this lab, you will study aspects of self-organized critical phenomena, which have been used to study general universal properties of some interesting compl
Syracuse - PHY - 307
Lec1 - intro, basic tools Mechanics, syllabus General comments What is computational science ? Derivatives, integrals and root finding Intro to Python1General comments Not programming course. Not traditional physics course. Topics dra
Syracuse - PHY - 307
Lec12 Phase transitions, critical phenomena Magnetic systems - Ising model1Commerical break Next semester there will be a successor course PHY300 a.k.a PHY308 Tuesdays/Thursdays 12:30-1:50 pm (lab times to be decided) Similar to PHY307 wit
Syracuse - PHY - 307
Lab 7 - PercolationThursday 12 October, 2006 - Due: Thursday 19 October The aim of this lab is (1) to get you familiar with the computational implementation of a lattice and (2) to become familiar with some of the concepts in percolation. As for the
Syracuse - PHY - 307
Lab 5 - Chaotic DynamicsThursday 28 September, 2006 - Due: Thursday 05 October The aim of this lab is to explore some aspects of chaotic dynamics. First, we have another look at the Pendulum example presented in lecture. Then, we will study the Logi
Syracuse - PHY - 307
Lab 7 - PercolationThursday 12 October, 2006 - Due: Thursday 19 October The aim of this lab is (1) to get you familiar with the computational implementation of a lattice and (2) to become familiar with some of the concepts in percolation. As for the
Syracuse - PHY - 307
Lab 6 - Fractal DimensionThursday 05 October, 2006 - Due: Thursday 12 October We will take a closer look (pun intended) at the self-similar Sierpinski Triangle. Then, youll modify the parameters of the dynamical model to obtain a dierent fractal. Fi
Syracuse - PHY - 307
Homework 6Due: Thursday 12 October In this homework you will investigate another discrete time nonlinear dynamics the Henon map. It is similar to the Sierpinski map as it involves two dynamical variables x and y. The update equation is xn+1 = yn +
Syracuse - PHY - 307
Lab 3 - Modeling the Solar System (part I)Thursday 14 September, 2006 - Due: Thursday 21 September The aim of this lab is to get you started with the construction of a solar system, using some of the ideas that you have already been introduced to. I
Syracuse - PHY - 307
Homework 3Due: Thursday 21 September 1. In Lab3 you constructed a table showing the error in the energy of a harmonic oscillator as a function of the time step dt for the Euler algorithm. In lecture 3 we discussed an improved algorithm the leapfrog
Syracuse - PHY - 307
Homework 21. Cut/paste the code for the projectile problem discussed in class (note: that listing is not quite complete: you will need to look at earlier codes to see how to access the 3D environment and how to set the scaling and range). 2. Modify
Syracuse - PHY - 307
Lec2 - mechanics and simple simulation Newtons laws, Euler method 1D and 2D examples: projectiles, harmonic motion, damping Simulation code and graphics More on functions1Newtons lawsOne particle, one dimension: dx = v dt dv = a = F/m dt
Syracuse - PHY - 307
Homework 11. Tabulate the values of the symmetric dierence approximation to the derivative for the functions f = sin x at x = 0.1 and f = x2 for x = 2 using step sizes h = 0.1, 0.01, 0.001, 0.0001. You may simply edit the Python program given in cla
Syracuse - PHY - 307
Homework 10Due: Thursday 9 November Choose a topic for your class project. Hand in the title of your topic together with a brief (one paragraph) description of what you intend to do. Please see me if you would like help choosing a topic.1
Syracuse - PHY - 307
Homework 4Due: Thursday 28 September For this homework you will use your codes solar.py and integrator.py from lab4 to investigate the motion of a object near a black hole (or any object with a strong gravitational field). In this case the leading c
Syracuse - PHY - 307
Lec10 Self-organized critical phenomena Earthquakes, sand piles1Self-similarity and criticalityWe have so far seen several examples of systems which exhibit power law behavior eg. Fractal dimensions. Number of cells needed to cover points o
Syracuse - PHY - 307
Lec11 Earthquakes a more realistic model1Recap Last week we discussed a very simplified model for understanding the statistics of Earthquakes how many Earthquakes occur of a certain magnitude. Saw that the dynamics led to self-organized cri
Syracuse - PHY - 307
Mercury's Orbital PrecessionBy Gavin HartnettEllipses Planetary Orbits are ellipses Earlier lab simplified these orbits to circles planet moves faster near the sun Perihelion-closest point to sun Aphelion-farthest Two foci-Sun is located at
Syracuse - PHY - 307
Newton's Cradle in Actionor The Mechanics of a ToyThe Physics A Newton's Cradle generally consists of: two or more massive (spherical) bodies whose motions are physically restricted to circular paths; and an equal number of pendula fixed at one e
Syracuse - PHY - 307
The Transition to the Jamming ClusterWhat is a jamming cluster? The point at which a percolating network of forces &quot;solidifies&quot;. The jamming cluster is most likely to occur in a system made of many smaller pieces of matter (like sand). When a sy
Syracuse - PHY - 307
List of project topics: 1. Precession of Mercurys perihelion due to General Relativity. An extension of an earlier homework problem. To the usual inverse square gravitational force add a term r4 . Compute the rate of rotation of the resulting ellipt
Syracuse - PHY - 307
Lec4 Many particles - Newtonian gravity Solar system simulations1Inverse law Newtons Law of Universal Gravitation: Between two bodies with (gravitational) masses Ma and Mb distance r apart there is a force of attraction acting along their r
Syracuse - PHY - 307
Lab 4 - Modeling the Solar System (part II)Thursday 21 September, 2006 - Due: Thursday 28 September The aim of this lab is to continue development of the solar system model we started in lab3. In this lab we continue with our discussion in lecture b
Syracuse - PHY - 212
Lecture 5.1Copyright 2008 Pearson Education, Inc., publishing as Pearson Addison-Wesley.Review of Last LectureElectric FluxCopyright 2008 Pearson Education, Inc., publishing as Pearson Addison-Wesley.Conductors in Electrostatic Equilibrium
Syracuse - PHY - 212
Syracuse - PHY - 212
Phy212 - Spring 2007 Mid Term Exam 3 (100pts + 20pts extra credits) April 5, 2007 Name_Don Bunk: Steluta Dinca: Renata Jora: 10:35am, 2:15pm, 8:25am, 11:40am, 12:45pm, 9:30am, 5:15pm 3:45pm 10:35amPlease write your name on the line above and circl
Syracuse - PHY - 212
PRS RF Student Clicker/RemoteTwo line display for indicating response and status of receiptPRS rfScroll KeysSend/EnterBackspace Setup KeyAlpha, Numeric and T/F Keys Diagnostics include Battery level %AAA batteries used to keep future cost
Syracuse - PHY - 212
AnnouncementA new lab session for phy222 is open nowM011 Wednesday 6:00-8:00 PM Class # 34159Copyright 2008 Pearson Education, Inc., publishing as Pearson Addison-Wesley.Review of Last Lecture: Charge Model1. Objects can be charged by rubbing
Syracuse - PHY - 212
Phy212 - Spring 2007 Mid Term Exam 1 (100pts) Name_Don Bunk: 10:35am, 11:40am, 5:15pm Steluta Dinca: 10:35am, 12:45pm, 3:45pm Renata Jora: 8:25am, 9:30am, 2:15pmPlease write your name on the line above and circle your workshop section (both TA an
Syracuse - PHY - 212
Syracuse - PHY - 212
!&quot;#\$%#! &amp;'()*+! &quot;#\$%&amp;!'(%!)&amp;*+',-!+)(%.%+!*+!)#,/'!-(*.0%+1!,-./0*-1)+2 !! ! 3'*4)+! 506!2(%!-(*.0%!3!&quot;4515!/6!%7%.'+!*!8#.-%! &quot;3!#/!9 #/!9!&quot;4515!/6!'#!'(%!.,0(':!*/\$!'(%!-(*.0%!9!%7%.'+! ! *!8#.-%! &quot;9!#/!3 !#/!3!'#!'(%!&amp;%8'1!;+,/0!6#&lt;&amp;#=&gt;?+!&amp;*@:!
Syracuse - PHY - 212
Syracuse - PHY - 212
Consider the arrangement of two positive charges shown in the figure. Give your answers below in terms of Q, a, and universal constants. Choose a coordinate system and indicate the direction of any vector with respect to this coordinate system.A a
Syracuse - PHY - 212
Syracuse - PHY - 212
Syracuse - PHY - 212
Syracuse - PHY - 212
Syracuse - PHY - 212
Syracuse - PHY - 212
Syracuse - PHY - 212
Syracuse - PHY - 212
Syracuse - PHY - 212
Phy212 - Spring 2007 Mid Term Exam 2 (100pts) Name_Don Bunk: Steluta Dinca: Renata Jora: 10:35am, 2:15pm, 8:25am, 11:40am, 12:45pm, 9:30am, 5:15pm 3:45pm 10:35amPlease write your name on the line above and circle your workshop section (both TA and
Syracuse - PHY - 211
Welcome back to Physics 211Todays agenda: Midterm #1 Thursday 9/25 Finish Chapter 2!Physics 211 Fall 2008Lecture 03-2Construct a Velocity Graph from a Motion Diagram Demo Stand still, walk away slowly at constant speed for 2 s, stand still
Syracuse - PHY - 211
Welcome back to Physics 211Today's agenda: Work and kinetic energy Scalar product of vectors Finish circular motion .Physics 211 Fall 2005Lecture 07-11Reminder etc Tutorial HW5 due wed. (N's 2nd and 3rd laws) MPHW4 available noon Fr
Syracuse - PHY - 211
Welcome back to Physics 211Today's agenda: Ch. 12 Torque Rotational energy Rolling Angular momentum FHW15 11, 13, 29, 44, 45, 63, 64, 69, 70, 71 Final Exam Monday 12/8/2008 10:15 12:15 StolkinPhysics 211 Fall 2008 Lecture 15-2 1Rotations about
Syracuse - PHY - 211
Welcome to Physics 211!(General Physics I)Physics 211 Fall 2002Lecture 01-11SU PHY211 Course staff:General Physics IFall 2002 Lecturer: Prof. Simon Catterall Workshop instructors: Joshua Dalrymple Steluta Dinca Renate Jora Jyothi
Syracuse - PHY - 211
Welcome back to Physics 211Todays agenda: Rotational Dynamics Kinetic Energy Angular MomentumPhysics 211 Fall 2005Lecture 11-21Reminder Exam 3 in class Thursday, November 17 elastic energy, linear momentum, collisions, center of mass, e
Syracuse - PHY - 101
OutlineMotionPHY 101 Lecture #2: MotionProf. Peter R. Saulson saulson@physics.syr.eduhttp:/physics.syr.edu/courses/PHY101/ Off. Hrs: Tue 9:30 11:30, Physics 263-4PHY 101 Lecture #2 Motion 1How to measure it Position Velocity AccelerationMec
Syracuse - PHY - 101
PHY 101 Lecture #3: MotionPHY 101 Lecture #3Motion1OutlineMotionHow to measure it Position Velocity AccelerationPHY 101 Lecture #3Motion2Motion of massive bodiesMatter in motion: the most fundamental situation described in physics
Syracuse - PHY - 344
Advanced Physics Laboratory Experiment 4January 2005MEASUREMENT OF THE MUON LIFETIME PURPOSE Learn about cosmic rays Understand the concept of a particles lifetime Apply statistical analyses to a real problem1)IntroductionInterstellar par
Syracuse - PHY - 344
January 2007Nuclear Magnetic Resonance DRAFTPhy 462Introduction: Nuclear magnetic resonance (NMR) is an important experimental technique in many scientific disciplines. In the presence of an external static magnetic field, nuclear spins will a
Syracuse - PHY - 222
V.DC CIRCUITS= = = = = = = = = = = = = = = = = = =f05.01INTRODUCTION DC stands for &quot;direct-current&quot;. A direct current stays the same in magnitude and does not change its direction. Ohm's Law and the rules for effective resistance of resistors c
Syracuse - AST - 104
Name: Partner: Partner:Lab 2: Finding Objects in the SkyThis lab uses a Field Guide to help you to answer questions like: Where is your Piece of Sky (POS)? What will the sky look like tonight? Is (such and such an object) above the horizon right
Syracuse - CLIN - 24
Video Rodeo Movie StorebyChi-Shia LinAdvance Database Oracle David Dischiave Fall 2005Business Problems and SolutionsThe owner of the Video Rodeo Movie Rental Store recently expanded the size and locations of store. Due to the extension, t
Syracuse - SKIM - 35
Group Topic: ( Economy and P2P F ile Sharing )Team Leader: ( Jae Hong Park) Name email Phones Roles Peer EvaluationK im, SylviaJuyounkim87@Hotmail.com 395-1470Web Design &amp; Secondary Information Search. Article Secondary Data Researching Web De
Syracuse - PPSN - 2004
Self-Organizing Lightweight Agents for Large-Scale Real-Time Systems SchedulingDerek Messie and Jae C. OhDepartment of Electrical Engineering and Computer Science Syracuse University, Syracuse, NY 13244, USA dsmessie@syr.edu, jcoh@ecs.syr.eduAbst
Syracuse - PPSN - 2004
Emergent Search in Large Distributed SystemsSergio Camorlinga1, and Ken Barker21Computer Science Department, University of Manitoba, Winnipeg MB, R3T 2N2 Canada sergio_camorlinga@sbrc.ca 2 Computer Science Department, University of Calgary, Calga
Syracuse - PPSN - 2004
Evolving Small-World Automata for the Majority ProblemMarco Tomassini, Mario Giacobini, and Christian DarabosInformation Systems Department, University of Lausanne, Switzerland {marco.tomassini, mario.giacobini, christian.darabos}@unil.chAbstract