Kinematics and dynamics, a computational approach

Similar documents
Ph 20.3 Numerical Solution of Ordinary Differential Equations

Donald Fussell. October 28, Computer Science Department The University of Texas at Austin. Point Masses and Force Fields.

Force and dynamics with a spring, analytic approach

26 Impulse and Momentum

USEFUL HINTS FOR SOLVING PHYSICS OLYMPIAD PROBLEMS. By: Ian Blokland, Augustana Campus, University of Alberta

Some Perspective. Forces and Newton s Laws

PY /005 Practice Test 1, 2004 Feb. 10

I. Understand get a conceptual grasp of the problem

ma x = -bv x + F rod.

Chapter 1: Basics of Vibrations for Simple Mechanical Systems

HORIZONTAL MOTION WITH RESISTANCE

Ocean 420 Physical Processes in the Ocean Project 1: Hydrostatic Balance, Advection and Diffusion Answers

Intelligent Systems: Reasoning and Recognition. Perceptrons and Support Vector Machines

Physics 201, Lecture 15

P (t) = P (t = 0) + F t Conclusion: If we wait long enough, the velocity of an electron will diverge, which is obviously impossible and wrong.

BALLISTIC PENDULUM. EXPERIMENT: Measuring the Projectile Speed Consider a steel ball of mass

Energy and Momentum: The Ballistic Pendulum

Reading from Young & Freedman: For this topic, read the introduction to chapter 25 and sections 25.1 to 25.3 & 25.6.

Physics 140 D100 Midterm Exam 2 Solutions 2017 Nov 10

Figure 1: Equivalent electric (RC) circuit of a neurons membrane

The Wilson Model of Cortical Neurons Richard B. Wells

Work, Energy and Momentum

Name: Partner(s): Date: Angular Momentum

Lecture #8-3 Oscillations, Simple Harmonic Motion

PHY 171. Lecture 14. (February 16, 2012)

UNIVERSITY OF SASKATCHEWAN Department of Physics and Engineering Physics

Finite fields. and we ve used it in various examples and homework problems. In these notes I will introduce more finite fields

Ch 12: Variations on Backpropagation

Now multiply the left-hand-side by ω and the right-hand side by dδ/dt (recall ω= dδ/dt) to get:

XI PHYSICS M. AFFAN KHAN LECTURER PHYSICS, AKHSS, K.

NUMERICAL MODELLING OF THE TYRE/ROAD CONTACT

Chapter 11 Simple Harmonic Motion

Physically Based Modeling CS Notes Spring 1997 Particle Collision and Contact

Dimensions and Units

Today s s topics are: Collisions and Momentum Conservation. Momentum Conservation

This model assumes that the probability of a gap has size i is proportional to 1/i. i.e., i log m e. j=1. E[gap size] = i P r(i) = N f t.

NB1140: Physics 1A - Classical mechanics and Thermodynamics Problem set 2 - Forces and energy Week 2: November 2016

Model Fitting. CURM Background Material, Fall 2014 Dr. Doreen De Leon

Time-of-flight Identification of Ions in CESR and ERL

Analysis of Impulsive Natural Phenomena through Finite Difference Methods A MATLAB Computational Project-Based Learning

Projectile Motion with Air Resistance (Numerical Modeling, Euler s Method)

Module #1: Units and Vectors Revisited. Introduction. Units Revisited EXAMPLE 1.1. A sample of iron has a mass of mg. How many kg is that?

The accelerated expansion of the universe is explained by quantum field theory.

Principal Components Analysis

Lecture 21. Interior Point Methods Setup and Algorithm

Honors Lab 4.5 Freefall, Apparent Weight, and Friction

An Approximate Model for the Theoretical Prediction of the Velocity Increase in the Intermediate Ballistics Period

A Simplified Analytical Approach for Efficiency Evaluation of the Weaving Machines with Automatic Filling Repair

COS 424: Interacting with Data. Written Exercises

Pattern Recognition and Machine Learning. Artificial Neural networks

Analyzing Simulation Results

1 Bounding the Margin

Note-A-Rific: Mechanical

A Simple Regression Problem

Relativity and Astrophysics Lecture 25 Terry Herter. Momenergy Momentum-energy 4-vector Magnitude & components Invariance Low velocity limit

Handout 7. and Pr [M(x) = χ L (x) M(x) =? ] = 1.

Course Notes for EE227C (Spring 2018): Convex Optimization and Approximation

MSEC MODELING OF DEGRADATION PROCESSES TO OBTAIN AN OPTIMAL SOLUTION FOR MAINTENANCE AND PERFORMANCE

5.1 m is therefore the maximum height of the ball above the window. This is 25.1 m above the ground. (b)

Feature Extraction Techniques

Optimization of ripple filter for pencil beam scanning

National 5 Summary Notes

ANALYSIS OF HALL-EFFECT THRUSTERS AND ION ENGINES FOR EARTH-TO-MOON TRANSFER

MAKE SURE TA & TI STAMPS EVERY PAGE BEFORE YOU START

Analysis of ground vibration transmission in high precision equipment by Frequency Based Substructuring

Block designs and statistics

Data-Driven Imaging in Anisotropic Media

2.003 Engineering Dynamics Problem Set 2 Solutions

OSCILLATIONS AND WAVES

Inspection; structural health monitoring; reliability; Bayesian analysis; updating; decision analysis; value of information

PHY307F/407F - Computational Physics Background Material for Expt. 3 - Heat Equation David Harrison

Lesson 24: Newton's Second Law (Motion)

THE ROCKET EXPERIMENT 1. «Homogenous» gravitational field

Chapter 2: Introduction to Damping in Free and Forced Vibrations

Forecasting Financial Indices: The Baltic Dry Indices

Molecular interactions in beams

General Properties of Radiation Detectors Supplements

Newton's Laws. Lecture 2 Key Concepts. Newtonian mechanics and relation to Kepler's laws The Virial Theorem Tidal forces Collision physics

Spine Fin Efficiency A Three Sided Pyramidal Fin of Equilateral Triangular Cross-Sectional Area

Classical systems in equilibrium

Problem Set 2. Chapter 1 Numerical:

Solving initial value problems by residual power series method

Faraday's Law Warm Up

13.2 Fully Polynomial Randomized Approximation Scheme for Permanent of Random 0-1 Matrices

1 Generalization bounds based on Rademacher complexity

Momentum. February 15, Table of Contents. Momentum Defined. Momentum Defined. p =mv. SI Unit for Momentum. Momentum is a Vector Quantity.

lecture 36: Linear Multistep Mehods: Zero Stability

Intelligent Systems: Reasoning and Recognition. Artificial Neural Networks

Chapter 2 General Properties of Radiation Detectors

Derivative at a point

Physics 218 Exam 3 Fall 2010, Sections

SIMPLE HARMONIC MOTION: NEWTON S LAW

Extension of CSRSM for the Parametric Study of the Face Stability of Pressurized Tunnels

The Weierstrass Approximation Theorem

Periodic Motion is everywhere

EE 434 Lecture 16. Small signal model Small signal applications in amplifier analysis and design

Non-Parametric Non-Line-of-Sight Identification 1

Pattern Recognition and Machine Learning. Artificial Neural networks

The dynamic game theory methods applied to ship control with minimum risk of collision

Field Mass Generation and Control. Chapter 6. The famous two slit experiment proved that a particle can exist as a wave and yet

Transcription:

Kineatics and dynaics, a coputational approach We begin the discussion of nuerical approaches to echanics with the definition for the velocity r r ( t t) r ( t) v( t) li li or r( t t) r( t) v( t) t for sall t. This definition t 0 t t 0 t coes fro atheatics, calculus specifically, and does not contain any real physics. Where the physics coes in is through the definition of oentu. We know that p and inverting this and solving for the velocity gives v so if we can find p then we find the position using p v pt () r ( t t) r ( t) v( t) t r ( t) t This tells us how to find the position at the next increent in tie as long as we know the current position and the oentu. So the question becoes how to find the oentu. For this we will use Newton's relation (second law) between the net force on an object and the tie rate of change of the oentu. You ay be used to using F a as Newton's second law, however this is not really the best for. The law actually states that the net force produces a p tie rate of change in the oetu or atheatically: F ultiplying this expression by t t yields p F dt and recognizing that p p( t t) p( t) we can rearrange to this iportant result p( t t) p( t) F t. This expression tells us that if we know the present oentu, at tie t, and the net force on an object, than we can find the oentu at a future tie, t t. Of course, this is only exactly true in the li so the accuracy of the solution will depend on the size of the tie step. Let's use a siple exaple to show how to use these two pt () expressions, p( t t) p( t) F t and r ( t t) r ( t) t allow us to find the trajectory of an object acted on by a force. t 0 F

Start with p(0) 0 and r(0) 0 Use position and oentu update to calculate pt () future positions p( t t) p( t) F t and r ( t t) r ( t) t. Let's set up a chart for each tie step. Note t n t. n t p r 0 0 0 0 1 t F t 0 3 4 5 6 t 3 t 4 t 5 t 6 t F t 3F t 4F t 5F t 6F t F t 3F t 6F t 10F t 15F t 7 7 t 7F t 1F t 8 8 t 8F t 8F t 9 9 t 9F t 36F t 10 10 t 10F t 45F t

Of course, this is a proble that can be solved analytically, we did this in the last lecture and the pt ( ) 1 F solution was given by r( t) r( t ) t t 1 F proble. Using the initial conditions the solution is r() t t have been reoved because it is a one diensional proble. 0 where I have used the variables given in this 0 where the vectors sybols Graphically this looks like this: 50 00 150 100 analytic calculation nuerical calculation 50 0 0 4 6 8 10 1 14 16 18 0 where blue is fro the data above and green is the analytic result. You can see that there is a difference between the two sets of data. The nuerical calculation does not exactly reproduce the analytic result. Recognizing and coprehending the source and agnitude of this difference is very iportant to your understanding of the solution to the proble. Below shows a graph of the absolute error abs _ error analytic _ result coputational _ result (blue) and the fractional error ( analytic _ result coputational _ result) frac _ error (red) analytic _ result Exaining the graph shows that the absolute error increases linearly with tie, but the fractional error decreases. It is often iportant for you to understand whether you care about either the absolute or fractional error ost. Soeties you can deterine this and other you can t.

10 100 80 60 40 absolute error fractional error (%) 0 0 0 4 6 8 10 1 14 16 18 0 There is an abiguity that is worthy of a bit of discussion. In the nuerical solution the two key line are pnew pold F t p??? rnew rold t The question boils down to what oentu do you use for the second expression? This is equivalent to asking in which order do you evaluate these expressions: pnew pold Fold t p new rnew rold t or p pnew pold Fnew t old rnew rold t Do you update the oentu first and then the position using the new oentu or do you update the position first using the old oentu and then the oentu using the new position? Actually, there are a couple ore perutations that you can think of. Soeties these seeingly inor differences in the algorith really ake a significant change to the accuracy of your calculation. Topics such as these coe under the nae of nuerical ethods. In this class we will be doing very little in the way of trying to get the best answer by using the best algorith. However, occasionally this ight coe up and you should be at least aware of the issue.

One siple way of iproving the accuracy of alost any algorith is to reduce the tie increent t. Selection of the proper, or reasonable, t for a proble often involves a trade-off between the necessary accuracy and the length of tie that you can afford to run the siulation. It also involves understanding the natural tie-scales of the physical situation and what approxiations you can ake while still obtaining the inforation that you need to know. Let s exaine a real physical syste. Consider an electron in a vacuu. This is a odel for an electron oving in a vacuu tube, such as an old TV tube (in the days before flat panel screens). To provide a constant force we produce a unifor electric field in the region of space containing the electron. A siple scheatic would be: 1 10 V 0 V The force on the electron is the electric charge (q) ties the electric field, F qe ; in the region between the two plates the field is approxiately constant, therefore so is the force. Consider a siulation tie of 10-10 sec. What should the t be? Let explore this coputationally. Below is a graph of position vs tie with data fro siulations with two different tie steps, large 10-1 sec and sall 10-14 sec. F There is clearly a difference between the two data sets. Which is correct? This proble is one 1 ee of the rare situations where we know the answer analytically, x() t x t assuing the electron starts at r(0) 0,0,0 and v(0) 0,0,0. The parabolic analytic solution is

indistinguishable fro the green dots. However we can look ore precisely by plotting the fractional error, defined above. The siulation with the larger tie step (blue) has an error greater than 3% for all of the tie, whereas using the saller tie step reduces the error well below 1% for alost all of the siulation tie. Since in this proble we know the exact answer we can calculate these errors, generally this is not possible. What do you do then? The siplest thing is to try a tie step, then try a saller one and see how uch your answer changes. If it changes a lot (that eans ore than you would like your error to be) try an even saller tie step and repeat this process until you either have answers to the accuracy that you desire or you run out of coputer power and the siulations take too long. This is when you wish you had a faster coputer and have joined the legions of research scientists wanting ore powerful coputation achines. fro future iport division fro visual iport * fro visual.graph iport * # iport graphing features #Siulation of an electron acted on by a constant force. #The siulation shows two different tie steps and the relative errors. tie = 0 #start the clock at zero sall_dt = 1e-14 #sall tie increent large_dt = 1e-1 #large tie increent siulation_tie = 1e-10 #tie between scattering events c = 3e8 #speed of light /s e = 1.6e-19 #unit of charge electron_ass = 9.11e-31 #ass of electron electron_init_pos = vector(0,0,0) #call origin of syste electron_init_vel = vector(0,0,0) #initial velocity, electron_init_o = electron_ass*electron_init_vel #initial oentu E = vector(10,0,0) #Electric field in x direction, in Volts/eter Electric_Force = -e*e #constant force applied by electric field #graphics position = gdisplay(title='position',

xtitle='tie (sec)', ytitle = 'distance ()', x=0, y=0, width=1000, height=400, background= color.black) #window for position error = gdisplay(title='percent Error', xtitle='tie (sec)', ytitle = 'factional error (%)', x=0, y=400, width=1000, yax=10, height=400, background= color.black) #window for error pos_large_step = gdots(gdisplay=position, color=color.cyan) # a graphics curve for large pos_sall_step = gdots(gdisplay=position, color=color.green) # a graphics curve for sall #steps analytic = gcurve(gdisplay=position, color=color.red) # a graphics curve for exact #steps delta_sall_dot = gdots(gdisplay=error, color=color.green) # error for sall steps delta_large_dot = gdots(gdisplay=error, color=color.cyan) # error for large steps #initialize all loop variables electron_o_large = electron_init_o electron_o_sall = electron_init_o electron_pos_large = electron_init_pos electron_pos_sall = electron_init_pos tie_sall = tie tie_large = tie #ain loops (typically only one but this progra used two different tie steps while (tie_large< siulation_tie): #one nanosec of acceleration electron_o_large = electron_o_large + (Electric_Force)*large_dt #update electron oentu electron_pos_large = electron_pos_large + (electron_o_large/electron_ass)*large_dt #update electron position analytic_pos = electron_init_pos + electron_init_vel*tie + 0.5*(Electric_Force/electron_ass)*(tie_large)** pos_large_step.plot(pos=(tie_large, electron_pos_large.x )) # plot position if(tie_large > large_dt): #can't easure rel error at t = 0, delay one tie step delta_large = 100*abs((analytic_pos.x - electron_pos_large.x)/analytic_pos.x) #find error delta_large_dot.plot(pos=(tie_large, (delta_large))) #plot percent error tie_large = tie_large + large_dt #increent tie by large step while (tie_sall< siulation_tie): #one nanosec of acceleration electron_o_sall=electron_o_sall + (Electric_Force)*sall_dt #update electron oentu electron_pos_sall = electron_pos_sall + (electron_o_sall/electron_ass)*sall_dt #update electron position analytic_pos = electron_init_pos + electron_init_vel*tie + 0.5*(Electric_Force/electron_ass)*(tie_sall)** pos_sall_step.plot(pos=(tie_sall, electron_pos_sall.x )) # plot position if(tie_sall > sall_dt): #can't easure rel error at t = 0, delay one tie step delta_sall = 100*abs((analytic_pos.x - electron_pos_sall.x)/analytic_pos.x) #find error delta_sall_dot.plot(pos=(tie_sall, (delta_sall))) #plot percent error analytic.plot(pos=(tie_sall, analytic_pos.x )) #plot classical result

tie_sall = tie_sall + sall_dt #increent tie by sall step print electron_o_sall/(electron_ass*c) #check to see if velocity is uch less than c, classical liit print "average velocity", electron_pos_sall/tie_sall

fro future iport division fro visual iport * fro visual.graph iport * # iport graphing features fro rando iport rando, unifor # iport rando nuber functions #Siulation of an electron acted on by a constant force and suffering #elastic and inelastic scattering. Drude odel for electron conduction. tie = 0 elastic_tie = 0 inelastic_tie = 0 count = 0 dt = 5e-16 # start the syste clock at zero # tie since last elastic collision # tie since last inelastic collision # count nuber of cycles in loop # tie increent (sec) siulation_tie = 1e-10 #tie of siulation elastic_scattering = 1e-14 #tie between elastic scattering events inelastic_scattering = 1e-13 #tie between inelastic scattering events c = 3e8 #speed of light /s two_pi = *3.14159 e = 1.6e-19 #unit of charge electron_ass = 9.11e-31 #ass of electron electron_init_pos = vector(0,0,0) #call origin of syste electron_init_vel = vector(0,0,0) #initial velocity, electron_init_o = electron_ass*electron_init_vel #initial oentu E = vector(10,0,0) #Electric field in x direction, in Volts/eter Electric_Force = -e*e #constant force applied by electric field #graphics position = gdisplay(title = 'Position vs tie', xtitle = 'tie', ytitle = 'x position', x=0, y=0, width=1000, height=400, background= color.black) # window for position vs. tie pos_vs_tie = gdots(gdisplay=position, color=color.cyan) # a graphics curve for large steps #initialize all loop variables electron_o = electron_init_o electron_pos = electron_init_pos #ain loop while (tie < siulation_tie): #length of tie to siulate electron_o = electron_o + (Electric_Force)*dt #update electron oentu electron_pos = electron_pos + (electron_o/electron_ass)*dt #update electron position if count % 10 == 0: # only plot every n'th point pos_vs_tie.plot(pos=(tie, electron_pos.x )) # plot x position vs tie if(elastic_tie > elastic_scattering): #is it tie for an elastic collision? elastic_tie = 0 #reset elastic tie clock #randoize electron oentu electron_o = rotate(electron_o, angle = unifor(0,two_pi), axis = (0,0,1)) if(inelastic_tie > inelastic_scattering): # is it tie for an inelastic collision? inelastic_tie = 0 #resent inelastic tie clock electron_o = vector(0,0,0) #reset electron oentu to zero #print "inelastic scatter" tie = tie + dt # increent syste tie by large step

elastic_tie = elastic_tie + dt # increent tie since last elastic collision inelastic_tie = inelastic_tie + dt # increent tie since last inelastic collision count = count + 1 # total nuber of cycles #end ain loop print electron_o/(electron_ass*c) #check to see if velocity is uch less than c, print "average velocity", electron_pos/tie