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