Computational Methods in Physics

Computational Methods in Physics 1 But first, ž  The midterm survey results! ž  Remaining FAQ’s on HW#4: Sat. e-mail ž  The bonus (photons vs. el...
Author: Gwen Rice
13 downloads 0 Views 3MB Size
Computational Methods in Physics

1

But first, ž  The

midterm survey results! ž  Remaining FAQ’s on HW#4: Sat. e-mail ž  The

bonus (photons vs. electrons) ž  Project: start thinking about it ž  Mac

users: did the problem get solved

—  With the latest OS update(s)?

2

Web Links for HW #5 ž 

http://tutorial.math.lamar.edu/Classes/DE/ EulersMethod.aspx —  Study the many examples on this webpage!

ž 

Full analytical solution with sin(theta) which you can compare to: —  http://sbfisica.org.br/rbef/pdf/070707.pdf

ž 

Damped oscillation —  http://farside.ph.utexas.edu/teaching/315/Waves/

node10.html —  Different types: http://homepages.abdn.ac.uk/nph120/vpl/pendulum/ Equations.html —  http://hyperphysics.phy-astr.gsu.edu/hbase/pend.html ž 

Driven aka forced —  hyperphysics.phy-astr.gsu.edu/hbase/oscdr.html 3

Homework #5, due Mon 10/31 ž 

Solve the pendulum equation for both the small angle approximation and not, under conditions of damping and (sinusoid) driving too —  Damped: nothing, under, critically, over —  Driven: damped with all four cases above —  Angles: 15, 30, 45, 60, 90, 120, 180 deg.

That’s 224 plots! I don’t want that many: combine things. Don’t plot for sake of plots. In e-mail: analyze, draw conclusions on behavior! ž  First things first: you have to make sure h is small enough your program is accurate (#225..) ž 

—  2 ways to do this: analytical solutions or asymptoting

ž 

EC: Euler vs. Euler-Cromer method. Optimize!! 4

Ex. Conclusions (not exhaustive list) ž  Below

h = ? code “does not work” ž  Below θ = ? small angle approximation is OK ž  Full solution displays “blah” behavior that the approx. doesn’t (quantitatively, qualitatively) ž  Must drive *like this* to cancel out damping ž  Critical damping occurs at X value, which matches the analytical solution (calculate one) ž  The behavior as a function of L (or something else) like period, matches analytic solution ž  Overlay with by-hand solutions OR paper plot ž  Compare different Euler-style methods 5

Applications: The Foucault Pendulum The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.

The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.

6

Suggested Final Projects (pick) ž 

ž  ž  ž  ž  ž  ž  ž  ž  ž  ž  ž  ž  ž  ž  ž  ž 

Projectile motion with both wind + air resistance, and different distances from earth, and on different planets, including escape velocity calculations and Corliolis force and any other relevant effects SM Orbital motion in 3 (or more! J) dimensions with 3 or more bodies JH Machine learning to solve a particular problem, like recognizing words within a particular genre XC Sim of particle physics detector, weather/climate/atmosphere, reactor,… Looking for a signal buried in noise (acoustic, color in light, etc.) Image analysis: e.g., find the cancerous tumor Gravitational wave discovery from BH merger 2 birds with 1 stone: something in your own research Quantum entanglement calculator (q-computer coherence simulator) JP Geometric optimization (how many irregularly-shaped products in a box) Non-ideal gas in thermodynamics/stat mech Revisit universe simulator with even wilder/wider assumptions EW Meta-analysis of existing results in some field Contrasting REAL random numbers and better generators to the default Propagation of sound/light/heat in complicated media (inhomogeneous) Complicated, realistic, time-varying electric and magnetic fields ETC: Conjugate gradient topology, fractals, Brownian motion, fluids. May a thousand flowers bloom, and let your imagination run wild

7

Runge-Kutta ž  Today:

http://lpsa.swarthmore.edu/NumInt/ NumIntFourth.html

ž  More

careful and full derivation from Wikipedia: https://en.wikipedia.org/wiki/Runge– Kutta_methods ž  A concise summary from Wolfram’s Math World: http://mathworld.wolfram.com/RungeKuttaMethod.html 8

Scale Factor Differential Eqn. ž  For

the expanding(/contracting) universe ž  FLRW formula (Friedmann-LemaitreRobertson-Walker solution to Einstein eq.) . ž  Spacetime metric [ ( a / a ) * ( 1 / H0 ) ] 2= ž  Ωm0 / a3 + Ωr0 / a4 + ΩΛ0 a -3(1+w) + Ωk0 / a2 . ž  da / dt or a = ž  H0 √ Ωm0 / a + Ωr0 / a2 + ΩΛ0 a 2+p + Ωk0 —  Where ‘p’ is defined as “ -3*(1+w) ” —  1st-order, but complicated (no general solution)

ž  a

= 1 / ( 1 + z ) or z = 1/a – 1; z is redshift 9

Homework #6: Due Mon. Nov. 7 ž  Compare

Euler (or Euler-Cromer) to the “RK4” approach to differential equations, which you will (re-)code yourselves, for the ΛCDM model —  Use Runge-Kutta (RK4) exclusively for rest of HW #6

ž  Verify

code works for the 4 simple cases; show

—  Doing them on board for you today (only 1 Ω non-0) ž 

Determine in the default scenario age of the universe plus the dark-energy inflection point (the correct answers are 13.799 billion years old and a = 0.568) ž  ž 

Be as close as you can be. Report both numbers please Optimize the step size for speed and accuracy, and it can be “adaptive.” Optimize the starting time and scale factor 10

Other Required Plots

ž  For the real universe —  Plot first, second, and third derivatives of the scale

factor a, in addition to the scale factor itself —  Plot all of the omegas as a function of time, redshift z, and the scale factor (can be 1 plot, different axes) —  Plot the redshift and “absolute size” of the (visible) universe as a function of time t (dia. today=93x109 ly)

ž  Plot JUST a(t) for at least 3 different other cases —  Phantom dark energy (show Big Rip; find time scale) —  Decreasing DE (show Big Crunch; again find out tmax) —  Matter-dominated cosmos: flat/open/closed (tmax = ?) —  Anti-de Sitter space (ΩΛ < 0) i.e. an attractive DE —  An a / z / t dependent equation of state w for the DE —  Early universe done well: logarithmic solution to a(t) —  Include: inflation, Ων separately from Ωr (#of species)

11

The Extra Credit Bonus ž  Code

up a “ringing/reverberating universe”

—  https://arxiv.org/abs/1502.06140

ž  What

do you need to change within the differential equation to make the scale factor behave like that as a function of time? ž  Or, “perfect fluid dark matter” —  From 1407.6300 (other Ringermacher article)

12

What You May Need ž  ž 

ž 

Cosmological parameter values (latest, final values of omegas): http://arxiv.org/pdf/1502.01589v2.pdf (look at the age too) Hyperphysics discussion of the Friedmann equation and Hubble parameter, to review: http://hyperphysics.phy-astr.gsu.edu/hbase/astro/fried.html Wikipedia —  Scale factor with redshift definition:

https://en.wikipedia.org/wiki/Scale_factor_%28cosmology%29 —  Equation of state in cosmology: https://en.wikipedia.org/wiki/Equation_of_state_%28cosmology%29 ž 

For your further edification and knowledge —  http://www-com.physik.hu-berlin.de/~fjeger/Cosmolect1-7.pdf

(Friedmann equations hard-core full solutions and explanations)

ž 

Cutting edge research on scale factor (also, gives you the inflection point) —  http://www.ringermacher.com/images/stories/downloadable_pdfs/

aj_148_5_94o_scalefactorplot.pdf OR https://arxiv.org/abs/1407.6300

13

Example Plot

14

CURRENT AND OLD SCENARIOS

and Equations of State (‘w’), the Ratios of Pressure P to the density rho For Matter: w=0 p=-3(1+w) =-3(1+0) =-3

Curvature: w=-1/3 p=-3(1+w) =-3 (1 - 1/3) =-3(2/3)=-2

Λ"

For DE: w=-1 p=-3(1+w) =-3(1-1) =0

Phantom DE: is when w-1 (1+w)>0 3(1+w)>0 p=-3(1+w) 0 KE !) ž 

NEW with GR: non-Newtonian —  Inward going spiral —  Counterintuitively as non-classical 21

An Aside ž  http://mathematica.stackexchange.com/

questions/63690/oval-or-bunimovich-stadium ž  J.

Kepler’s three laws of planetary motion

—  Orbit of planet is ellipse with Sun at one focus —  Equal areas over equal periods of time (this

implies planets move faster when close to Sun) —  Square of orbital period proportional to cube of the semi-major axis of the ellipse that is the orbit —  Empirical only! No first principles until Newton 22

Lagrange Points ž  WMAP,

Planck, eLISA ž  Space station colonies? ž  Earth-Moon, Earth-Sun ž  Trojan exoplanets??

23

Importance of Extra Dimensions

24

Other Potentials

25

https://en.wikipedia.org/wiki/ Classical_central-force_problem

26

More Examples from My Code Inverse cube law spiral

https://en.wikipedia.org/wiki/Newton %27s_theorem_of_revolving_orbits 27

Addendum: Gravitational Waves

28

Homework 9: MD, DUE Mon. 12/5 ž  Play

with my molecular dynamics xenon atom code to OPTIMIZE it: Max precision in min time —  Correct mean/RMS/most prob. v, with good separation

between atoms and few/none leaving vol.; E ~cons.

ž  Suggested starting points for greater speed —  Optimization flags (-O1, -O2, -O3) —  Find a well-balanced fixed step size, or an equation

for a good adaptive step size —  Explore the differences between cutting off the velocity in magnitude vs. by-component

○  Force velocity down to max or re-draw from distribution

—  Explore the differences between wrapping “same”

particles around vs. creating new ones —  Create a cut-off radius outside which force is zero

29

HW # 9 Continued ž  More

ideas (note: must explain what done)

—  Different initial v distributions (like forcing correct?) ○  Do some “stabilize” (v, distance) faster/sooner? —  Does setting a small min velocity have any effect?

ž  You

are welcome to play with the box size ž  Simulate at least 1 ns —  Try for 100 ns max though – much better!

ž  There

will be AWARDS for fast + accurate!

—  Best novice programmer: lowest HW is dropped —  Best experienced programmer: 1% bonus* —  Best overall: acknowledgements in publication ○  If it’s *really* good objectively -- co-authorship 30

A Very Special Bonus ž  Inject

1 keV Xe atom (*fast*) into mix. Determine its RMS track length —  Averaging over many unique instances of

parent particle: starting in center but with different random angles & random seeds ž  If

the answer agrees (spot on) with I have found from an analytical-calculation-based simulation (not Van der Waals molecular dynamics with L-J potential) then you do not have to do any more homework for the semester, only your final project 31