One Hundred Physics Visualizations Using Matlab (With Dvd-rom)

One Hundred Physics Visualizations Using Matlab (With Dvd-rom)

ID:82172240

大小:5.93 MB

页数:312页

时间:2024-01-05

上传者:Jackey
One Hundred Physics Visualizations Using Matlab (With Dvd-rom)_第1页
One Hundred Physics Visualizations Using Matlab (With Dvd-rom)_第2页
One Hundred Physics Visualizations Using Matlab (With Dvd-rom)_第3页
One Hundred Physics Visualizations Using Matlab (With Dvd-rom)_第4页
One Hundred Physics Visualizations Using Matlab (With Dvd-rom)_第5页
One Hundred Physics Visualizations Using Matlab (With Dvd-rom)_第6页
One Hundred Physics Visualizations Using Matlab (With Dvd-rom)_第7页
One Hundred Physics Visualizations Using Matlab (With Dvd-rom)_第8页
One Hundred Physics Visualizations Using Matlab (With Dvd-rom)_第9页
One Hundred Physics Visualizations Using Matlab (With Dvd-rom)_第10页
资源描述:

《One Hundred Physics Visualizations Using Matlab (With Dvd-rom)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1ONEHUNDREDPHYSICSVISUALIZATIONSUSINGMATLAB8853_9789814518437_tp.indd112/11/132:41PM

2Thispageintentionallyleftblank

3ONEHUNDREDPHYSICSVISUALIZATIONSUSINGMATLABDanGreenFermiNationalAcceleratorLaboratory,USAWorldScientificNEWJERSEY•LONDON•SINGAPORE•BEIJING•SHANGHAI•HONGKONG•TAIPEI•CHENNAI8853_9789814518437_tp.indd212/11/132:41PM

4PublishedbyWorldScientificPublishingCo.Pte.Ltd.5TohTuckLink,Singapore596224USAoffice:27WarrenStreet,Suite401-402,Hackensack,NJ07601UKoffice:57SheltonStreet,CoventGarden,LondonWC2H9HEBritishLibraryCataloguing-in-PublicationDataAcataloguerecordforthisbookisavailablefromtheBritishLibrary.ONEHUNDREDPHYSICSVISUALIZATIONSUSINGMATLAB(WithDVD-ROM)Copyright©2014byWorldScientificPublishingCo.Pte.Ltd.Allrightsreserved.Thisbook,orpartsthereof,maynotbereproducedinanyformorbyanymeans,electronicormechanical,includingphotocopying,recordingoranyinformationstorageandretrievalsystemnowknownortobeinvented,withoutwrittenpermissionfromthepublisher.Forphotocopyingofmaterialinthisvolume,pleasepayacopyingfeethroughtheCopyrightClearanceCenter,Inc.,222RosewoodDrive,Danvers,MA01923,USA.Inthiscasepermissiontophotocopyisnotrequiredfromthepublisher.ISBN978-981-4518-43-7ISBN978-981-4518-44-4(pbk)PrintedinSingaporebyMainlandPress.

5November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-fm“Thesoulshouldalwaysstandajar,readytowelcometheecstaticexperience.”—EmilyDickinson“TheefforttounderstandtheUniverseisoneoftheveryfewthingsthatliftshumanlifeabovetheleveloffarce,andgivesitsomeofthegraceoftragedy.”—StevenWeinbergv

6November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-fmThispageintentionallyleftblank

7November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-fmviiPreface“Computersareuseless.Theycanonlygiveyouanswers.”—PabloPicasso“Thepurposeofcomputingisinsight,notnumbers.”—RichardHammingThereareonlyaveryfewsolvableproblemsinphysics.Theyareextremelyusefulbecausetheequationsforthesolutionscanbeplot-tedandtheparametersdefiningthesolutionscanbevariedinordertoexplorethedependenceofthesolutionsonthevariablesoftheproblem.InthatwaythestudentcanbuildupanintuitionabouttheKeplerproblem,forexample.However,thiscanonlybedoneinafewcasesandeventhentheeffortneededistedious.Fortheothers,numericalmethodsareneededandthecomputationbecomessomewhatcumbersome.Asaresult,itismoredifficulttovarytheinputstotheproblemnumericallyratherthansymbolicallyanddevelopanintuitionaboutthedependenceofthesolutiononthoseparameters.Inparticulartimedevelopmentisoftenobscureand“movies”canbeawelcometoolinimprovingphysicalintuition.Nevertheless,theadventofpowerfulpersonalcomputinghasconsiderablyreducedthedifficulties.Indeed,theaimofthisbookistousetheensembleofsymbolicandnumerictoolsavailableintheMATLABsuiteofprogramstoillustraterepresentativenumer-icalsolutionstomorethanonehundredproblemsspanningseveral

8November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-fmviiiOneHundredPhysicsVisualizationsUsingMATLABphysicstopics.Thestudenttypicallyworksthroughthedemonstra-tionandalterstheinputsthroughamenudrivenscript.Inthatwaytheuserdrivenmenuallowsforparametricvariation.MATLABisagoodvehicleforthecomputationaltasks.Ithasacompiler,editoranddebuggerwhichareveryusefulanduserfriendly.TheHELPutilityisveryextensive.TheMATLABlanguageissimilartoamodernC++languageanditisvectorial/matrixwhichmakescodingsimplerthanolderlanguagessuchasFORTRAN.Dataiseasilyimportedandexportedinavarietyofformats.MATLABcontainsmanyspecialfunctions.Matricesandlinearalgebraarecoveredwell.Curvefitting,polynomialsandfastFouriertransformsaresupplied.Numericalintegrationpackagesareavail-able.Differentialequations,symbolic,ordinaryandpartial,aswellasnumericalsolutionsareavailableforbothinitialvalueandboundaryvalueversions.Asanadditionalpackage,MATLABhassymbolicmathematics.Withinthatpackage,calculus,linearalgebra,algebraicequationsanddifferentialequationsarecovered.Itiseasytocombineasymbolictreatmentofaproblemwithanumericaldisplayofthesolutionwhenthatisdesirable.Inthiswayconvertingfromsymbolstonumbersiseasilyachieved.Finally,andveryimportantly,MATLABhasanextensivesuiteofdisplaypackages.Onecanmakebar,pie,histogramandsimpledataplots.Thereareseveralcontourandsurfaceplotswhicharepossible.Thetimeevolutionofsolutionscanbemadeinto“movies”thatillustratethespeedofaprocess.Theseextensivevisualizationtoolsarecrucialinthatthestudentcanplot,varyandthenre-plot.Therearetwo-andthree-dimensionalplotsofalltypesavailable.Complexaswellasrealdatacanbeshown.Theaimofusingthesetoolsistocreateintuition,nottosolveaspecificproblemortocompleteaspecificnumbercrunchingexercise.Indeed,theaimofthetextisnottoteachphysicsbuttogivetheuserasenseofhowthesolutionsofagivenphysicsproblemdependontheparametersofthatproblemandtoshowtheconnectionsbetween,say,waveopticsandquantummechanics.

9November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-fmPrefaceixThescriptforthesedemonstrationsismadeavailable.Usingthatmaterialthestudentcanwritehis/herownadditionsandexplo-rationswiththesuppliedscriptsasjumpingoffpoints.Inthisway,apathisavailabletoextendwellbeyondthespecificdemonstrationsenclosedinthebookitself,makingthesearchforfurtherpossibleinsightsopenended.

10November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-fmThispageintentionallyleftblank

11November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-fmxiContentsPrefacevii1.SymbolicMathematicsandMathTools11.1MATLABFunctions.................11.2SymbolicDifferentiation...............21.3SymbolicIntegration.................31.4TaylorExpansion...................51.5SeriesSummation..................71.6PolynomialFactorization..............71.7EquationSolving...................71.8InverseFunctions...................91.9MatrixInversion...................101.10MatrixEigenvalues..................101.11OrdinaryDifferentialEquations...........101.12FourierSeries.....................121.13DataFitting.....................161.14MATLABUtilities..................212.ClassicalMechanics232.1SimpleHarmonicOscillator.............232.2CoupledPendulums.................282.3TriatomicMolecule..................302.4ScatteringAngleandForceLaws..........312.5ClassicalHardSphereScattering..........362.6BallisticsandAirResistance............39

12November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-fmxiiOneHundredPhysicsVisualizationsUsingMATLAB2.7RocketMotion—SymbolicandNumerical....392.8TakingtheFreeSubway...............452.9LargeAngleOscillations—Pendulum.......462.10DoublePendulum..................482.11CoriolisForce.....................502.12KeplerOrbits—Numerical.............512.13AnalyticKeplerOrbits—EnergyConsiderations....................532.14StableOrbitsandPerihelionAdvance.......593.Electromagnetism633.1ElectricPotentialforPointCharges........633.2ImageChargeforaGroundedSphere.......653.3MagneticCurrentLoop...............673.4HelmholtzCoil....................693.5MagneticShielding..................713.6PotentialsandComplexVariables.........723.7NumericalSolution—LaplaceEquation......743.8NumericalSolution—PoissonEquation......773.9LightPressureandSolarSailing..........793.10MotioninElectricandMagneticFields......833.11TheCyclotron....................853.12DipoleRadiation...................874.WavesandOptics904.1AddingWaves....................904.2DampedandDrivenOscillations..........914.3APluckedString...................944.4ACircularDrum...................964.5DiffractionbySlitsandApertures.........974.6EdgeDiffraction...................1004.7DopplerShiftandCerenkovRadiation.......1034.8ReflectionandTransmissionatanInterface....1054.9ASphericalMirror..................1074.10ASphericalLens...................1094.11AMagneticQuadrupoleLensSystem.......110

13November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-fmContentsxiii5.GasesandFluidFlow1165.1TheAtmosphere...................1165.2AnIdealGasModelinTwoDimensions......1195.3Maxwell–BoltzmannDistributions.........1205.4Fermi-DiracandBose-EinsteinDistributions...1235.5ChemicalPotential,Bosons.............1255.6ChemicalPotential,Fermions............1275.7CriticalTemperatureforHe.............1285.8ExactFermionChemicalPotential.........1305.9ComplexVariablesandFlow............1325.10ComplexVariablesandAirfoils...........1335.11ComplexVariablesandSourcesofFlow......1355.12ViscosityModel....................1375.13TransportandViscosity...............1395.14FluidFlowinaPipe.................1405.15HeatandDiffusion..................1426.QuantumMechanics1456.1Preliminaries—PlanckDistribution........1456.2BoundStates—OscillatingorDamped......1476.3HydrogenAtom....................1486.4PeriodicTable—IonizationPotentialandAtomicRadius..................1516.5SimpleHarmonicOscillator.............1546.6OtherForceLaws...................1566.7DeepSquareWell..................1566.8ShallowSquareWell.................1586.9WavePackets.....................1596.10NumericalSolutionforBoundStates........1626.11ScatteringoffaPotentialStep...........1646.12ScatteringOffaPotentialWellorBarrier.....1676.13WavePacketScatteringonaWellorBarrier...1696.14BornApproximation—ScatteringandForceLaws....................1716.15SphericalHarmonics—3D.............174

14November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-fmxivOneHundredPhysicsVisualizationsUsingMATLAB6.16FreeParticlein3D..................1766.17RadioactiveDecay—Fitting............1787.SpecialandGeneralRelativity1817.1TimeDilation.....................1817.2RelativisticTravel..................1827.3TheRelativisticRocket...............1857.4ChargeinanElectricField.............1877.5ChargeinElectricandMagneticFields......1887.6RelativisticScatteringandDecay..........1917.7ElectricFieldofaMovingCharge.........1947.8MinimumIonizingParticle.............1947.9RangeandEnergyLoss...............1977.10RelativisticRadiation................1987.11ComptonScattering.................1997.12PhotoelectricEffect.................2027.13ElectronsandMuonsinMaterials.........2037.14RadialGeodesics...................2057.15InspiralingBinaryStars...............2107.16GravityWaveDetector...............2118.AstrophysicsandCosmology2168.1GravityandClustering...............2168.2FermiPressureandStars..............2178.3UniformDensityStar................2228.4StellarDifferentialEquations............2228.5RadiationandMatterintheUniverse.......2248.6ElementAbundanceandEntropy..........2308.7DarkMatter.....................2338.8DarkEnergy.....................236Appendix—ScriptforClassicalMechanics2402.1SimpleHarmonicOscillator.............2402.2CoupledPendula...................2442.3TriatomicMolecule..................2472.4ScatteringAngleandForceLaws..........250

15November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-fmContentsxv2.5ClassicalHardSphereScattering..........2532.6BallisticsandAirResistance............2562.7RocketMotion—Symbolic.............2602.8RocketMotion—Numerical............2632.9TakingtheFreeSubway...............2672.10LargeAngleOscillations—Pendulum.......2692.11DoublePendulum..................2722.12CoriolisForce.....................2742.13KeplerOrbits—Numerical.............2762.14AnalyticKeplerOrbits—EnergyConsiderations....................2802.15StableOrbitsandPerihelionAdvance.......285References289Index291

16November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-fmThispageintentionallyleftblank

17November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch011Chapter1SymbolicMathematicsandMathTools“Ifpeopledonotbelievethatmathematicsissimple,itisonlybecausetheydonotrealizehowcomplicatedlifeis.”—JohnvonNeumann“Puremathematicsis,initsway,thepoetryoflogicalideas.”—AlbertEinstein“Therecannotbealanguagemoreuniversalandmoresimple,morefreefromerrorsandobscurities...moreworthytoexpresstheinvari-ablerelationsofallnaturalthings[thanmathematics].[Itinterprets]allphenomenabythesamelanguage,asiftoattesttheunityandsimplicityoftheplanoftheuniverse.”—JosephFourier1.1.MATLABFunctionsThefirstsectionwilldealwithmathematicaltools,mostlyusingtheMATLABsymbolicmathpackage.Althoughnotstrictlyphysics,thetoolsofmathematicsarecrucialbecausetheyarethelanguageofphysicsandphysicscannotbeunderstoodwellwithoutafacilityinthatlanguage.Someofthesetoolswillbeinvokedlaterinthemorephysicsorienteddemonstrationsfoundinthefollowingsections.MATLABhasaverylargesuiteofspecialfunctionswhichareavailabletotheuser.TheycanbefoundfortheMAPLEsymbolicfunctions,byinvokingthecommand“mfunlist”.ThefirstpageofsymbolicfunctionsisshowninFigure1.1.ThecompletesetofMATLABfunctionsisavailableusingtheHELPtabintheCommandWindow.ThesequenceisHELP/MATLAB/functions.Therearetenheadingsunderfunctionsandbyusingthemall,theMATLABfunctionsareavailableforexamination.Therearetwootherusefulheadings,examplesanddemos,whichgiveusefulaidinunderstandingsomeapplicationsofthesefunctions.

18November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch012OneHundredPhysicsVisualizationsUsingMATLABFigure1.1:FirstentriesforMATLABsymbolicfunctions.Specificdescriptionsandexamplesfollowwhenthehelpfunctionisexplicitlyqueried.OneofthestrengthsofMATLABisthattherearesomanysupportedspecialfunctionsandthattheyaredescribedusingthehelpfiles.Theseutilitiesmaketheuseofthesefunctionsquitetransparent.AnexampleisgiveninFigure1.2,wherethepathtodrilldownthefunctiontreeto“acos”isshown.Afulllistisinvokedusingthe.mscript“MATLABFunctions”intheCommandWindow,whichgivesthecompletelistofsym-bolicfunctionsandalsoprintsthepathtoretrievealltheMATLABnumericalspecialfunctions.Toolsthatareusefulwithsymbolicmathare:“sym”,“factor”,“simplify”,“pretty”,“simple”and“eval”.Thesetoolscanbeusedtosimplifythesymbolicstringsand“eval”isusedtoconvertthemfornumericalevaluations.1.2.SymbolicDifferentiationAfirstdemonstrationoftheuseofsymbolicmathistoevaluatederivatives.Aswithmostofthedemonstrationsinthistext,thereisarecurringformat.First,explanatorytextisprintedbyinvoking“help”inthescript,anexampleisgiven,andthenthereisamenudrivenpromptwhichaskstheusertotryotherfunctionsoraddi-tionaloptions.Theexampleisplottedinordertoseetheresult

19November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch011.SymbolicMathematicsandMathTools3Figure1.2:Resultofusingthehelpfacilitytofindthedescriptionoftheacosfunction.oftheoperations.TheMATLABscript“diff”isthecoreofthescript“SMDiff”.TheplotoftheprintoutoftheexampleisshowninFigure1.3,whilethefunctionandderivativeisshowninFigure1.4.Mostoftheexerciseshaveexplanatoryprintoutastheinitialresponsetostartingthespecificscript.Theformatofthescriptusedinthistextismadeasuniformaspossiblewithinthedifferentphysicsbeingexploredsoastomakethescripteasytouse,understand,andulti-matelybemodifiedbytheuserstofollowtheirinterests.1.3.SymbolicIntegrationAsimilarscriptperformssymbolicintegration,withanexamplefollowedbypossibleuserinputfunctionswithresultingplots.The

20November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch014OneHundredPhysicsVisualizationsUsingMATLABFigure1.3:Printoutforthesymbolicdifferentiationscript.Figure1.4:Plotoftheexamplefunctionandthederivative.Otherfunctionscanbeinputbytheuserinsymbolicformasoftenasisdesiredinonesessionofthescriptuse.exampleprovidedisshowninFigure1.5.Thescript,“SMInt”issetuptoperformindefiniteintegrals.However,MATLABhasotheroptionsusingthe“int”script,suchasdefiningthevariablenottobex,butauserdefinedvariableorsupplyingthelimitsforadefiniteintegral.ThereaderisencouragedtofurtherexploretheavailableoptionsinMATLABshouldtheybeinterestedinusingthe“int”functioningreaterdepth.Invoking“helpint”intheCommandWindowyieldsexamplesandoptionsforsymbolic

21November20,20139:179inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch011.SymbolicMathematicsandMathTools5Figure1.5:Exampleforthesymbolicintegrationoftanh(x)asanindefiniteintegral.integration.Inparticular,allofthesymbolicfunctionsindicatedinFigure1.1areavailableasintegrandcandidates.1.4.TaylorExpansionPowerlawexpansionsareusefultoolsinseveralapplications.TheyareavailableusingtheMATLABfunction“taylor”,wheretheexpan-sionpointandthenumberoftermsintheseriescanbeselected.Theprintoutfromthescript“SMTaylor”fortheexampleandthemenufortheuserareshowninFigure1.6.TheplottingoutputfortheexampleexpansionisgiveninFigure1.7.Clearly,anintuitioncanbebuiltupfairlyquicklyastothedomainofvalidityoftheexpansionastohowwellitapproximatesthefunction.Itisclearthattheexpan-sionofthecosfunctionwithfivetermsisafairrepresentationfor|x|<2.AswithotherMATLABscripts,afulldescriptionisavailablefromtheCommandWindowviathehelpqueryorusingthehelptab.Theuserchoosesthefunction,thenumberofterms,andtheoffset,orexpansionpointinthevariablex.Theresultsaredisplayed

22November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch016OneHundredPhysicsVisualizationsUsingMATLABFigure1.6:Printoutforthe“SMTaylor”scriptwiththeexampleofcos(x)andthemenuchoiceofexp(x).Figure1.7:Examplefromthe“SMTaylor”scriptfortheTaylorexpansionofcos(x).

23November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch011.SymbolicMathematicsandMathTools7graphicallyinthefigure.ThatfigurecanbeprintedoreditedusingtheFigureWindowandtheeditingtabssuppliedinthatwindow.1.5.SeriesSummationThereistheabilityinMATLABtosymbolicallysumaseriesusingthe“symsum”script.Thisscripthasbeenusedwithawrapperscriptcalled“SMSumSeries”.AnexampleandauserinputseriesisshowninFigure1.8.Asalways,auserdrivenmenuisprovidedsothatanyseriescanbeinputandsummed.Moredetailsandotherexamplescanbeaccessedwiththeinput“helpsymsum”intheCommandWindow.Figure1.8:Outputoftheseriessummingscriptforanexampleandthenforauserdefinedserieswiththetermsbeingpossiblydefiniteorindefinite.1.6.PolynomialFactorizationPolynomialscanbefactorizedsymbolically.Thescript“factor”isusedinthewrapperscript,“SMFactor”andanexamplewithuserinputisshowninFigure1.9.Numberscanalsobefactored.1.7.EquationSolvingTheMATLABscript“solve”performsthesymbolicsolutionofasetofequationswithmultiplevariables.Theinitialdialogueforthe

24November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch018OneHundredPhysicsVisualizationsUsingMATLABFigure1.9:Printoutoftheinitialdialoguewhenthefactorizationscriptisusedandanexampleofuserinputusingthemenuprovided.“SMSolveEq”wrapperscriptisshowninFigure1.10.Thisexampleillustratesasimplequadraticsolutionofasingleequation.Muchmorecomplexproblemsareeasilysolvable.Extensiveuseof“solve”andrelatedscriptswillbemadelateroninthetext.Figure1.10:Theresultoftheexampleprovidedbythe“SMSolveEq”scriptshowingthesymbolicsolutionforasinglequadraticequation.

25November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch011.SymbolicMathematicsandMathTools91.8.InverseFunctionsTheMATLABscript,“finverse”providesasymbolicsolutionfortheinverseofafunction.Awrapperisprovided;“SMFinverse”whichgivesanexampleandasksforauserdefinedinput.TheprintoutisshowninFigure1.11andtheplotprovidedforauserchosenfunctionisshowninFigure1.12.2Figure1.11:Dialogueoninversefunctions.Theuserchoicewascos(x)whiletheexamplewas1/tan(x).2Figure1.12:Userdefinedinputfunction,cos(x)andtheinverse,shownasafunctionofx.

26November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0110OneHundredPhysicsVisualizationsUsingMATLAB1.9.MatrixInversionInsolvingeigenvalueandeigenvectorproblemsinphysics,itisrequiredtoevaluatetheinverseofamatrix.TheMATLABscript“inv”isavailableandcanbeusedtoevaluatetheinverseofanymatrixsymbolically.Inparticular,thewrapperscript“MatrixInv”canbeused.Ageneral2×2matrixexampleisshowninFigure1.13.NotethatinMATLAB,formanyoperations,oneneednotspecifytheindices.MATLABisamatrixlanguage,hencethename.ForexampleC=A*B,yieldstheproductmatrixofthematricesAandB.Figure1.13:Printoutofthegeneralmatrixinversefora2×2symbolicmatrix.1.10.MatrixEigenvaluesMatrixoperationsareintegraltomanyproblemsinphysics.Fortu-nately,MATLABisamatrixlanguagewhichsimplifiesmuchofthecodingofindiceswhichisneededwitholderlanguages.Thereisalsoasuiteofmatrixscriptsavailablewhichenablestheusertoevaluatematrixquantities.Theprovidedwrapperscriptis“SMEigen”whichusestheMATLABfunctions“det”,“inv”and“eig”.AnexampleprintoutforthecaseofasymbolicrotationmatrixisshowninFigure1.14.MATLAButilitieswillbeusedformatricesinseveralapplica-tionslaterinthetextincludingdeterminant,inverse,eigenvaluesandeigenvectors.1.11.OrdinaryDifferentialEquationsOrdinarydifferentialequationsandsystemsofsuchequationsmaybesolvedsymbolicallyusingtheMATLABscript“dsolve”.Some

27November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch011.SymbolicMathematicsandMathTools11Figure1.14:Rotationmatrix,thedeterminant,inversematrix,andeigenvaluesofthatmatrix.examplesaregiveninthescript“SMODE2”,whereequationsfami-liarinphysicsaregivenasamenuchoice,asseeninFigure1.15.TheprintoutforaspecificcaseisdisplayedinFigure1.16,whereaTaylorexpansionisshownusingthescripttoevaluatetheexpansionoftheFigure1.15:Menuforthechoiceofadifferentialequationtosolveforin“SMODE2”.

28November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0112OneHundredPhysicsVisualizationsUsingMATLABFigure1.16:Symbolicsolutionoftheequationofaparticlefallinginauniformgravityfieldwithavelocitydependentdissipativeforce,boththeexactsolutionandaTaylorexpansionforthepositionx(t).Atlargetimesaterminalvelocityg/kisreached.positionasafunctionoftime.Muchusewillbemadeof“dsolve”insituationsinphysicswhereaclosedformofthesolutionispossible.Inthescript“SMODE3”,theusercanarbitrarilychoosetheordinarydifferentialequationtoexploreandcaneitherdefineinitialconditionsonthefunctionorthederivativeofthefunctionofnot.AsimpleexampleoftheuseofthescriptisshowninFigure1.17,inthecaseofthechoiceofsimpleharmonicmotionwithunspeci-fiedinitialpositionandvelocity.Inthiscase,thereareintegrationconstantsC2andC3inthesolutionwhichwillneedtobeevaluated.1.12.FourierSeriesFourierseriesisapowerfultoolthatisusedtounderstandhowlargearethefrequencycomponentswhichareneededtosufficientlyapproximateanarbitrarywaveform.Infact,anyfunctioncanbesynthesizedusingtheharmonicFourierseries.Themorelocalizedinpositionthefunctionisthelargeristhespanoffrequenciesneededtosynthesizethefunction.

29November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch011.SymbolicMathematicsandMathTools13Figure1.17:Printoutforthecaseofsymbolicallysolvingthesimpleharmonicoscillatorwhentheinitialpositionandvelocityarenotspecified.Thescript“SMfourierex”givesthreeexamplesofaFourierseriesforasquarewave,atriangularwaveandforasawtoothwave-form.Inallcases,thecoefficientsareprintedoutforthefirstsixtermsoftheseriesandplotsofthefunctionandtheapproximateseriesrepresentationforthefirstsixtermsisplotted,whichshowshowthefunctionisbetterapproximatedwhenmoretermsareadded.TheintegralformulaefortheFouriercoefficientsaredisplayedinEquation(1.1).Thefunctioniscalledxandisbuiltoutofsineandcosinefunc-tionsoftimewithfrequencieskω,kaninteger,andcoefficientsintheseriesoffrequenciesak,bk.Thefunctionisperiodicwithlow-estfrequencyω=2π/TandTistheperiodofthefunction.Theseriescoefficientsaredeterminedbyevaluatingintegrals,whichisafunctionwellsuitedtouseoftheMATLABscript“int”.x=ao/2+[akcos(kωt)+bksin(kωt)]kak=2x(u)cos(2πku)dubk=2x(u)sin(2πku)duu=t/T,[−1/2,1/2]ω=2π/T,ωt=2πu(1.1)

30November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0114OneHundredPhysicsVisualizationsUsingMATLABFigure1.18:Fourierapproximationtoasquarewaveafter5terms(oddtermsarezerobysymmetry).ResultsforauserchoiceofthesquarewaveareshowninFigure1.18aftertheseriesisfivetermslong.Thefunctionisevenaboutt=0sothatthesincoefficientsareallzero.Plotsoftheseriesforalltermsareprovidedinordertogivetheuserafeelingabouthowtheseriesapproachesthefunctionasthenumberoftermsincreases.PrintoutforthischoiceisgiveninFigure1.19.Thereisanotherscriptcalled“SMFouriertry”whichdoesnothaveexamplestochoosefrom,butratherhasuserdefinedfunctionswithsymbolicinput.Anyfunctioncanbeattempted.Theresultsforafunctiontcos(t)withfivetermsintheseriesareshowninFigure1.20showingthecoefficientsandFigure1.21showingthefunctionandtheFourierseries.Theusersuppliesafullysymbolicinputofthefunctionoftimeintwohalfperiodsandalsothenum-beroftermsintheseries.Indistinctionto“SMfourierex”whichplotseachadditionaltermintheseriesforoneofthreeexamples,“SMfouriertry”plotsthefullseriesforanarbitraryfunctionandauserdefinednumberofterms.

31November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch011.SymbolicMathematicsandMathTools15Figure1.19:Printoutof“SMfourierex”forthemenuchoiceofasquarewave.Theseriescoefficientsareprintedinsymbolicform.∗Figure1.20:Fouriercoefficientsforthefunctiontcos(t)using“SMfouriertry”.

32November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0116OneHundredPhysicsVisualizationsUsingMATLABFigure1.21:Functiontcos(t)andtheFourierseriesapproximationaftersum-mingsixterms.1.13.DataFittingOneindispensabletoolinphysicsistheabilitytofitexperimentaldatatosomehypothesis.MATLABhastoolsforthisandadditionalscripthasbeendevelopedtotreattheproblem.First,considerasetofdatayiatlocationsxi.Thesepointscanbefittohypothesizedfunctions,forexamplepolynomials.Thescript“DataFits”hastwosetsofexperimentaldatastoredinthescript.ThesedataareplottedandasecondorderpolynomialisfittothemusingtheMATLAB“polyfit”function.TheresultforonedatasetisshowninFigure1.22.Tocomparetotheprintoutfromthatfit,toolsfromMATLABcanbeused—thetab“tools”intheFigureWindowgivesthe“basicfitting”optionforFigure1.23.Choosingthe“showeqs”and“plotresiduals”optionsyieldstheplotinFigure1.23.ThedatashowninFigure1.22canbefitto,andtheresultscomparedtothefitshowninFigure1.23foradifferentorderofpolynomials.Alltheerrorsareassumedtobethesame,asplotted.Amoregeneralproblemcanbeapproachedwiththescriptcalled“LeastSquaresFit2”whichperformsaleastsquaresfittoastraight

33November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch011.SymbolicMathematicsandMathTools17Figure1.22:Fittostoreddatausing“polyfit”inthescript“DataFits”withtheassumedshapeofasecondorderpolynomial.Figure1.23:ScreenshotoftheuseofMATLABbasiccurvefittingusingtheFigureeditingtoolsprovidedbyMATLAB.

34November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0118OneHundredPhysicsVisualizationsUsingMATLABlineinthecasewhenthepointsyihavedifferenterrors.The“polyfit”scriptassumesallpointshavethesamestatisticalweight,whereastheleastsquaresfitusestheweightassignedtoeachdatapoint.Theoutputcontainstheslope,intercept,thechisquared,Equation(1.2),ofthefit,thenumberofdegreesoffreedomofthefit,theerroroftheslope,a,andintercept,b.Theusercanusethealgebracontainedinthescripttoapplyastraightlinefittoanydataoftheirchoice.TheresultsforastraightlinefittothedatashowninFigure1.22,whichdisplaystheassumederrorsoneachindividualpoint,arepresentedinFigure1.24.nχ2=(y−y(a,b))2/σ2iiiy=ax+bndof=n−2(1.2)Astillmorecomplextooliscontainedinthescript“FitsChisqErrors”whichisawrapperscriptusingtheMATLABfunction“fminsearch”tominimizethechisquaredasafunctionofseveralvariables,takingproperaccountoftheerrormatrixofthosevariables.AfittoacubicpolynomialwithproperlyweightederrorsisshowninFigure1.25.Thefitisvisuallybetterthanthestraightlinefitorthequadraticfitdiscussedpreviously.Anyarbitraryfunctioncanbefittobyadoptingthescript.TheprintoutforafittosomeMonteCarlogenerateddatawithasimpleGaussianisshowninFigure1.26.Theplotofthedataandthebestfit,characterizedbyanormalizednumberofevents(1000generated)amean(0generated)andastandarddeviation(1generated)isshowninFigure1.27.Notethatthenumberofevents,mean,andstandarddeviationareallasgeneratedwithinthequotederrorestimates.Veryapproximately,withNevents,thepercenterror√is1/N,sothatwith1000generatedeventsanerrorofabout3.2%isexpected,whichcanbecomparedtothediagonalerrormatrixelementsshowninFigure1.26.Thescriptof“FitsChisqErrors”containsthefunction“FitFun”whichdefineshowfunctionstobefitaredefined.These

35November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch011.SymbolicMathematicsandMathTools19Figure1.24:PrintoutofthescriptappliedtothedataofFigure1.22withvari-ableerrorsinaleastsquaresfittoastraightline.Thefittedslopeisa,whiletheinterceptisb.Theerrormatrixforaandb,is“err”intheprintout.Figure1.25:Chisquaredminimizationofacubicfittothetemperaturedatafitabovetoaunweightedquadraticcurveandaproperlyweightedlinearstraightlinefit.

36November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0120OneHundredPhysicsVisualizationsUsingMATLABFigure1.26:PrintoutofthefitofMonteCarlodatatoaGaussian.Thefittedparameters,a,arethenumberofentries,themeanandthestandarddeviationofthefittedGaussianfunction.The“diag”referstothediagonalelementsoftheerrormatrix.Figure1.27:TheMonteCarlodatashownwithstatisticalerrorsandtheGaussianfittothedata.

37November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch011.SymbolicMathematicsandMathTools21twopackagedscriptsareavailabletotheusertodofitstoanyfunc-tionthatisalreadydefinedorwhichcanbedefined.Theentriesarethediagonalelementsoftheerrormatrixofthefitchosenandthefitfunctionwhichdependsonparametersinanydefinedfashion.Thescript“FitsChisqErrors”issetuptofitdatatoapolynomial,aGaussian,aPoissondistributionoranexponential.Theprintoutandplotssuppliedarecubicfitstothetemperaturedistributionandthevoltagedistribution,aswellastheGaussianfittothestoredMonteCarlodata.TheuserwithsomeacquaintancewithMAT-LABshouldbeabletoaddscriptforanyotherdesiredfunctionalform.1.14.MATLABUtilitiesMATLABhasmanyutilitiesandfeaturesandhereonlythesurfacecanbescratched.Thedesktopprovidesaworkspace,butalsowin-dowswiththecommandhistoryandthecommandwindow,providingahistoryofcommandsissuedinthepresentandpriorsessionsandvariablescurrentlyinmemory.Thereisahelpbrowserwithbothanindexandasearchfacility.Helpforaparticularfunctioncanbeinvokedfromthecommandwindow,e.g.“helpplot”.Theeditoranddebuggermakewritingandrunningscriptsquiteeasy.PlotscanbeeditedaswellasfitusingtheFiguretaboptions.Thereisafullsuiteofarrayoperationsforvectorsincluding,“max”,“min”,“length”,“mean”,“std”(standarddeviation),“sum”,“diff”and“sort”.Matricescanusethe“gradient”functionwhichwillbeusedtoderivefieldsfrompotentials.Therearearithmetic,e.g.+,relational,e.g.>,andlogical,e.g.==,operators.Scriptflowiscontrolledbytheuseof:“if”,“while”,“for”,“end”and“break”.Thenestedloopsareconvenientlyindentedbythecompiler.Anyincorrectscriptisindicatedinredbythecompilerasitistypedin.Equationscanbesolvedusing“solve”foralgebraicequations,and“dsolve”forordinarydifferentialequations.Partialdifferentialequationsinonedimensionaresolvedusing“pdepe”.Ifthesolutions

38November13,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0122OneHundredPhysicsVisualizationsUsingMATLABarenotpossible,ordinarydifferentialequationscanbeintegratednumericallyusing“ode45”.Generalnumericalintegrationsarehan-dledusing“quad”.Thereisafullsuiteofdatahandlingutilitiesforimportingandexportingdata,buttheywillnotbediscussedinthistext.

39November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0223Chapter2ClassicalMechanics“Thesquaresoftheperiodictimesaretoeachotherasthecubesofthemeandistances.”—JohannesKepler“Twothingsthatmattertome;emotionalresonanceandrocketlaunchers.”—JossWhedon“Theearthdoesn’tmovebackward(verymuch)whenyouwalkonlybecauseit’smuchmoremassivethanyouare.”—K.C.ColeThefirstsectionwasdevotedtothemathematicaltoolswhichareofgeneraluseinthistext.TypicallytherewasascriptwrittenwithausermenuwhichwrappedaspecificMATLABfunction.Nowthedemonstrationsforrealphysicsproblemsbegin.Ingeneral,thesameformatforthescriptsisinplace;anintroductoryprintout,anexam-pleandthenausermenutoenabletheusertobuildupanintuitionabouttheproblem.Thedisplaysandplotsaimtobe“movies”when-everpossible,togiveasenseofthedynamicsoftheproblemasitevolvesintime.A“movie”ofthetimedevelopmentallowstheusertoappreciateboththedevelopmentofthesysteminpositionandthetimedependentvelocity.2.1.SimpleHarmonicOscillatorGalileobeganthestudyofphysicsdescribedmathematically.Thestorygoesthathemeasuredtheperiodsofchandeliersinchurchusinghispulsetomeasurethetimeandthusfoundthattheperioddependedonthelengthofthedevice.ItisnowacceptedalmostuniversallythattheUniversecanbeapprehendedmathematicallywhichisagreatmysterywhythatshouldbeso.

40November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0224OneHundredPhysicsVisualizationsUsingMATLABOneofthesimplestproblemsinmechanicsistheharmonicoscil-latorrealizedasamass,m,onaspringwithspringconstantkmovinginonedimension,x,intimet.Thespringrestoringforceisarepre-sentationofthesituationforsmalloscillationsofanyboundsystem,sinceitrepresentsthefirsttermintheTaylorexpansionoftheforcebindingtheparticle.Theone-dimensionaldifferentialequationis:d2x/d2t=−(k/m)x−b/m(dx/dt)+Bcos(ωt)(2.1)wherebisadampingfactorandBisaharmonicdrivingtermwithdrivingfrequencyω.Thedampedfrequencyintheabsenceofdamp-inganddrivingtermsisωo2=k/mandthemotionisoscillatory,x∼e±iωot.Thissecondorderequationneedsinitialvaluesforpositionandvelocitytobedefinedinorderforthesolutiontobefullydeter-mined.Inthisexercise,suppliedbythescript“cmosc”aninitialdisplacementissuppliedequaltoAandtheinitialvelocityisdefinedtobezero.Therearethreecaseswhichareconsidered;nodamping,nodrivingterm,thendampedmotionwithoutdrivingforces,andthendampedanddrivenmotion.Allcasesaresolvedsymbolicallyusingthe“dsolve”scriptintroducedpreviously.Theresultscanbedisplayedbymakingtheinputy,yd,ydronthekeyboardintheCommandWindow.Tosimplify,unitswheretheoscillationfrequencyisk/m=1areused.Theunderdampednaturalfrequencyandtheresonantresponsetoadrivingtermatlongtimesare:ωo=k/mωd=ωo2−(b/2m)2(2.2)ωdr=ωo2−(b/m)2/2Intheoverdampedcase,thesolutionsareexponentials,whileintheunderdampedcase,thesolutionsareoscillatory.Thedampedfrequencyislessthantheundampedfrequency,whilethedrivenres-onantfrequencyisdifferentfromboth.Thefrequencyhalfwidthoftheresonantresponsetothedrivingforceisapproximately,b/2m.

41November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics25Lessdampingmeansthattheresonantresponsetoadrivingforceismoresharplypeakedinfrequency.Thescript“cmosc”firstaskstochooseiftheinitialpositionandA=1isareasonablechoiceforsimplicity.Thedampingtermisnextandb/m=0.1givesanunderdampedsolution.Thedampedfrequencyis0.999,onlyslightlyshiftedfromthenaturalfrequency.Amovieoftheun-dampedanddampedpositionisthenshown.Finally,adrivingamplitudeandfrequencyisaskedasinput,whereB=1andω=0.9areusedastheexample.Theresonantfrequencyisapproximately0.997.Whenanothermenuchoiceisrequested,theoverdampedcasecanbeillustratedbythechoiceofb/m=2.1.AlltheplottedresultsareshowninFigure2.1throughFigure2.4.InFigure2.1,itisclearthatthedampedfrequencyisslightlylessthanthatfortheun-dampedcase,whenthefreeanddampedmotionofb/m=0.1iscompared.Theamplitudeinthedampedcaseisreducedwithtimeandwithrespecttotheun-dampedcase.Figure2.1:x(t)forfreeanddampedmotionwithb/m=0.1.

42November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0226OneHundredPhysicsVisualizationsUsingMATLABFigure2.2:Dampedmotion,drivenandun-drivenwithdrivingamplitude=1andfrequency0.9.InFigure2.2,thedrivenoscillationbeginstohaveafrequencyapproachingthedrivingfrequencyatlongertimesforadrivingfre-quencyof0.9.InFigure2.3,themaximumamplitude,x(t)inthedrivencasewithamplitudeofoneandwithdampingfactorb/m=0.1isplottedfortheexactsolutionasafunctionofthefrequencyofthedrivingforce.Theapproximateresonantfrequencyisalsoshown,aswellastheapproximatewidthoftheresonantfrequencyresponse.Theexactsolutiondiffersfromtheapproximatecase.However,theexpectedresonantbehaviorisseenneartheresonantfrequencyandtheres-onantwidthisveryapproximatelywhatisindicatedonthefigure.Finally,theun-drivendampedresponseintheoverdampedcase,b/m=2.1,isdisplayedinFigure2.4.Inthatcase,thesolutionisadecayingexponentialcomparedtotheunderdampedcasewherethereisbothanoscillatoryandanexponentialcomponentofthesolution,asseeninFigure2.1.

43November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics27Figure2.3:Maximumx(t)asafunctionofdrivingfrequency—underdamped,b/m=0.1.Figure2.4:x(t)forfreemotionandintheoverdampedcase,b/m=2.1.

44November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0228OneHundredPhysicsVisualizationsUsingMATLABTherearemanyparameterswhichthesolutionsdependon.Theusercanvarythemallandseehowthesolutionsvaryinresponse.2.2.CoupledPendulumsAmorecomplexharmonicexampleisthedescriptionoftwopendu-lumswithaspringcouplingbetweenthem.Thecoupleddifferentialequations,withpendulumsdefinedbykandmandwithacouplingKare:d2x/d2t=−(k/m)x−(K/m)(x−x)1112(2.3)d2x/d2t=−(k/m)x+(K/m)(x−x)2212Inthiscase,usingthescript“cms2sho”,theMATLABfunction“dsolve”isusedforthesystemoftwocoupleddifferentialequations.Theuserhasamenutospecifyk,mandKalongwiththeinitialdisplacementsofthetwopendulums.Thisproblemcaneasilybetreatedasaneigenvalueproblem,andthetwoeigenfrequenciesare:ω2=(k/m)1(2.4)ω2=(k/m)+2(K/m)2Theeigenfrequenciescorrespondtosolutions,eigenvectorsexhibitingsimpleharmonicmotion.Theeigenvectorscorrespondfirsttothecasewherethe2pendulumsareinphaseandthecouplingspring,K,isnotdisplaced.Thesecondeigenvectoroccurswiththetwopendulumsoutofphase.Thevaluesofx1andx2foranexamplewithinitialdisplacements[2,1],areshowninFigure2.5andclearly,inthiscase,themotionisnotsimpleharmonic.Theeigenvectors,illustratingthesingleeigenfrequenciesareplottedinFigure2.6.Thereisamoviewhichshowsthetimeevolutionofthesystem.TheusersuppliesthevaluesofkandKandtheinitialpositionsofthetwopendulums.Withtheseoptions,thebehavioroftheeigen-vectorscaneasilybeseenwiththeproperchoiceofinitialpositions.AframeofthemovieforthespecificexampleofFigure2.5appearsinFigure2.7.Indeed,thatfactcanbecheckedbysetting[1,1]andthen[1,−1]astheinitialdisplacementsandwatchingtheresultingmovieandassociatedplots.

45November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics29Figure2.5:Displacementsofthetwopendulumsforthecasewherek=m=1,K=2andwithinitialdisplacementsof[2,1].Figure2.6:TimedependenceofthesumanddifferenceofthedisplacementsofthependulumsfortheexamplespecifiedinFigure2.5.Theseeigenvectorsaresimpleharmonic.

46November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0230OneHundredPhysicsVisualizationsUsingMATLABFigure2.7:Movieofthetimeevolutionofacoupledpendulumsystemfork=m=1andK=2,withinitialconditionof[1,2]forthepositions.2.3.TriatomicMoleculeOnemoredemonstrationwitheigenvectorshasbeenworkedout,thatforthemotionofalineartriatomicmoleculewithtwoatomsofmassmontheleftandrightedgesandanatomofmassMinthecenterwithtwospringscouplingtheatomstogetherwhichsimulatesatomicbonds.Thesystemofequationstobesolvedforthethreedisplacementsis,takingk=m=1:d2x/d2t=(x−x)121d2x/d2t=b(−2x+x+x)2213(2.5)d2x/d2t=(x−x)323b=m/MTheeigenvalueequationissolvedusingtheMATLABfunctions“det”and“factor”inthescript“cmtriatomic”.ThematrixAwisderivedassumingeigenfrequenciesforthemotionandsubstitutingintoEqua-tion(2.5).Thesolutionofthesetofequationsoccurswhenthe

47November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics31determinantiszero.Thethreeeigenfrequenciesare:ω2=0,ω2=k/m,ω2=k/m+2k/M(2.6)123Thefirstcasecorrespondstoaneigenvectorwithuniformtransla-tionoftheentiremolecule.Thesecondcaseisthe“breathingmode”,wherethecentralatomofmassMremainsatrestwhiletheoutertwoatomshaveequalandoppositedisplacements.TheprintoutforthisscriptisshowninFigure2.8.Figure2.8:Printoutforthescript“cmtriatomic”.Theeigenvaluesarefoundusingthefunctions“det”and“factor”.TheexactmotionisfoundusingtheMATLABfunction“dsolve”forthemotionofthethreecoupledmasses.Ingeneral,themoleculehasacomplexoscillatorybehavior.Theresultforinitialdisplacementsof[−1,2,1]areshowninFigure2.9andamovieisdisplayedinFigure2.10.Finally,thesimpleharmonicbehaviorwherethecentralatomstaysatrestcanbeinvokedwiththeuserchoiceof[−1,0,1]forinitialdisplacements.Inthisway,theusercanconfirmtheeigenvectorsoftheproblem.Allthreeshouldbetried.2.4.ScatteringAngleandForceLawsInphysics,onewaytounderstandtheforceswhichactinagivensituationistoscatteraprobeparticleofftheforcecenter.Indeed,

48November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0232OneHundredPhysicsVisualizationsUsingMATLABFigure2.9:Timedevelopmentofthesolutionforinitialpositionsof[−1,2,1],m/M=0.3.Figure2.10:Moviesnapshotforinitialpositionsofthethreeatomsfortheinitialconditions[−1,2,1]andm/M=0.3.

49November20,201310:429inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics33inthatway,Rutherforddiscoveredthatanatomwasmostlyemptyspacewiththeprotonsallclusteredintoacompactnucleuswhichstronglyscatteredalphaparticleswhentheywereusedasaprobe.Agraphicallookatdifferentforcelawsisprovidedbythescript“ScattForceLaw”.Centralforcesthatgoasinversepowerlawswithpowersfromonetofourandwithattractiveandrepulsiveoptionsareprovidedintheusermenu.Otherforcelawscouldbeaddedtothescriptbymakingsmallmodificationstothescript.Amovieofthetrajectorywithadefinedinitialimpactparameter,b,isshownandthenthesuiteoftrajectoriesisshown.Themovieisinequaltimesteps,sothatafeelingforthevelocityasafunctionoftimecanbeobtained.Therelationshipbetweenimpactparameter,b,andscatteringangleisplottedinaseparategraph.TheMATLABtool,“ode45”isusedwhichisanumericalsolverforasetofordinarydifferentialequations.Inthiscase,therearefourunknowns,thexandypositionandthexandyvelocity,whicharecalledy(i)inthescript.Theinitialconditionsarethatx=−10and√y=b,theimpactparameterwithinitialxvelocity=vo=2andinitialyvelocity=0.Themassandkineticenergyoftheclassicalprobeparticlearetakentobeequaltoone.Theequationsasinputto“ode45”are;dx/dt=vx,dy(2)/dt=y(1)dy/dt=vy,dy(4)/dt=y(3)(2.7)dv/dt=(x/r)(q/rn)=dy(1)/dtxdv/dt=(y/r)(q/rn)=dy(3)/dtyThesignofqdefineswhethertheforceisattractiveorrepulsive.Thepowernischosenbytheuserviaaprovidedmenuasisq.Theode45solverfindsallfourunknownsnumerically.Resultsforan=2attractiveforcearegiveninFigure2.11,whileresultsforn=2repulsiveareshowninFigure2.12.Ingeneral,morelocalizedforceswithlargern,givelargerdeflectionsatsmallimpactparametersthanforceswithaweakerrdependence.Theusercanexplorethesechar-acteristicsbywatchingalleightofthepossiblemovies.Inthespecialcaseofaninversesquarelaw,theattractiveandrepulsiveorbitsare

50November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0234OneHundredPhysicsVisualizationsUsingMATLAB2Figure2.11:Scatteringtrajectoriesfordifferentbfora1/rattractiveforce.2Figure2.12:Scatteringtrajectoriesfordifferentbinthecaseofa1/rrepulsiveforce.

51November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics35onthetwodistincthyperbolictrajectorieswhichareexplainedinmoredepthlaterinthesectiononKeplerianorbits.Finally,aplotofthescatteringangleasafunctionofimpactparameterisgiveninFigure2.13.Clearly,thesmallimpactparam-etertrajectoriesseeastrongerforceand;therefore,havelargerscat-teringangles.Theexperimentercannot,alas,aimtheprobesothatallimpactareasareequallyprobableandthecrosssectionisjustproportionaltotheareaofaringofimpactparametersofarea2πbdb.Theresultingscatteringangledistributioniseasilyfound,sincethereisaonetoonerelationshipbetweenscatteringangleandimpactparameter;dσ∼bdb=b(db/dθ)dθ(2.8)Figure2.13:Relationshipofthescatteringangletotheimpactparameterfor2thecaseofa1/rrepulsiveforce.Becauseoftheequallyprobableimpactparameterareas,bdb,mostbarelargewhichmeansmostanglesaresmall.Inthatcase,theexperimentallyobservedangulardistributionwillbepeakedatsmallscatteringangles.AnexampleisRutherfordscattering,whichfalls

52November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0236OneHundredPhysicsVisualizationsUsingMATLABasthefourthpowerofthescatteringangleforsmallangles.AroughestimateforCoulombscatteringintheRutherfordcasereproducesthatdependence.dσ/dΩ∼1/θ(dσ/dθ)∼b/θ(db/dθ)F∼1/b2,t∼b/v→b∼1/θ(2.9)dσ/dΩ∼1/θ4dΩ=dφdcosθ=2πsinθdθ∼2πθdθTheCoulombforce,F,islargeforr∼bandthetimeitacts,t,goesas∼bdividedbytheincidentparticlesvelocity,v.Thescatteringangleduetothemomentumimpulse,Ft,isthen∼1/b,sothatinthiscase,theinversefourthpowerisobtainedfortheangulardistribution.Otherforceswouldgiveotherpredictionsfortheobservedscatteringangledistribution.Notethattheattractiveandrepulsiveorbitsareonthetwoarmsofhyperbolaeforaninversesquarelaw.Withtheadditionofnegativecharge,bothpossibilitiesopenupasopposedtogravitationalattractiononly.2.5.ClassicalHardSphereScatteringKinematicsplaysabigroleinscatteringbeyondthatofthedynam-icswhichwerepreviouslydiscussed.Thescripttoexplorehardspherescatteringiscontainedin“cmNRscatt”.Thescatteringism+M→m+M,wheremistheprojectilemasstakentobeoneandMisthetargetmass.TheusermenuconsistsofthechoiceofM.OnceMisknown,thekinematicsfordifferentscatteringanglesoftheprojectileandrecoilanglesofthetargetareexplored.Thecon-servationofkineticenergy,T=mv2/2,andvectormomentumis,m=1:v2=v2M+v2in21(2.10)vin=v1+v2Theseequationscanbesolvedfortherecoilvelocityasafunctionoftheangleoftherecoilingtarget,φ.v2=2cosφ/(1+M/m)(2.11)

53November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics37Oncetherecoilangleischosen,therecoilvelocityissolvedfor,andthenthescatteredprojectilevelocity,v1followsfrommomentumconservationasdoesthescatteringangleθoftheprojectile.v1=1+v22−2v2cosφ(2.12)v1sinθ=v2sinφTheresultsforrepresentativerecoilanglesareshownasa“movie”whichindicatestheinitialvelocity,thescatteredvelocityandangle,andtherecoilangleandvelocity.Inthisway,anintuitionisbuiltupasregardsthekinematicsofscattering.InFigure2.14,aframeofthemovieforthecaseofM=1isshown.Inthiscase,theprojectilecantransferallitsvelocitytothetarget,whichisfamiliarinbilliards.Notethattheanglebetweenthescatteredprojectileandtherecoilingtargetinthisequalmasscaseisalwaysninetydegrees.InFigure2.14,thetargetrecoilswithFigure2.14:Scatteringofaprojectileandtherecoilmomentumandangleforthecaseofequaltargetandprojectilemass.Thisisasnapshotofamoviecoveringseveralscatteringangles.

54November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0238OneHundredPhysicsVisualizationsUsingMATLABalmostthefullvelocityoftheprojectile.Thisfactforscatteringhasanapplicationinneutronmoderation.Onlyforfreeprotonswillneu-tronsslowdownsignificantly,sothatneutronmoderatorsnormallycontainmolecularhydrogenorlightelementswithlargecapturecrosssectionssuchasboron.ThecomplementarycaseisshowninFigure2.15,whereM=10.Inthatcase,therecoiltargetneverattainsmorethan18%ofthevelocityoftheprojectile,whilethescatteredprojectilealwaysretainsatleast82%oftheprojectilevelocity.Thisbehaviorisalsofamiliartopoolplayerswhenusingthe“bumpers”.Alightparticlecannottransfervelocitytoaheavytargetbecauseitismomentumthatistransferrednotvelocity.Thisiswellunderstoodbycardrivers.AMacktruckcollidingwithaSmartcarwillnotsufferalargerecoil.Figure2.15:TargetvelocityasafunctionofscatteredprojectilevelocityinthecaseofM=10.Thereisamaximumvelocitylessthantheprojectile,whichthetargetcanattainthatdependsonM.TheusercanvarythemassesandseehowthevelocitypartitionbetweenrecoilandprojectileparticlesisalteredwhenMisvaried.

55November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics392.6.BallisticsandAirResistanceMotionofaballisticprojectileinauniformgravityfield,g,nearthesurfaceoftheearthisapracticalproblemandonewhichneedstotakeairresistanceintoaccount.TheequationswhichareusedaresolvableandarecomputedsymbolicallyusingtheMATLABfunction“dsolve”.d2x/d2t+kdx/dt=0d2y/d2t+kdy/dt+g=0(2.13)x(0)=0=y(0)vx(0)=vocosα,vy(0)=vosinαThexcoordinateishorizontalandyistheverticalposition.Theconstantkspecifiesthevelocitydependentairresistance.Theinitialangleoftheprojectileisα.Theprintoutforthescript“cmballissym”isshowninFigure2.16.Notethatthereisaterminalvelocityatlongtimes,wherev=g/kandwheretheaccelerationiszero.Thisphenomenonisfamiliarforskydiversandotherswhentheairresistanceexertsaforcematchedtotheaccelerationofgravity.Atlongtimesy∼(g/k)t.Amovieoftheprojectilemotion,yasafunctionofx,isdisplayedandthecompletetrajectoryisplottedinFigure2.17,comparingthecaseswithandwithoutresistance.Theusermenuhasachoiceofinitialvelocityandtheinitialangleoftheprojectile.Inthisway,theusercanconfirmthewell-knownfactthatthemaximumrangeobtainswhentheprojectilestartsat45degrees.2.7.RocketMotion—SymbolicandNumericalThemotionofarocketisdefinedbytheexhaustvelocity,vo,orthevelocityatwhichmaterialofmassdmisejectedfromtherocketwithrespecttotherocket.Forapresentrocketmassm,conservationofmomentumleadstoarocketvelocitychangedv:mdv=−vodm(2.14)IntegrationofEquation(2.14)leadstotheresultthatthevelocityoftherocketdependslogarithmicallyontheratiooftherocketmass

56November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0240OneHundredPhysicsVisualizationsUsingMATLABFigure2.16:Printoutshowingthex(t)andy(t)solutionswithandwithoutairresistance.toitsinitialvalue,mo,orthepayloadratio:v(m)=voln(m/mo)(2.15)Assumingaconstantburnrateoffuel,˙m=dm/dt,andatotalburntime,T,ifallthefuelwereexhausted,withnopayload,thedifferentialequationforasimplerocketasafunctionoftimefollows:m=mo−mt˙T=mo/m˙

57November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics41Figure2.17:Plotsofthetrajectoryofaprojectilestartingat45degreesand−1withamuzzlevelocityof10m/secwithandwithoutairresistance,k=0.1sec.d2y/d2t=−v/(T−t)od2y/d2t=−v/(T−t)+g(2.16)oTheadditionofauniformgravityfield,g,makestheequationsomewhatmorecomplexbutstillsolvable.Aclosedformsolutionforthepresenceofarealinversesquaregravityfielddoesnotexist,however.Therocketscriptiscontainedin“cmrocketsym”.Theprint-outofthesymbolicsolutionstotheequationsusestheMATLAB“dsolve”functionwhichappearsinFigure2.18.Integratingtherocketequation,therelationshipofthepayloadmassratiototheinitialmass,definesthefinalvelocityratiototheexhaustvelocityasinEquation(2.15).Amovieisprovidedtotheuserafterthepayloadratioischo-sen.Therapidincreaseindistanceastherocketnearstheendoftheburntimeisevidentwhenviewingthemovieofaltitudeasafunctionoftime.Numericalresultsfora1%payloadratioareshownfortherocketaccelerationinFigure2.19andtherocketaltitudeas

58November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0242OneHundredPhysicsVisualizationsUsingMATLABFigure2.18:Symbolicsolutionstothesimplerocketequationandtheequationinauniformgravityfield.Figure2.19:Rocketaccelerationasafunctionoftime.Thereisarapidincreaseinaccelerationastherocketapproachestheendofaburnwithasmallpayloadratio.

59November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics43afunctionofburntimeinFigure2.20.Itisinterestingtoobservethatrocketvelocitiesinexcessoftheexhaustvelocityarepossible,iftherockethasasmallpayloadratio.Inthe1%payloadcase,thefinalrocketvelocityisaboutfivetimesthatoftheexhaustvelocity.Forsmallpayloadratios,thealtitudeapproachestheexhaustvelocitytimesthetotalburntime.Figure2.20:Rocketaltitudeasafunctionoftimefora1%payload.Themovieshowsthetimedevelopmentofthealtitudewhichillustratesthesharpincreaseinaccelerationandvelocityatlatetimes.Amorepurelynumericalcalculationappearsinthescript,“cmrocketnum2”.Thesolutionsfoundsymbolicallyinthescript“cmrocketsym”areevaluatedintheparticularcontextofaSat-urnVrocket.Ascontexttosetthescales,thelowearthorbitalvelocityof7.9km/sec,theEarthescapevelocityof11.2km/sec,andtheescapevelocityofthesolarsystemof42.1km/secareprintedout.Theequatoriallaunchvelocityof0.46km/secisalsoprintedtoremindtheuserofthereasonwhyrocketlaunchesintheUSwereplacedinFlorida.Theeffectis,however,smallandignoredinwhatfollows.EscapevelocitiesneededtoescapefromamassMstarting

60November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0244OneHundredPhysicsVisualizationsUsingMATLABfromaradiusrare:ves=2GM/r(2.17)AusermenuofscalingtoaSaturnVisinvoked.Forarockettwotimesheavier,withonlya200kgpayloadanda4km/secexhaustvelocity,aonestagerocketcanescapefromthesolarsystem.TheaccelerationofthisscaledupSaturnisshowninFigure2.21.Notethatittakesalmosttwominutes,125sec,fortherockettobuildupsufficientaccelerationtoliftoffbyovercomingtheaccelerationofgravity.Thisisfamiliartothosewhowatchrocketlaunches.Amovieoftherocketdistanceasafunctionoftimeisprovidedtotheuser.ThevelocityasafunctionoftimeappearsinFigure2.22.Figure2.21:Accelerationforafreerocketandarocketinauniformgravityfieldwithaccelerationg.NotethedelayinthegravityfieldcasewhichisneededtoovercomethegravitywelloftheEarth.Thescriptgivessomeaddedprintoutfortheuserdefinedrocket.Theburntimeinthisexampleis533sec.PayloadratiosforagivenfinalvelocityareevaluatedusingEquation(2.15).Therocketcouldput489,000kgintoanEarthescapeorbit,ora6.1%payloadratio.

61November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics45Figure2.22:VelocityofthescaledupSaturnVrocketwitha200kgpayload.Notethatthissmallpayloadisjustsmallenoughtoattainescapevelocityfromthesolarsystem.However,toescapethesun,thisrocketcanonlyhavea215kgpay-loadorapayloadratioof0.000027.ArealisticscaleissetbytheactualSaturnrocketandescapemodulewithapayloadratioof0.3%.2.8.TakingtheFreeSubwayItisanamusingthoughtexperimenttoimagineasubwayshaftcutalongachordconnectingtwopoints.BecauseoftheGausslawthattheimportantthingisthemassbetweenthecenterofabodyandthetestmass,thereissimpleharmonicmotionofthattestbodymovingalongsuchachord.Forauniformdensity,ρ,sphereofradiusR,thedistancealongthechordisxo,themaximumdepthofthesubwayisd,theanglesubtendedbythechordisθ,andthedistancealongtheEarth’ssurfaceiss:xo=2Rsinθd=R(1−cosθ)(2.18)s=2Rθ

62November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0246OneHundredPhysicsVisualizationsUsingMATLABThecircularfrequencyofthemotion,ωo,isindependentoftheparticularchordanddependsonlyonconstantswhichdefinethegravityfieldoftheEarthintheuniformdensityapproximation.ω2=Gρ(4π/3)=g/R(2.19)oThetriptimeisthen,T=π/ωo,whichfortheEarthis2533sec,orabout42minutes,independentofthetripdistance.Thescriptwhichwaswrittentocoverthisproblemappearsin“cmsubway2”.Itprovidessomenumericalprintout,reproducedinFigure2.23,amovieofthemotioninordertoprovideinsightintothevelocityasafunctionoftime,andthetrajectoryalongthechordasafunctionoftime,giveninFigure2.24.Whosaysthereisnofreelunch?Wecanusethegravityfieldoftheearthtotravelfor“free.”Figure2.23:Printoutfortheusersupplieddistancealongthesubwayshowingthesubwaydepth,surfacedistance,andtraveltime.However,thevelocityofthetripincreaseswiththedistanceandtheheatencounteredina“deep”tripmightbeabitimpractical.Still,thestudyoftheuseofthepropertiesoftheinversesquarelawforgravityisamusing.2.9.LargeAngleOscillations—PendulumThependulumequationwhichdescribessimpleharmonicmotioniscorrectonlyinthesmallangleapproximation.Theapproximatefre-quencyisωo=g/L,whereListhelengthofthependulum.Ingeneral,theequationisnonlinearandthereforethemotionisnotharmonic.d2y/d2θ=(g/L)sinθ→(g/L)θ(2.20)

63November20,201310:429inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics47Figure2.24:Forachorddistanceof20,000kmthetraveltimeis2533sec.Theslope(velocity)isgreatestatthemidpointofthetrip.Thescriptprovidedtostudythisproblemis“cmpendul”whichusestheMATLABnumericaldifferentialequationsolver“ode45”.TheprintoutforaparticularexampleisshowninFigure2.25,whiletheplotoftheangularvelocityinthiscaseisshowninFigure2.26.Amovieoftheangularpositioninthesmallanglecaseandalsothegeneralcaseisprovidedtotheuserinordertobuildupanintuitionastotheregionsofapproximatevalidityofthesmallanglesolution.Ingeneral,thelargeangleperiodisincreased,andtheprintoutgivesthefirsttermintheseriesexpansionforthesolution.Figure2.25:Printoutforthe“cmpendul”script.Theparticularexamplehasalargeinitialanglebutnoinitialangularvelocity.

64November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0248OneHundredPhysicsVisualizationsUsingMATLABFigure2.26:AngularvelocityinthesimpleharmoniccaseandthesolutionforaparticularlargeoscillationwithparametersdefinedinFigure2.25.2.10.DoublePendulumLargeangleoscillationsoftwocoupledpendulumsaretreatedinthescript“cmchaotic”.Themotionisnonlinearbecausetheoscillationshavealargeamplitudeandtheyarecalledchaotic.Theequationsofmotionarefourfold,fortheangularlocationofthetwomasspointsandforthevelocitiesofthetwopoints.Theyarenotverytransparent,butcanbestudiedbyexaminingthescriptprovided.Themasses,m,aretakentobeequaltooneasaretheg/Lratios.Thelength,L,ofbothpendulumsissettobeonealso.Theinputsaretheinitialanglesofthetwomasspoints.Theinitialvelocitiesarefixedatzero.Plotsoftheangularvelocityandpositionasafunctionoftimeofthetwomasspointsaremadeandamovieofthemotionisplayed.ThepositionofthemasspointsappearsinFigure2.27,whileaframefromthemovieappearsinFigure2.28.TheMATLABfunction“ode45”wasusedtocreatethenumericalsolutionsofthesenon-linearandcoupledequations.Themovieviewermayberemindedofthemotionofnunchucksinkungfumovies.

65November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics49Figure2.27:Plotofthepositionsofthetwopendulaforinitialpositionsof45and−60degrees.Figure2.28:Aframefromthemovieofthependulum’spositionsasafunctionoftimeforinitialanglesof45and−60degrees.

66November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0250OneHundredPhysicsVisualizationsUsingMATLAB2.11.CoriolisForceThereareseveralsolvableproblemsinphysicsarisinginacceleratedreferencesystems.Onesuchproblemconcernsthe“fictitious”forcesthatariseonEarthduetoitsrotationwithcircularfrequency,ω.Inparticular,thereistheCoriolisforcewhichistreatedinthesuppliedscript“cmcoriolis”forthespecialcaseofdroppingaparticlewithnoinitialvelocitycomponents.TheresultingsolutionisfoundusingtheMATLABsymbolictool“dsolve”forthetimedevelopmentinthevertical(z)andEast(y)directionatalatitudedefinedbyθ.TheprintoutisshowninFigure2.29.Figure2.29:DialogueforthescriptwhichexploresCoriolisforce.Inthissimplecase,yasafunctionofziseasilydetermined.ThequantitywistheangularvelocityoftheEarth.Thecoupledequationsare:d2y/d2t=−2ωcosθ(dz/dt)d2z/d2t=g(2.21)ThesolutionsshowninFigure2.29canbeusedtoremovethetimedependencetofindthetrajectory−y(z).Thenumericalvalueforadropof10,000mfrom45degreesofnorthlatitudeisshowninFigure2.30.Insomerealsenseyouaimaty=0,buttheEarthrotatesawayfromyouby15.5mduringthetimeofthefall.

67November20,201310:429inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics51Figure2.30:Trajectoryofyasafunctionofzduringfreefallofanobjectreleasedfromanaltitudeof10,000mat45degreesnorthlatitude.2.12.KeplerOrbits—NumericalTheproblemofthenumericalevaluationoforbitsinacentralinversesquarelawistreatedinthescript“cmkepl3”.Thecorecomputationisdonewiththeuseof“ode45”,theMATLABnumericalintegratorforasetofordinarydifferentialequations.Theinitialdialogue,inresponsetoauserdefinedchoiceofdistancetothesun,isarequestfortheinitialvelocity,bothradialandtangential.Thevelocityforacircularorbitandtheescapevelocityatthatdistanceareprovidedtosetthescale.ThevaluesforEartharealsogiven,sothatKepler’slawscanbecheckednumerically.Themotiondefinedbytheseinitialconditionsisdisplayedasa(x,y)movie.Thetimespacingisuniform,sothatanintuitionfororbitalvelocitycanbeattainedbytryingdifferentconfigurations.Radialvelocityislargestnearestthesun,asexpected.Resultsforinitialradialvelocity=0andtangentialvelocityinAU/yrof6.28,8and9.5areshowninFigures2.31,2.32and2.33respectivelyinthespecificcaseofaninitialradiusofoneastronomicalunitorAU.TheycorrespondtothepossibleKeplerianorbitsofacircle,ellipse

68November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0252OneHundredPhysicsVisualizationsUsingMATLABFigure2.31:Plotofthe(x,y)trajectoryforacircularorbit.TheSunisatthe∗origin,markedby.Theorbitsinaninversesquareforceare,infact,re-entrantbutthenumericalintegrationisnotexact.Figure2.32:Plotofthe(x,y)trajectoryforanellipticalorbit.Thesunislocated∗atafocusoftheellipseandismarkedby.Thespeedoftheorbitislargestwhennearestthesun.

69November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics53Figure2.33:Plotofthe(x,y)trajectoryforahyperbolicorbit.Thelocationof∗thesunisindicatedby.andahyperbola.Inthecaseoftheellipseandhyperbola,thelastmovieframeisshowninordertoillustratethelargervelocitynearthesuninthosecases.Thenumericalintegrationsworkingeneral,butthescriptchoicesbytheusermaysetplotlimitswhichmaybeviolatedinthecaseoforbitswhichfallintotheSunorwhichescapeveryrapidlyoutoforbit.Forthecircularorbit,thesunisatthecenter,whilefortheelliptical,thesunisatoneofthefoci.Otherorbitsarepossibleandtheusershouldexplorethepossibilities.Thetimescaleforinte-grationisthetimespanoffivecircularorbitsatthestartingradius.Note,inparticularthatacircularorellipticalorbitis“re-entrant”—itrepeatsintimesothattheorientationoftheellipseintheplanedoesnotchangefromorbittoorbit.Thisisapropertyoftheinversesquarelawandisnottrueforotherforces.2.13.AnalyticKeplerOrbits—EnergyConsiderationsGravityisacentralforce.Thismeansthatorbitalmotionisconfinedtoaplane,(r,θ)calledtheeclipticforthesolarsystem.Furthermore,

70November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0254OneHundredPhysicsVisualizationsUsingMATLABtheangularmomentum,L,isconservedwhichallowsforthereduc-tionoftheproblemtoaneffectiveonedimensionalequationofmotion.Theangularmomentumis:L=mr2dθ/dt(2.22)Theeffectiveone-dimensionalconservedenergyis,E=Tr+Veff,whereTristheradialkineticenergyandVeffistheeffectiveradialpotentialenergy.Settingtheorbitingmassmtobeone:E=(dr/dt)2/2+[L2/(2r2)−GM/r](2.23)Theenergyisthesumoftheradialkineticenergy,thegravita-tionalpotentialenergy,andaneffectiverepulsiveinversecubeforcelaw.Thenumericalorbitalscript,“cmkepl3”couldbemodifiedtocoverdifferentforcelawsbyanyuserwillingtochangeafewlinesofcode.Inthecaseofthesymbolicscript“cmkepl”,theefforthasbeenfocusedonanalyticalsolutionstotheinversesquareproblem.Someoftherelevantequationsforauserchoiceofradius=roare:L2=rGMcoEc=−GM/2roq=E/|Ec|(2.24)e=1+qr/ro=1/(1+ecosθ)v/vc=(dr/dt)/GM/ro=q+2(1+ecosθ)Theangularmomentumforacircularorbitofradiusro,isLc.TheenergyforacircularorbitofthatradiusisEc.Thecontrol-lingparameteristheenergyoftheorbit,E,whichisnormalizedtotheenergyofthecircularorbitbydefiningtheparameterq.Theeccentricityoftheorbitise.Theone-dimensionalproblemofrasafunctionoftcanbetransformedintotheorbit,rasafunctionofpolarangle,θ,byusingthefactthatLisaconstantofthemotion.Thesolutionforrgivenabovecorrespondstoaninitialangleofzero,whichinitiallyyieldsthesmallestradiusdefinedtobetheperihelion.Theradialvelocityasafunctionofangleisalsosolvedfor,andis

71November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics55normalizedto,thevelocityofacircularorbit,vc,inEquation(2.24).Theeffectivepotentialis:V=GM[r/2r2−1/r](2.25)effoThereisacompetitionbetweentheattractivegravitationalenergywhichgoesinverselywithradiusandtherepulsivecentrifugalpotentialthatgoesastheinversesquareoftheradius.Dependingontherelativestrengthsofthesetwoeffects,theorbitswillbeclosedellipsesoropenhyperbolae.Theminimumofthepotentialoccursatroandis−1/2(GM/ro)whichistheenergyofacircularorbit.Theenergyofsuchanorbitislessthanzerosincethestateisbound.Itsatisfiesthevirialtheorem.Thesolutionfortheorbit,r,andtheorbitalvelocity,v,incircularvelocityunitsdependsontheenergyoftheorbit.Theellipsemajoraxisisro/|q|andtheminoraxisisthesquarerootoftheproductofthemajoraxisandro.Theturningpointsforanellipsewheretheradialvelocityiszeroareat:x1/ro=1/q(−1+e)(2.26)x2/ro=1/q(−1−e)Thereforeqfullydefinesthesolutions;q<−1meansnosolution,q=−1isacircularorbit,qbetween−1andzeroisanellipticalorbit,q=zeroisaparabolicorbit,andqgreaterthanzeroisahyperbolicorbit.Veryelongatedellipsescorrespondtocometaryorbits,whichareboundtothesunbutwithverylowenergiesandverylargeeccen-tricities.Theprintoutforthescript“cmkepl”isshowninFigure2.34.Thedialoguegivesescapevelocity,circularorbitparameters,and,forellipticalorbits,themajorandminoraxes,theturningpointradii,theorbitalperiodandtheeccentricity.Foreachchoiceofinitialradiusandenergy,theeffectivepoten-tialenergyandthe(x,y)orbitisplotted,aswellastheorbitaltimeandorbitalvelocityasafunctionoftheorbitalangle.Theeffectivepotential,withcontributionsfromtheSunandfromtherepulsivecentrifugalpotential,isshowninFigure2.35.Thepotentialfora

72November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0256OneHundredPhysicsVisualizationsUsingMATLABFigure2.34:Printoutinthedialogueforthescript“cmkepl”forauserchosenexamplewithanellipticalorbit.Figure2.35:Effectivepotentialenergyforanellipticalorbit.Thecircularorbit∗isindicatedby,whiletheturningpointsforthechosenenergyof,q=−0.5areindicatedbyo.circularorbitandthelocationoftheturningpointsforthechosenenergyarealsoshown.IntheparticularcasethelimitsfortheellipsewithaninitialrofoneAUandtotalenergyof−1/2isshown.TheellipticalorbitisshowninFigure2.36,wherethemajorandminor

73November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics57Figure2.36:EllipticalorbitfortheparametersprintedinFigure2.34.Thedis-tancebetweentheturningpointsisthelengthoftheellipticalmajoraxis.Themajorandminoraxesareshowningreenandred.axesareshowningreenandredandthemajoraxislengthcorre-spondstotheturningpointsprintedinFigure2.34.TheorbitalvelocityforthechosenellipticalorbitisshowninFigure2.37.Clearly,thevelocityisnotconstantasitisforacircularorbit.TheorbitalvelocityislargerwhentheorbitisnearthefocusattheSunandsmaller,byasubstantialfactor,whentheorbitisatalargerdistancefromtheSun.Asindicatedintheprintout,theorbitaleccentricityis0.707inthisexample.Theusercanalsomakeinputstothemenuwhichresultinparabolicorhyperbolicorbits.Attheboundarybetweenaveryeccentricellipseandahyperbola,theparabolicinputofq=0resultsinthetrajectoryshowninFigure2.38.Ahyperbolicorbitisshownwithq=0.015inFigure2.39.Theorbitrapidlyapproachesastraightlinewithanunboundtrajectorywhichescapesthegravitationalbind-ingforce.Thestraightlinesarecalledtheasymptotesoftheorbit.Inalltheplotsdisplayedhere,theinitialradiuswas1AU,thechosenL

74November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0258OneHundredPhysicsVisualizationsUsingMATLABFigure2.37:Orbitalvelocityasafunctionoftheorbitalangleforanellipticalorbitinunitsofthevelocityforacircularorbitwithradiusro.ParametersareasquotedinFigure2.34.Perihelionisatangle=0,whileaphelionisatanangle◦of180.Figure2.38:Trajectory(x,y)foraparabolicorbitwithq=0.Thescaleistoolargetoseparatetheforcecenterandtheperihelion.

75November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics59Figure2.39:Hyperbolicorbitshowingboththeorbitandtheasymptotesofthehyperbolaforq=0.015.Thescaleistoolargetoseparatetheforcecenterandtheperihelion.Theturningpointisat0.5AU.Arepulsiveforceofgravitywouldhaveanorbitontheothersegmentofthehyperbolae.valuewasthatofacircularorbitatthatradiusandtheorbitaltypewascontrolledbytheconservedenergy.Itisclearinmakingtheseplotsthattheboundstateorbitsarere-entrant.Thatis,theyrepeatintimeandtheorbitalpathsdonotchangewithtimeaveragedovermanyperiods.Thisfactisuniquetothefactthatgravityisaninversesquareforcelaw.2.14.StableOrbitsandPerihelionAdvanceItisofinteresttoexplorewhetherorbitswhichareperturbedarealsostable.Thescriptwhichwaswrittentoexplorethequestionis“cmcirclorbit”.Infact,circularorbitsarepossibleformostcentralforcesobeyingapowerlawintheradiusfromtheforcecenter.Foracircularorbit,radiusa,thecentrifugalforceisequaltotheattractiveforce,L2=a3F(a),whichisageneralizationoftheKeplerformula-tiondiscussedalready.Theforcelawisassumedtobeanattractive

76November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0260OneHundredPhysicsVisualizationsUsingMATLABpowerlaw,F(r)∼1/rn,whichcompeteswiththerepulsivecentrifu-galinversecubedforce.Therestoringforceforsmallperturbations,r=a+x,followsfromTaylorexpansionsofthecentrifugalforceandtheattractiveforce.TheequationforasmalldisplacementleadstosimpleharmonicmotionasshowninEquation(2.27):d2x/d2t=[L2/r3−1/rn]∼[F(a)(3−n)]x/aω2=(F(a)/a)(3−n)=ω2(3−n)(2.27)oFirst,theperturbationsoncircularorbitsforagivenforcelawareplottedwherethepowerischosenbytheuserviaamenu.Theperturbedorbitfollowsxaroundr=a.Theresultissimpleharmonicmotionforsmallperturbationsforthecasen<3,wheretheunper-turbedcircularfrequencyisω2=F(a)/a.Onlytheinversesquarelaw,n=2,hasclosedorbitswhichrepeat,asmentionedpreviously.Theperturbedorbitforn=1isshowninFigure2.40.NotethatFigure2.40:Perturbedorbitinthecaseofa1/rforcelaw.

77November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch022.ClassicalMechanics61theperturbationdoesnotclosewiththebasicorbitalfrequency.ThescriptusestheMATLABfunction“ode45”tocomputethetrajectorynumerically.Therefore,anyfailuretocloseasolarorbitmeansthatgravityisnotapureinversesquareforcelaw,contradictingNewton.Indeed,thiswasknownforMercury(theadvanceoftheperihelion)andbril-liantlyconfirmedEinstein’sgeneraltheoryofrelativity(GR).Thattheorypredictedasmall,relativisticadditiontothelawofgravitywithaninversefourthpower.Theshortrangeoftheadditionalforcemeantthattheeffectwaslargeonlyforplanetsatsmallorbitalradii.Theuserhasachoiceoftheamountofaddedforceandtheresult-ingorbitforacoefficientof0.2isshowninFigure2.41,whiletheFigure2.41:Advancingperihelionfora20%additionofaninversefourthpowerforce.

78November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0262OneHundredPhysicsVisualizationsUsingMATLABFigure2.42:Perturbedorbitforthreecircularperiodsshowingtheadvanceoftheperihelionwithtime.advancingperihelionisshownmoregraphicallyinFigure2.42fornumericalintegrationofthreeorbits.Notethattheeffectisvastlyexaggeratedforvisualpurposes.Theactualadvanceisonly43sec-ondsofarcpercenturyforMercury.

79November20,20139:189inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0363Chapter3Electromagnetism“Littleyouknowthesubtleelectricfirethatforyoursakeisplayingwithinme.”—WaltWhitman“Itwaslikebouncingtennisballsoffamysterypieceoffurnitureanddeducing,fromthedirectioninwhichtheballsricocheted,whetheritwasachairoratableoraWelshdresser.”—MarcusChownTherearemanypossiblecandidatesfornumericalresultsinelectro-magnetism.Thefirstexercisesshownhereareintherealmofstaticswhicharethenfollowedbydynamicaldemonstrations.Inthissection,thesymbolEdenotestheelectricfield,whileinothersEdenotesthenon-relativistictotalenergyortherelativistictotalmass-energy.Thereaderwillbewarnedabouttheseunfortunate,butcustomary,changesofnotation.3.1.ElectricPotentialforPointChargesTheanalyticsolutionforapointchargeiswellknown.Sinceelectro-magnetismisalineartheory,thefieldandpotentialforacollectionofpointchargesfollowsbysuperpositionofthepointchargesolution.Thesuppliedscriptis“PointElecStatic”,whichfindsthepotentialforasetofchargeswhichareusersuppliedgiving(x,y)positionsandindividualcharges.TheelectricfieldisderivedfromthepotentialusingtheMATLAButility“gradient”.Theresultsforadipoleconfigurationof[xyq]=[−100200]and[100−200]areshownforthepotentialinFigure3.1andforthexcomponentofthefieldinFigure3.2.

80November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0364OneHundredPhysicsVisualizationsUsingMATLABFigure3.1:PlotofthedipolepotentialusingtheMATLABfunction“meshc”whichdisplaysboththevaluesofthepotentialandtheequipotentialcontours.Thetypicaldipolepatternofthecontoursisevident.Figure3.2:FieldcomponentExforthedipoleconfiguration.Thedipolefieldbetweenthetwochargesisevidentlylarge,asistherapidfalloffwithdistancerfromtheorigin.

81November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch033.Electromagnetism65AscanbeseenfromFigure3.2,thefieldExisstrongestbetweenthetwochargesandthenfallsoffrapidlyasthedistancetotheobservationpointincreases.3.2.ImageChargeforaGroundedSphereTherearemanywaystosolveboundaryvalueproblemsinelectro-magnetism.Onemethodistoplaceanimagechargewhichprovidestheproperboundaryconditions;forexample,thevanishingoftheelectricfieldparalleltoaconductorsurface.Asimpleexampleofthistechniqueistolookataninfinitegroundedplane.Theboundaryconditionsforapointchargeplacedneartheplanearesatisfiedbycreatingan“imagecharge”ofthesamemagnitude,butdifferentsignplacedinavirtuallocationbehindtheplaneatthesamedistancefromtheplaneasthepointcharge.Thatchoicemakestheplaneanequipotentialandtheelectricfieldnormalattheplane.Inthespecialcaseofagroundedsphereofradiusaundertheinfluenceofanexternalcharge,q,placedatz=c,theimagecharge,qi,andimagelocation,zi,are;qi=−aq/cz=a2/c(3.1)iThisconfigurationinducesachargedensityonthespherewhichfollowsfromtherequirementthatthefieldhasonlyanormalcom-ponentattheradiusa.Forthenumericalcasewherea=q=1,thescript“ImageChargeSphere2”asksforazlocationofthecharge.A“movie”forthepotentialandthefieldisthenshownforimagechargesatimagelocationsfromz=0.1to0.9.Theusercanthenwatchtheboundaryconditionsapproachthesolution.Theplotsforanimagelocationofz=0.7areshowninFigure3.3.Theequipoten-tial,inblue,isclosetothelocusofthecircle,showningreen.Theexternalandinternal(image)chargesareindicatedbyared∗.Theelectricfieldatthatimagechargelocationisalmostnormaltothesphereasseenintheplotontheright.TheinducedchargedensityisshowninFigure3.4forseveralchoicesofchargelocation,z=c.Theinducedchargeasafunctionof

82November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0366OneHundredPhysicsVisualizationsUsingMATLABFigure3.3:Equipotentialcontours(left)andelectricfield(right)foranexternalchargelocatedatz=1.4andwithimagechargeatz=0.7foraspherewithradius1.Figure3.4:Inducedsurfacechargedensityasafunctionoftheobservationanglewithrespecttotheexternalchargelocatedatz=cforseveralvaluesofc/a,varyingfrom1.4to5.

83November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch033.Electromagnetism67angleforcaseswherec/avariesfrom1.4to5indicateshowstronglytheresultdependsonthatratio.Thechargescaleislogarithmic.Thescriptprovidesseveralchoicesofctoshowthedependence.Alsointhescript“ImageChSphere2”,theusermenuallowsforanychoiceofcinordertoexploreothervalues.3.3.MagneticCurrentLoopAnotherstaticexamplecomesfrommagnetostatics,inthiscasethemagneticfieldofacurrentloop.Atdistancesmuchgreaterthanthesizeofthecurrentloop,thefieldapproachesdipolebehaviorandfallsastheinversecubeoftheradius.Theexactsolutionsatanydistanceareellipticintegrals,which,althoughtheyareavailableinMATLAB,addlittletotheintuitionfortheproblemwhichistobebuiltup.Becauseofthat,thesolutionisachievednumerically.Thescripttodisplaythemagneticfieldsfarfromtheloopiscon-tainedin“CurrentLoop”.TheprintoutfromthatexerciseisshowninFigure3.5.Thefieldisexpectedatlargevaluesofr/a,whereaistheloopradius,togoas:B→cosθ/r3rB→sinθ/r3(3.2)θFigure3.5:Printoutforthecurrentloopdemonstrationwhichdefinesthecoor-dinatesofthedemonstration.Thefieldhasbothradialandangularcomponents.Thatreflectsthefactthattherearenomagnetic“charges”sothatthefieldmustalwayscloseonitself.

84November20,20139:189inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0368OneHundredPhysicsVisualizationsUsingMATLABTheproducedfield,plottedasafunctionofcoordinatesscaledtotheloopradius,isplottedfortheradialcomponentinFigure3.6.Atlarger/a,theenhancementoftheradialfieldinthezdirection,expectedfromthebehaviorshowninEquation(3.2),isevident.Thepolaranglemagneticfieldisalsocalculatedanddisplayedfortheusertoinspect.Figure3.6:Radialmagneticfieldforacurrentloopintheapproximationthatra.Thecontoursdisplaytherapidfalloffofthefieldwithrandthedipoleenhancementatlargerz/avalues.ThecompletesolutionismosteasilyapproachedusingtheBiot-Savertlawwhichrelatesthedifferentialsourcecurrenttothediffer-entialfieldincrement:dB∼(dxxdr)/r3(3.3)Thecurrentelementislocatedatx,whileristhevectorfromthelocationofthecurrenttothepointwherethefieldisevaluated.Integratingoverallsourcepointsofthefieldinthecaseofthecurrentloop,thezfieldisshowninFigure3.7.Farfromthecurrentloopthefieldapproachesadipolepattern.Theintegralcanbedoneexplicitly

85November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch033.Electromagnetism69Figure3.7:Contourofthezfieldasafunctionofxandz.Theloophasradius=1.Theevolutiontoadipolefieldatlargezvaluesisevident.andtheexactsolutionappearsinthescript.Itiscumbersomeandwillnotbegiveninthistext.3.4.HelmholtzCoilHavingsolvedtheproblemofacurrentloopatzequaltozero,itisfairlysimpletoextendthesolutiontolocationsatnon-zerovaluesofz.Theresultistheanalogueofsuperimposingelectricpointchargesolutions.Thesimplestcaseisthatoftwocurrentloopswithcurrentflowsuchastoreinforcethefieldbetweentheloops.Thescriptis“HelmholtzCoil”.Theuserchoosesthedistancebetweentheloops,wheretheradiusistakentobeequaltoone.Thefieldcontoursarereturnedforthatchoice.Comparethecontoursoftwoloopstooneloop.Thecoilsareusedtoprovideareasonablyconstantfieldbetweentheloopsoverareasonablylargefieldvolume.ThecontourplotforBzappearsinFigure3.8,whilethesurfaceplotisshowninFigure3.9.

86November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0370OneHundredPhysicsVisualizationsUsingMATLABFigure3.8:ContourplotforBzduetotwocurrentloopsseparatedbyadistanceequaltotheirradius.Figure3.9:SurfacemeshplotforthefieldcontoursshowninFigure3.8.Notethataregionofroughlyconstantfieldbetweenthecurrentloopshasbeenestab-lished.

87November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch033.Electromagnetism713.5.MagneticShieldingItiswellknownthatshieldingfromelectricfieldsispossibleinthestaticcaseforaninteriorvolume,byusinggroundedandclosedcon-ductors(Section3.1).Forhighfrequencies,theskindepthingoodconductorsisquitesmallsothattimevaryingelectricfieldscanalsobeeffectivelyshieldedagainst,asaglanceatyourmicrowavewindowconfirmswithitsmeshofthinmetallicshielding.Whataboutmagneticfields?Itisimportanttoshieldobjectslikecompassesfromstrayfields.Consideraprototypeshieldconsistingofathinshellofhighmagneticpermeabilitymetalofinnerradiusaandouterradiusbimmersedinamagneticfield,Bo,directedalongthezaxis.Thisproblemcanbesolvedbyusingstandardmethodsinmag-netostaticsbyexpandinginpowersoftheLegendrepolynomials.Infact,onlythefirstpowerofthecosineofthepolarangleisneeded,andradialfactorsgoinglinearlywithrandastheinversesquareofraretheonlyonesneeded.Themagneticpotentials,Φare:Φ=−Brcosθ+(α/r2)cosθoutoΦin=δrcosθΦ=βrcosθ+(γ/r2)cosθ(3.4)µwhere“out”referstor>b,“in”referstor

88November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0372OneHundredPhysicsVisualizationsUsingMATLABFigure3.10:Potentialforametallicsphereimmersedinauniformmagneticfieldorientedalongthezaxisforb/a=1.2andµ=10.Toderivethefields,theMATLABfunction“gradient”isusedagainbut,inaddition,theMATLABdisplaytool“quiver”letstheuserobservethemagnitudeanddirectionofthefieldasindicatedbyarrowshavingbothlengthandorientation.ThefieldsaredisplayedinFigure3.11.Thickershieldingorshieldingmaterialswithlargerpermeabilityreducesthefields.ThiseffectisshowninFigure3.12forthesamegeometry,b/a=1.2,butwithapermeabilityof100inthiscase.Thefieldisreducedapproximatelytenfold,asexpected.3.6.PotentialsandComplexVariablesTwo-dimensionalpotentialproblemscanalsobesolvedusingcom-plexvariabletechniques.Intwodimensions,anyanalyticfunctionofthecomplexvariable,z,willsatisfytheLaplaceequationforboththerealandtheimaginarypartsofthefunction.Therefore,knowingtheresultinasimplecaseandfindingtheappropriatetransformation,onecanfindthesolutioninthemorecomplexgeometricsituationspecifiedbythetransformation.

89November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch033.Electromagnetism73Figure3.11:MagneticfieldsforthepotentialshowninFigure3.10isreduced.Theinteriorfieldismuchattenuated.Figure3.12:PotentialforthegeometryofFigure3.10butwithapermeabilitytentimeslarger.Theshellboundariesareshowninredandgreen.

90November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0374OneHundredPhysicsVisualizationsUsingMATLABSeveralexamplesareprovidedbythescript“Laplacez”.Theuserhasfivedifferenttransformationstochoosefrom.Ineachcase,thepotentialcontours,thexandyfields,foundusingthe“gradi-ent”tool,andthe“quiver”plotofthefieldsintwodimensionsaresupplied.ThedialogueisshownforallfivechoicesinFigure3.13.Figure3.13:Printoutof“Laplacez”forausermakingallfivechoicessequen-tially.Aplotofthefieldsforachargeatx=0andy=−0.5,withagroundedconductoraty=0isdisplayedinFigure3.14.Theupperhalfplanehasnofield,andthefieldisperpendiculartothegroundedplaneaty=0.Thefieldsinthecaseofconductorsatr=1,wherethevoltageisVfory>0onthecircleand−Vfory<0areshowninFigure3.15.Onlytheinternalfieldsareplotted.Thefieldsareclearlystrongestatthey=0boundarywherethevoltagegradientislargest.Asalastexample,theequipotentialsintheupperhalfplaneforthecaseoflinechargesonthexaxiswithV=0forx<0andy=0andV=1/2forx>0andy=0aregiveninFigure3.16.Thefieldpeaksatx=0wherethevoltagegradientislargest.3.7.NumericalSolution—LaplaceEquationMorecomplextopologiesthanthosegiveninthelastsectioncanbesolvednumerically.ACartesianversionofthesolutionintwodimensionsissuppliedby“EMLaplaceTest2”.MATLABhastools

91November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch033.Electromagnetism75Figure3.14:Equipotentialsinthecaseofachargeinthelowerhalfplaneat(0,−0.5)andagroundedconductoraty=0.Figure3.15:InteriorfieldsforthecaseofahalfcircleatpotentialVfory>0and−Vfory<0.

92November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0376OneHundredPhysicsVisualizationsUsingMATLABFigure3.16:EquipotentialsinthecasewhereV=0aty=0andx<0andV=1/2fory=0andx>0.tosolveone-dimensional,partialdifferentialequations,buthigherdimensionalityproblemswithspecifiedboundaryconditionsarenotyetavailable.ThescriptwhichisavailableusestheGauss-Seidelmethod,givenexplicitlyintheprintout,tosolveatwodimensionalproblemonagridofpoints.TheexpressiongivenintheprintoutissimplythefinitedifferenceexpressionforthevanishingofthesecondpartialderivativeinxandyonaCartesiangrid.Theuserdialogueasksforthegridsizeandthenthevoltagesonthefourboundarysurfacesofthesquare.Theboundaryvaluesmaybeconstantsorfunctionsofxory,dependingontheboundary.Anexampleshownhereisfora25×25gridwithvoltagesontheleft,right,topandbottomasdefinedintheprintoutgiveninFigure3.17.Thebasicfinitedifferencegridcomputationofthesolu-tionalsoappearsintheprintout.ThewholegridisiteratedtentimesusingtheGauss-Seidelmethod.Thescriptreturnsthepotential,thexandyfields,usingthe“gradient”tool,andthe“quiver”plotofthecombinedvectorelectricfield.ThepotentialfortheexampleaboveappearsinFigure3.18,thefieldsinFigure3.19.

93November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch033.Electromagnetism77Figure3.17:Printoutofthedialogueandinputfor“EMLaplaceTest”.Figure3.18:Theinteriorsolutionforthepotentialdefinedbytheboundaryvaluesinputintheexampleabove,Figure3.17.3.8.NumericalSolution—PoissonEquationTheLaplaceequationtreatedinthelastsectionholdsintheabsenceofsourcesofthefield.ThePoissonequation,Equation(3.5),appliesinthecasewherethesolutionisdefinedbyactualsources,ratherthan

94November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0378OneHundredPhysicsVisualizationsUsingMATLABFigure3.19:xandyelectricfieldsforthepotentialshowninFigure3.18.fixedboundaryconditionsenclosingaspacewithoutanysources.ThesolutionforthepotentialΦis,rather,definedbythelocationandstrengthofthesourcesasdefinedbythechargedensityρwhichexistsintheinteriorspace.∇2Φ=ρ(3.5)ThenumericalsolutionintwoCartesiandimensionsisencap-sulatedin“EMPoissonTest”whichwrapstheMATLABtoolsforfastFouriertransforms,“FFT”,“fft2”and“ifft2”.TheGauss-Seidelmethodcouldbeusedwithasimpleextension,butthemethodadoptedhereusesfastFouriertransforms,becausescriptforthemisavailableinMATLAB.Thesetoolsallowthepotentialtobesolvedfor,Equation(3.6),inthetransformedspacewherethechargeden-sityistransformedusing“fft2”.TheFouriertransformofthepoten-tialistheninvertedbacktotheoriginalspaceatthefixedgridpointsusing“ifft2”.Thegridspacingisδandthenumberofgridpoints,assumingasquaregrid,isN2.Notethatheretheboundaryconditionsonthespacerequirethepotentialtovanish,sothattheboundariesshouldbefarenoughawayfromtheinteriorsourcesso

95November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch033.Electromagnetism79asnottoundulyinfluencethepotentialnearthem.ΦFT=ρFTδ2/[2(cosx+cosy−2)]i,ji,jijxi=2πi/N,yi=2πj/N(3.6)Thedialoguewiththeuserintheexampleofamodelofacapac-itorisshowninFigure3.20.Figure3.20:Dialogueforanexampleoftheuseof“EMPoissonTest”forthecapacitormodel.Theresultingplotsarethepotential,thexandyelectricfieldsandthe“quiver”displayofthevectorelectricfield.ThevoltagepotentialappearsinFigure3.21.Therapidgradientbetweentheplatesofthecapacitorisclearlyevidentasarethenon-zerovaluesofthefieldsoutsidetheregionsbetweentheplates.TheelectricvectorfieldderivedfromthesolutionshowninFigure3.21appearsinFigure3.22.Thestrongfieldbetweenthecapacitorplatesisamajorfeatureasarethefringefieldsattheendsoftheplatesandtherapidfalloffatlargedistancesfromthecenteroftheobject.3.9.LightPressureandSolarSailingLightexertspressureasthephotonscollideandtransfermomentumtothestruckobject.Understandingthesephenomena,sciencefiction

96November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0380OneHundredPhysicsVisualizationsUsingMATLABFigure3.21:VoltagedistributionforthecapacitorexampleusingthenumericalPoissonequationsolver.Theplatelocationsareindicatedbyredsquares.Figure3.22:Electricfieldforthecapacitorexample.Thefieldisstrongbetweentheplates,asexpected.Theplatesareconstructedusingredgridsizedpixels.

97November20,20139:189inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch033.Electromagnetism81writershavecreatedtheideaofsolarsailingwithinthesolarsystemandforexplorationtonearbystars.SolarsailshaveactuallybeendeployedinspacebyU.S.fundingagencies.Hereisanideawhosetimehascome.Thepressure,p,forperfectreflectionduetoapointsourceatdistancerwithluminosityLis:p=(2L/c)/4πr2(3.7)Thebasicequationofmotionfollowsfromtheexpressionforlightpressureandthecompetingattractionofthesun.Ifasmallpayloadisignored,theaccelerationdependsontheluminosityofthesun,Lo,thedistance,r,fromthesun,thedensity,ρ,andthickness,d,ofthesolarsail.Withafinitepayload,theexpressionismodifiedbythereplacement,ρd→ρd+mp/AswherempisthepayloadmassandAsisthesailarea.d2r/d2t=[2L/(4πcρd)−GM]/r2(3.8)oTheaccelerationneededforastellarvoyagemustovercomethepullofgravityfromthesun,withamass,M,andpropela“sail”.Theaccelerationdoesnotdependonthesizeofthe“sail”,butpayloadconsiderationsargueforalargeconstructionoflightmaterial,suchasverythinMylar.Perfectreflectionisassumed.Theaccelerationdoesnotdependontheareaofthesail,onlydensityandthickness,andvariesinverselywiththesquareofthedistancefromtheSun.Thescriptis“SolarSail2”andtheprintoutofauserdialogueisshowninFigure3.23.Thespecificsailissufficientlylightandthintoovercometheaccelerationofthesun.Ifitisnot,thesailwillfallintothesunandthe“ode45”codewillgenerateerrors.Theequationisnotsolvableexplicitly,so“ode45”isusedinthescripttoprovideanumericalresult.Theaccelerationfallsoffrapidlywithradius,whichmeansthevelocitybuildsupquickly.Theapproximatetimetogofivelightyearsis52,900yearswithasmallpayloadof314kg.Notethatalaunchclosertothesunisbetter.Atastartingradiusof0.01AU,thesametriptakesonly5244years,againofafactoroften.Theuserisencouragedtotrydifferentlaunchpositions,sailareas,thicknessesofMylarsail,andpayloads.ThevelocitybuildsupquicklyoverthefirstyearinthisexampleasseeninFigure3.24.Aftertenyears,

98November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0382OneHundredPhysicsVisualizationsUsingMATLABFigure3.23:Dialogueforaparticularsailandlaunchposition.Figure3.24:Velocityasafunctionoftimeforthefirstyearafterthelaunchofasolarsailfromaninitialpositionat1.0AUasdefinedinFigure3.23.

99November20,20139:189inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch033.Electromagnetism83theshipisat58AUandgoing28km/sec.Theshiphasattainedescapevelocitylessthanoneyearafterthelaunch.Thisbehaviorisdifferentfromthatofarocketwhichquicklyattainsitsfinalvelocity,asdiscussedpreviously.3.10.MotioninElectricandMagneticFieldsTocontinuewiththedynamics,motionincombinedmagneticandelectricfieldsbychargedparticlesisexplored.Thescriptwhichisusedis“ExBODENR”.Themotionisassumedtobenon-relativisticandtheLorentzforceequationisintegratednumericallyusingtheMATLAB“ode45”tool.Unitswithcharge,q,andmass,m,equaltooneareused.Theinitialpositionisatx=y=z=0.Theinitialvelocityisinputbytheuserasisthemagneticfieldmag-nitude,assumedtobeorientedalongthezaxisandthex,y,andzcomponentsoftheelectricfield.TheLorentzforceequationsare:d2x/d2t=q/m[E+(dx/dt)xB](3.9)Thetrajectoryinthreedimensionsisprovidedbythescript.Therearefourplotswhichareproduced.Thefirstisthex,y,andzvelocityasafunctionoftime,thesecondisthexvsyvelocityandthethirdisthex,yandzpositionasafunctionoftime.Finally,thefourthisaplotofthe(x,y)position,whereamovieofthetimedevelopmentof(x,y)isalsoshowninordertogetafeelingaboutthevelocitiesinthexandydirectionsforthespecifiedsetupoffieldsandinitialvelocities.TheresultsforanexamplewithE=[100],B=1andv=[111]areshowninFigures3.25,3.26and3.27.Theelectricfieldhereisonlyalongx,sothatthevelocityalongz(themagneticfielddirection)isconstant.Thevelocitiesinthe(x,y)planerotateduetothemagneticfield,withanincreasingvelocityalongthexdirectionduetotheelectricfield,asobservedinFigure3.25.Theusercanalsolookatthespecialcaseswherethereisonlyanelectricfieldoramagneticfield.Anotherpossibilityistovarytheinitialvelocityconditions.

100November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0384OneHundredPhysicsVisualizationsUsingMATLABFigure3.25:Thethreevelocitycomponentsasafunctionoftime.Thezcompo-nentofvelocityisconstantbecausethemagneticforceisabsentinthisdirectionandthereisnoelectricfieldalongzinthisexample.Figure3.26:Thethreepositioncomponentsasafunctionoftime.Thebasiccircularmotionofthexandypositionsisevident.

101November20,20139:189inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch033.Electromagnetism85Figure3.27:Movieframesofthetrajectoryof(x,y)asitevolvesintime.Becauseofthemagneticfield,theparticletendstohaveacircular(x,y)trajectorywithaconstantradiusinthisnon-relativisticcase.Thecompletelyrelativisticcasewillbetreatedinadistinctscripttobeexploredlaterinthetext.Inthepresentcase,theLarmorfrequencyforcircularmotiondoesnotdependonthemomentum,andisω=qB/m.3.11.TheCyclotronThecyclotronisadevicetoacceleratechargedparticlesinelectricandmagneticfields.Themagneticfieldcausestheparticletorotateinacircularorbitwithanangularfrequency,ω,andradius,r.Fornon-relativisticparticles,thefrequencydependsonlyonthemag-neticfield,thechargeandthemassoftheparticle.Forprotons,itis95.5MHzforafieldof1Tor10kG.Astheenergyincreases,theradiusincreasesproportionaltothevelocityperpendiculartothemagneticfield,vT.ω=qB/mr=vT/ω(3.10)

102November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0386OneHundredPhysicsVisualizationsUsingMATLABAschematicofacyclotronappearsinFigure3.28.ThemagneticfieldissuppliedbyHelmholtzcoilswhicharenotshownbutwhichmakeafieldperpendiculartotheplaneofthefigure.Thetwohalfcircles,called“dees,”arecharged+and−soastoacceleratetheprotons.However,itiscleartheyneedtobereversedinpolarityforeachhalfrevolution,atthefrequencyquotedabove.Figure3.28:Endofthemovieforachargedparticleinacyclotronwith10halfrevolutionsandwithanenergykickof0.3ateachcrossingofthe“dees”.Amovieisprovidedbythescript“Cyclotron”oftheprotonpathaftertheuserchoosesthenumberofhalfrevolutionsandtheenergykicksuppliedbytheelectricfield.Thelastframeofthemovieforaspecificchoice,10halfcirclesandakickof0.3isgiveninFigure3.28.Theincreasingradiusandvelocitywithtimeareveryclear.Obviously,higherenergyparticlesrequirelargerandmoreexpensivedevices.Indeedthatfacthistoricallylimitedtheenergiesofbeamsacceleratedbycyclotrons.Afewnumbersareinstructive.Toachieveavelocityof0.1thatoflightforaproton,oraprotonkineticenergyof4.7MeVrequirestheradiusofthecyclotrontobe0.31m.Ingeneral,theradiusneeded

103November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch033.Electromagnetism87isr=10.4×10−9(vT/B)whererisinm,transversevelocityisinm/secandBisinTesla.3.12.DipoleRadiationThestaticdipoleelectricfieldhasalreadyappearedinEqua-tion(3.2).Inthedynamiccase,acceleratedchargescreateelectricandmagneticfieldsthatfallastheinverseoftheradiusratherthantheinversecubeoftheradius.Sincethefluxofenergythroughasurfacethengoesasthesquareoftheradius,radiativesolutionscarryingconstantfluxoverasurfaceofarbitrarysizearepossible.ThatrealizationwasthegreatdiscoveryofMaxwell,alongwithmanyothermajorcontributionstomanyareasofphysics.Thelowestordermultipoleisthedipole,calleddhere.Thisorderispossiblebecauseelectromagnetismhasbothpositiveandnegativecharges.Bycontrastgravityhasaquadrupolemomentasthelow-estmultipolebecausegravityisalwaysattractive.Thefieldscanbeexpandedintermsofthewavenumber,k,andtheradiusasshowninEquation(3.11).Er3=d(2z/r)(1−ikr)eikrrEr3=d(x/r)[1−ikr−(kr)2]eikr(3.11)θAtsmallvaluesofkrthesolutionsfortheelectricfieldsapproachthestaticdipolecase,wheredisthedipolemomentofthechargedistributionwhichishereorientedalongthezaxis.However,atlargevaluesofkr,thestatictermshavefallenrapidlywithrandtheonlyremainingtermhasatransversequality.Theradialfieldhasanearzonestaticpieceandapiecethatfallsasthesquareoftheradius.Thetransversefiledhasastaticpiecegoingastheinversecubeoftheradius,anintermediatepieceandaradiativepiecethatfallsonlyastheinverseoftheradius,.Thefields,giveninEquation(3.11)areevaluatedinthescript“EMDipoleRad”.Theyareplottedassurfacesasafunctionofkxandkzsothatthestaticnearzone,kr1andtheradiativefarzone,kr1canbothbeobserved.ThesurfaceforthetransverseradiativefieldisshowninFigure3.29.Thesmallkxandkzregions

104November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0388OneHundredPhysicsVisualizationsUsingMATLABFigure3.29:Contoursforthetransversethetafield,Eθ,asafunctionofkxandkz.Thestaticregionisatsmallkr,whiletheradiativebehaviordominatesatlargekr.shouldbecomparedtothestaticcontoursdisplayedinFigure3.6.ThesurfacefortheradialfieldisshowninFigure3.30.Inthisfiguretheregionr<1issettozerofieldforthepurposesofabetterdisplayofthelargerregions.Theradialfieldfallsoffrapidlyandisessentiallythestaticfield.Bothfieldsaremultipliedbyrsothatintheregionoflargertheradialfieldfallsas1/rwhilethetransversefieldapproachesaconstantinr.InFigure3.29itisevidentthattheradiativebehaviorbecomesstrongwhenkr>1andthattheradiativepartofthewaveistrans-versetothewavevectork.ThefieldapproachesEθ→dsinθ(k2/r).Themagnitudeofthefieldisproportionaltotheaccelerationofthechargedistribution,a,wherea∼ω2,sothattheradiatedpowergoesasthefourthpoweroftheoscillationfrequency.Theenergyfluxthroughaspheresurroundingthesourceisindependentofradiuswhichindicatesaradiativesolution,4πr2E2∼4π(dsinθk2)2.θTheseconsiderationscanbeappliedtothesituationwherelowenergyphotonsarescatteredbyelectronsinmaterials.Theincident

105November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch033.Electromagnetism89Figure3.30:Radialelectricfieldofanoscillatingdipole.Theregionr<1hasbeensettozero.lighthasatransverseelectricfieldwhichacceleratestheelectronsanddrivestheirmotionwiththefrequencyoftheincominglight.Theelectronsradiatephotonswiththesamefrequencyandthesephotonsare,inturn,transversetotheacceleration.Therefore,theradiationispreferentiallyemittedinthedirectionoftheincidentlight,bothforwardandbackward.Indeed,theangulardistribution,showninEquation(3.12)isenhancedinthedirectionoftheincidentlightwhichisheretakentobethezaxis.TheprocessiscalledThompsonscattering.dσ/dΩ∼(1+cos2θ)(3.12)Thisbehaviorhasimportantpracticalimplications,sincewhenradiowavesbounceoffobstacles,iftheychangedfrequency,tuningbylockingtoaspecificfrequencywouldbeimpossible.

106November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0490Chapter4WavesandOptics“Classificationslike‘optics’or‘thermodynamics’arejuststraitjackets,preventingphysicistsfromseeingcountlessintersections.”—TedChiang“OfNewtonwithhisprism...amindforevervoyagingthroughstrangeseasofthought,alone.”—WilliamWordsworthTheelectromagneticfieldshavewavesolutionsasindicatedattheendofthelastsection.However,therearemanyothercasesofwavephenomena,sothataseparatesectionisnowdevotedtogeneralwavebehavior.Therearetwobasicregimes;oneisthatofgeometricopticswhichobtainswhenthediffractionoflightraysissmall.Thatregimeexistswhenthesizeoftheobjectsbeingilluminatedismuchlargerthanthewavelengthofthewavethatscattersofftheobject.Wedailyoperateinsucharegimebecausevisiblelightcontainswavelengthsofafewthousandangstromswhichismuchsmallerthanmacroscopic,everydayobjects.Theotherregimeisthatofwaveopticswhere,forexample,diffractionisimportant.Thissectionstartswithwaveopticsandthenlooksatafewexamplesfromgeometricopticswherelightisassumedtomoveinastraightlineanddiffractioncanbeneglected.4.1.AddingWavesAmonochromaticwaveischaracterizedbyanamplitude,afrequencyandaphase.Twowavescanexhibitinterferencewhencombined.Ascriptcalled“OscAddWaves”looksataddingtwowaves.Theinitialprintoutdefinestheparametersofthewavesinquestion,asseeninFigure4.1.Sincekishereusedforwavenumber,itnolonger

107November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch044.WavesandOptics91Figure4.1:Initialprintoutforthecaseofaddingtwoplanewaves.representsthespringconstant,alsocalledk.Thecircularfrequencyofthewaveisωo.AspecificuserdefinedinputisshowninFigure4.1.First,theintensityofthesumoftheamplitudesforaspecificamplituderatioisshownasafunctionofthephasebetweentheamplitudes,whichillustratesconstructiveanddestructiveinterference.Thesecondpartofthescriptshowstheresultofaddingwaveswiththesameampli-tudebutwithdifferentfrequencies.Thereare20examplesshownasamoviesequenceandthe“beat”frequenciesbuildupasthediffer-enceinfrequenciesincreases.Thelastplot,withafrequencyratiooftwenty,isshowninFigure4.2.Thebeatfrequencygivestheoverallmodulatingbehaviortotherapidoscillationswiththesumofthefre-quencies.Itisinstructivefortheusertoseethewaythebeatsbuildupwithfrequencydifference.Thephenomenaofbeatfrequenciesisfamiliarinmusic,forexample.4.2.DampedandDrivenOscillationsAfirstlookwastakenatdampedanddrivenoscillationinthepre-vioussectiononclassicalmechanics.Thescript“OscDamped”goesabitdeeper,partlybecausethephenomenaoccursinmanyareasofphysicsandengineering.Therearetwoseriesofplotswhichareeachshownasafunctionoftimeinmovieframes.Inthefirst,thedialogueisshowninFigure4.3,wherethedifferentialequationisshownandthesolutionintheunderdampedandoverdampedcases

108November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0492OneHundredPhysicsVisualizationsUsingMATLABFigure4.2:Addingtwowaveswithalargedifferenceintheirfrequencies.Therearerapidvariationsathighfrequenciesandanenvelopeofslowermodulationsofthesumofthewaves.Figure4.3:Printoutfromthe“OscDamped”scriptwhichshowsthedifferentialequationandthetwopossiblesolutions.isdefined.TheMATLABscript“dsolve”isusedtosolvetheproblemsymbolically.ThewaveformforthelightlydampedcaseofD=0.12isshowninFigure4.4.ThedampingparametersDanddaredefinedinFigure4.3.Thewavegoesthroughseveraloscillationswithout

109November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch044.WavesandOptics93Figure4.4:WaveformforthedampedoscillationcaseofD=0.12.losingasignificantfractionofitsamplitude.Forheavierdampingtheoscillationiswashedout.Foradrivenanddampedoscillator,theexactsolutionwasshownpreviouslyinSection2.Inthepresentcase,onlytheresonantBreit-Wignershapeisplotted.Itisthesteadystatesolutionafterallthetransientshavediedoff.Ingeneral,forasystemwithanatural,un-dampedfrequencyofωoandadampingfactord,thefullwidthoftheresonantresponseathalfmaximum(FWHM)isapproximately2d.TheamplitudeisshownforthesteadystatesolutioninEqua-tion(4.1).TheFWHMoftheintensityIis2d.ThewaveamplitudeisA,withI=|A|2.Theresonantshapewhichobtainsatlongtimesisdisplayedin20plotswheretheresponseasafunctionoftheexternal,drivingfrequencyisshownfor20differentdampingfactors.ThespecificcaseofD=0.01isshowninFigure4.5.Ingeneral,asthedampingincreases,theamplitudeofthedrivenresponsedropsandthewidthofthefrequencyresponsenearthenaturalfrequencyincreases.Theusershouldfindthevariationsintheresponseofthedampedoscillatoramusing.Itcanbeimaginedthatapoorlydampedsystemmight

110November20,20139:199inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0494OneHundredPhysicsVisualizationsUsingMATLABFigure4.5:ResonantresponseofadrivenoscillatorinthedampingcaseD=0.01asafunctionoftheexternaldrivingfrequency.beheavilydamagedbyadrivingforcewithafrequencynearthatofthenaturalfrequencyoftheobject.Indeed,theVerrazanobridgecollapseisaclassicalexample.A=1/(ωe2−ωo2)+(2dωe)2A∼1/(ωo−ωe)2+d2I=|A|2,FWHM∼2d(4.1)4.3.APluckedStringAwaveequationforastringwithboundaryconditionsthatitisheldattwoendsleadstotheexistenceofonlydiscretefrequencieswhichareallowedforthestringmotion.Thus,theproblemcanbeeasilytreatedbyusingtheFourierseries.Infact,thesquarewaveandtriangularwaveFourierseriessolutionswerealreadyusedinthesectiononsymbolicmath.Inthescript,“StringPluck”,thecaseofastring,initiallytriangularinshape,isdisplayedasamovie,whereaFourierserieswithfortytermsisusedtodisplaythesubsequent

111November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch044.WavesandOptics95motionofthestring.TheFourierexpansionis:y=bisin(ωit)sin(iπx/L)iωi=ivπ/L,v=T/ρ(4.2)Thestringlengthis,L,andthewavevelocity,v,isdeterminedbythestringtension,T,andstringdensity,ρ.Thediscretefrequenciesarelabeledbytheinteger,i.Oneofthestring“snapshots”isshowninFigure4.6.Thebound-aryconditionsareimposedbythechoiceofdiscretefrequencies.Manyfrequencycomponentscontributetothemotionandthewavebeginstopropagatetothefixedboundarieswherethewavereflectsofftheendpoints.Figure4.6:Asnapshotoftheevolutionofthepluckedstringwhenthestringisassumedtobeinitiallytriangular.Inthiscase,thestringmovesbothleftandright,thewaveformwidensandtheendsofthestringarefixed.Theuseristhenaskedtoprovidethewidthofasquarewaveandamovieofthesubsequentmotionisprovided.Ifavelocityof

112November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0496OneHundredPhysicsVisualizationsUsingMATLABthestringofoneischosenwithahalfwidthofthesquarewaveof0.2,asnapshotofthesubsequentmotionappearsasanexampleinFigure4.7.Theinitialshapepropagateswithoutdissipation(byassumption),isreflectedoffthefixedendpointsandevolvesasshowninthe“movie”whichisprovided.Clearly,thisproblemcouldbeextendedtotwodimensionsinCartesiancoordinates.Thereaderisencouragedtotrythat.Figure4.7:Squarewavestringamplitudeevolutionatatime“snapshot”priortoreflectionoffthefixedendpointsofthestring.Afullwidthof0.2waschoseninitially.4.4.ACircularDrumThestringinonedimensionhadsolutionswhichweresimplesinfunctionswithwavelengthswhichwereadiscretesetbecauseoftheboundaryconditions.Thisideacanbeextendedtosolvingthewaveequationintwodimensions.Tomakeitsimple,cylindricalcoordi-natesareemployed.ThesolutionsareBesselfunctionsinradius,sinandcosfunctionsinazimuthandsinandcosfunctionsintime.The

113November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch044.WavesandOptics97wavevelocityisv.∂2u/∂2t=v2(∂2u/∂2x+∂2u/∂2y)um,n(r,φ,t)=cos(vλm,nt)Jm(λm,nr)cos(mφ)Jm(λm,na)=0(4.3)Forsimplicitythetandazimuthalfunctionsarespecializedtocosandtheradiusisscaledtoaequaltooneasisthewavevelocityv.Theboundaryconditionsareradial,wheretheBesselfunctionsvanishatr=a.TheMATLABscript,“besselj”,isusedtoevaluatethesolutions.Anymotionofthedrumcanbeexpandedintermsofthesesolutions,aswasthecaseinonedimensionwiththepluckedstringasanexample.Inthiscase,thesolutionsgiveninEquation(4.3)form=0,1,2andn=1,2,3areavailableandamovieofthedrumheadmotionisprovidedtotheuser,whopicksanmandnvalue.TheuserdialogueisshowninFigure4.8.Figure4.8:Dialogueforthescript“DrumModes”withascpecificchoiceofBesselfunctionorderandrootindex.Aframeofthemovieforthecasem=1andn=2isshowninFigure4.9.ThissolutionisnotuniforminazimuthandshowsthatthechoiceofthisradialBesselfunctionisonewithazeroatr=0.TheBesselfunctionoforderzeroisnon-zeroattheorigin.4.5.DiffractionbySlitsandAperturesDiffractionlimitstheabilitytodistinguishobjectsusingawavewithawavelengthcomparabletothesizeofthatobject.Thisis

114November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch0498OneHundredPhysicsVisualizationsUsingMATLABFigure4.9:SurfaceofadrumheadatoneframeofamovieforthemodedefinedbythedialogueofFigure4.8.afundamentallimit,calledthediffractionlimit.Itisthereasonwhyopticalmicroscopesevolvedintoelectronmicroscopes.Itisalsothefundamentalreasonwhytheenergyofparticleacceleratorscontinuestoincrease.Inordertoobservesmallerobjects,thewavelengthofthe“light”usedmustdecreasewhichmeanstheenergyorfrequencymustincrease.Thesimplestproblemisthesingleone-dimensionalslit.Thatproblemisillustratedinthescript“Diffract”whichlooksataone-dimensionalslit,acircularapertureintwodimensionsandadoubleslit.Theintensityofthelightasafunctionofangleafterstrikingaslitinonedimensionwithlightwithawavelengthtwicethesizeoftheslitwidth,d,isshowninFigure4.10.Alsoshownistheresultingintensityforacircularaperturewithawavelengthequaltotwicethediameteroftheaperture.NotethattheMATLABfunction“besselj”isusedtoevaluatethecaseofthecircularaperture.Thecharacter-isticdiffractionpatternisclear.Itiscontainedinanenvelopewhosewidthinangledecreasesastheinversewavelength,orwavenumber,

115November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch044.WavesandOptics99Figure4.10:Diffractionpatternfromasingleslitandfromacircularaper-tureforlightwithwavelengthtwicetheslitwidthortwicethediameteroftheaperture.k=2π/λ,increases.Inordertohaveafixedvalueoftheintensityasthewavenumberincreases,thewavelengthdecreases,andtheslitsizedmustdecreasetokeeptheintensityIconstant.α=πsinθd/λ=kdsinθ/2I=(sinα/α)2(4.4)Forthecaseoftwoslits,thereareinterferenceeffectsbetweenthewavesemittedbythetwoslits.ForthecasewherethesingleslitisasdefinedforFigure4.10,butwiththetwoslitsseparatedbytwentytimesthewavelength,theresultingpatternisgiveninFigure4.11.Thesingleslitdiffractionpatternismodulatedbytheinterferencefromthesecondslit,whichhappensonanangularscaleabouttwentytimessmallerthanthatofthesingleslit.Finally,thescriptshowsaslideshowforasinglecircularaperturediffractionpatternforawidespanofwavelengthsshowinghowthepatternshrinksinangleasthewavenumberkincreases,orthewavelengthdecreases.

116November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch04100OneHundredPhysicsVisualizationsUsingMATLABFigure4.11:Diffractionpatternfromtwoslitsforlightwithawavelengthtwicetheslitwidthandtwentytimestheseparationofthetwoslits.Comparedtoasingleslit,Figure4.10,thereisarapidangularmodulationinthetwoslitcase.4.6.EdgeDiffractionThepreviousexamplesofdiffractionweregivenintheregimewheretheobservationpointisfarfromthediffractingsystemintermsofthecharacteristicsizeofthesystem.ThatistheregimeofFraunhoferdiffraction.Thereisanotherregimewheretheobservationpointisatalocationwithdimensionscomparabletothediffract-ingsystemandthewavelength.ThatiscalledtheregimeofFresneldiffraction.TheproblemofFresneldiffractionforanedgebarrieroraonedimensionalslitoratwodimensionalsquareapertureiscoveredinthescript“Edgediffract”.InordertofindtherelevantFresnelinte-grals,theMATLABtool“mfun”isusedtoaccesstheFresnel“C”and“S”functions.Thistoolwaspreviouslymentionedinthesectiononsymbolicmathematics.Thesefunctionsdependonthevariable:ω=y2/λz(4.5)

117November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch044.WavesandOptics101Theresultforausermenuchoiceofanobservationpoint,z,behindabarrier,y<0,of5timesthewavelength,λisshowninFigure4.12.Theedgediffractsthewaveoveraregionofseveralwavelengths,makingtheshadowofthebarrier,y<0,notasimplestepfunction.Figure4.12:Diffractionpatternforascreeninthelowerhalfplaney<0withthelightobservedatazlocationbehindthescreenwithzequaltofivetimesthewavelengthofthelight.Theusercanchoosetheobservationpointandwhethertolookatasimpleedgescreenoraslitofwidthhcenteredaty=0orasquareaperturecenteredatx=y=0.Theresultforaslitofwidth10andanobservationpointz=5,bothinwavelengthunitsisshowninFig-ure4.13.Thediffractionneartheslitboundariesy=+5andy=−5isquiteevident.Therearealsomaximainthepatternatlocationswith|y|lessthan5.AdiffractionpatternforasquareapertureisshowninFigure4.14.Diffractionisstrongneartheapertureedges.Theuser,afterhavingfinishedhis/herchoices,isshownaslideshowwherethewidthoftheslitisvariedfrom1to20inwavelengthunits,

118November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch04102OneHundredPhysicsVisualizationsUsingMATLABFigure4.13:Diffractionpatternforlightincidentonaslitoffullwidth10observedatadistancez=5behindtheslitwherethewidthandlocationaregiveninwavelengthunits.Figure4.14:Diffractionbyasquareapertureoffullwidth10observedatadistancez=5behindtheaperturewithwidthandlocationinwavelengthunits.

119November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch044.WavesandOptics103showinghowthepatternbeginswithasinglemaximumatsmallslitwidths,andevolvestoapatternwithmanylocalmaxima.4.7.DopplerShiftandCerenkovRadiationThephenomenaofaDopplershiftofthefrequencyofawavedependingonthemotionofthewavesourcerelativetotheobserverandthecloselyrelatedCerenkoveffectisillustratedinthescript“DopplerCerenkov”.Therearesixdiscreteemissiontimes,withtheemissionlocationdependingonthesourcevelocity,whichischosenbytheuser.Theobserverisassumedtobeatrest.Thereisaslideshow,wheretheresultingoutgoingcircularwaveformsaresampledanddisplayed.Atthelastplotthedevelopingwaveformisbecomingclear.Thewaveformsforavelocity,v,ofonehalfwithrespecttothewavepropagationvelocity,vs,areshowninFigure4.15.Theangleisthatoftheobserverwithrespecttothezaxiswhichisthedirectionofuniformmotionofthesource.ω/ωo=1−vcosθ/vs(4.6)Intheforwardregionthewaveisblueshifted,whileintheback-wardregion,thesourceisrecedingandthewaveisredshifted.TherearemanyapplicationsoftheDopplereffect,suchasDopplerradarfortrafficcontrolandforweathermapping.TheHubbleredshiftisduetotherecessionvelocityofgalaxieswithrespecttoourown.Theredshiftedandblueshiftedregionsareindicatedbycolor.Thecaseofv/vs=1.5isshowninFigure4.16.Inthiscase,thesourceoutrunsthewaveandacoherentconeofoutgoingwavesbuildsup,calledaMachcone.Thisistheshockwavethatmakesasonicboomwhenajetplaneexceedsthespeedofsoundinair.Parenthetically,thatspeedisthesquarerootofthepressure,dividedbythedensityandisabout0.35km/secatSTP.Itisalsoatoolinhighenergyphysicswhereiflightisemittedbyaparticle,theCerenkoveffect,inamediumthenitisknownthatthevelocityofthatparticleisgreaterthanthatoflightinthemediumwhichhasanindexofrefractionofn,orc/n.

120November20,20139:199inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch04104OneHundredPhysicsVisualizationsUsingMATLABFigure4.15:Outgoingwavesinthecasewherev/vs=0.5.Theregionsofwave-lengthcompressionandexpansionareseenintheforwardandbackwardpositions.∗Theemissionpointsaregreen.Figure4.16:Outgoingwavesinthecasewherev/vs=1.5.Theregionsofwave-lengthcompressionandexpansionareseenintheforwardandbackwardpositions.∗Theemissionpointsaregreen.

121November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch044.WavesandOptics1054.8.ReflectionandTransmissionatanInterfaceThereare,ingeneral,bothtransmittedandreflectedwaveswhenawavestrikesaninterfacebetweenmediawithdifferentindicesofrefraction.Itisnowassumedthatlightgoesinstraightlinesandisnotdiffracted,whichistheregimeofgeometricaloptics.Thisisrea-sonablesinceforvisiblelightanobjectofsize1cmhasawavelengthtosizeratioofapproximately0.0001.Thebasicrelationshipbetweenthetransmitted,θtandincident,θianglesofwaveswithrespecttothenormaltothesurfaceiscalledSnell’slaw.sinθi/sinθt=nt/ni(4.7)Therearetwopolarizationstatesofthelightwhichrespondslightlydifferently;polarizationtransversetotheplaneofinci-denceandnormaltoit.Thisproblemiscoveredinthescript“ReflectTransmit”.Theprintoutfromasessionwheretheuserhaschosenanindexratioof1.5and0.5isshowninFigures4.17and4.18.Inthefirstcase,thereisalargeanglewithnoreflectionwithparallelpolarization.Indeed,thatiswhyanti-glaresunglassesarepolarizedandhowthepolarizationblockingisoriented.Thereisalsoaphasechangeuponreflection,whichmeansathincoatingcancanceloutareflectedwaveatagivenwavelength.ThatistheprinciplebehindFigure4.17:Printoutforthe“ReflectTransmit”scriptfor2choicesofindexratio,1.5and0.5.

122November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch04106OneHundredPhysicsVisualizationsUsingMATLABanti-reflectioncoatingsonlenses.Forawaveincidentfromn=1onathinfilmofthickness,t,precedingamediumofindex,n,thereisnoreflectionatagivenincidentwavelength,ifthethicknessischosen√tobet=λ/4n.Thistopicwillbedevelopedlaterinthequantummechanicalcontext.Intheuserdialogue,theindexratioischosen.Thenaplotofthetransmittedangleasafunctionofincidentangleissupplied,alongwiththetransmissionandreflectioncoefficientsasafunctionofincidentangleforbothtransverseandparallelpolarizationstates.AnexampleappearsinFigure4.18.Figure4.18:Transmissionandreflectioncoefficientsasafunctionofincidentangleinthecasewheretheratioofreflectedtoincidentindexofrefractionis1.5.Incasetheindexratioislessthanone,therewillbetotalinternalreflection,asdisplayedinFigure4.19inthecaseofparallelpolariza-tion.Inthatspecificcase,theangleatwhichtotalinternalreflectionoccursisthirtydegrees.Itisthisprinciplewhichisthebasisfortransmittingdataoverfiberopticcables,thosecableswhicharenowubiquitousintechnicalfields.

123November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch044.WavesandOptics107Figure4.19:Transmissionandreflectioncoefficientsasafunctionoftheincidentangleinthecasewheretheratioofreflectedtoincidentindexofrefractionis0.5.Thereisalsoananglewithoutreflectionatananglelessthantheinternalreflectionangle.Asanaidtomemory,amovieismadewherefiveraysareincidentfromoutsideandfivefrominside.Theresultinglastframeappearsforn=1.5inFigure4.20.4.9.ASphericalMirrorIngeometricoptics,lightgoesinstraightlines.Infact,raytracingisatoolusedtofollowthebehaviorofabeamoflight.Anexampleisshowninthescript“SphericalMirror”.Theraytracingissimple;theincidentangleisequaltothereflectedangle.Thequestionishowgoodafocalpointexistsinthecaseofthemirror.Theusermenuallowsforachoiceofwhatfractionofthemirrorisfilledwithincidentlight.Raytracesintwocasesareexaminedinthisexample.FirstraysusingthefullapertureofasphericalmirrorareshowninFigure4.21.Itisclearthattherays’incidentatlargedistancesofftheaxisofthemirrorsufferfromsevereaberration.

124November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch04108OneHundredPhysicsVisualizationsUsingMATLABFigure4.20:Lightraysincidentfromtoponton=1.5(blue)andincidentfromthebottom(red).Sincen>1,theblueraysarebenttowardthenormal,theredaway,andtotalinternalreflectionoccurs.Figure4.21:Raytracingforasphericalmirrorwheretheraysareincidentonamirrorofradiusofcurvatureoneouttooffaxisraysat90%oftheradius.

125November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch044.WavesandOptics109Figure4.22:Raytracingforasphericalmirrorwheretheraysareincidentonamirrorofradiusofcurvatureoneouttooffaxisraysat20%oftheradius.Thefocalpointismuchbetterdefinedinthiscase.InFigure4.22,theincidentparallelbeamonlyhasraysupto20%ofthemirrorradiusoffthemirroraxis.Clearly,theoffaxisraysmustbelimitedifgoodfocalpropertiesaretobemaintained.Theusercanchoosethelimitationontheincidentbeam.Thefocaldistanceisonehalftheradiusofcurvatureofthemirror,f=R/2.4.10.ASphericalLensArelatedproblemisthefocalpropertiesofasphericallens.Theproblemistreatedinthescript,“SphericalLens2”.Theindexofrefractionofthelensisfixedatn=1.5.TheradiusofthelensisR=10.RaytracingisaccomplishedbytheuseofSnell’slaw.Theuserchoosestheangularsizeofthelens,limitedtobelessthanabout60degrees.AfirstexampleisseeninFigure4.23,wherethechosenanglewas50degrees.Obviously,thischoicehasafocalpointwhichisnotverywelllocalized.Largerimpactrayshaveareducedfocallength.Theusercaneasilyrestricttheregionofincidentraystosee

126November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch04110OneHundredPhysicsVisualizationsUsingMATLABFigure4.23:Raytracingforasphericallenswithindexofrefraction=1.5,wheretheincidentbeamfillsthelensupto50degreeswithrespecttothelensaxis.howthefocallengthisbetterdefinedastheextentoftheincidentlightislimited.Thesituationwhenthebeamfillsonlyupto20degreesappearsinFigure4.24.Itisevidentthatthefocalpointismuchbetterlocalizedinthiscase.Theactivefractionofalensislimitedtotheareanearthelensaxis,aswasthecaseforthesphericalmirror.Thelensmaker’sequationforanincidentparallelbeamoflightis,1/f=(n−1)/R,wherefisthefocallength,nistheindexofrefractionofthelens,andRistheradiusofcurvatureofthelens.Inthisexample,n=1.5sothatf=2R,asisobservedinFigure4.24.4.11.AMagneticQuadrupoleLensSystemThissectionfinisheswitharathermorecomplexproblem,some-thingmoreakintothetypeofquestionaworkingphysicistmightencounter,albeitstillsimplifiedhere.Theexercisesrefertoasys-temofmagneticlenses.Theselensesaremanufacturedtocreateaquadrupolemagneticpotential,Φ,wherethemagneticfieldisthe

127November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch044.WavesandOptics111Figure4.24:Raytracingforasphericallenswithindex=1.5wheretheincidentbeamfillsthelensupto20degreeswithrespecttothelensaxis.gradientofthepotential.Φ=(dB/dr)xyBx=−(dB/dr)yBy=−(dB/dr)x(4.8)Themagneticfieldgradient,dB/dr,causesachargedparticlemovingalmostentirelyalongthezaxisandhavinganxdisplace-menttobefocusedbyencounteringaforcetowardthexaxis,whileintheydirection,aydisplacementisde-focusedawayfromtheyaxis.Therefore,thesimplestelectromagneticsystemwhichpro-videsfocusinginbothtransversedimensionsisadoubletofthesequadrupoles.Thissystemprovidesnetfocusingofabeamofchargedparticles.Solvingtheequationsofmotioninaquadrupolemagnetforapar-ticlewithmomentum,P,canbestbecastintoamatrixform,assum-ingthatthemotionislargelyalongtheaveragebeamdirection,orz,

128November20,20139:199inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch04112OneHundredPhysicsVisualizationsUsingMATLABaxisandthatdisplacementstransversetozaresmall.Inthefocusingcase:k=a(dB/dr)/P√φ=kL√xcosφsinφ/kxo=√(4.9)dx/dz−ksinφcosφ(dx/dz)othetransversemotionischaracterizedbyaninitialposition,xo,andangle,(dx/dz)o,andthematrixtransformstheincomingbeamintotheoutgoingbeamattheexitofthequadrupoleoflength,L,foronetransversedimension.Theamountoffocusingdependsonthefieldgradient,dB/dr,theinverseofthemomentum,P,andaconstant,a.Theotherdimension,whichmustbede-focusing,hasasimilarmatrixwiththetrigonometricfunctionsreplacedbyhyperbolicfunctions.Inanalogytotheopticalcase,thereisthebehaviorofathicklens(Figure4.23)andathinlens(Figure4.24)limitwhere,inthelattercase,thepositiondoesnotchange,buttheangularchangeindx/dz,isequaltokLxorx/f,wherefisthethinlensfocallength,1/kL.Thescriptforstudyingthedoubletoftwoquadrupolelensesisspreadoverseveralfiles.Themajorfileisthescript“QuadDoublet”.Thescript“Quadrupole”evaluatesthematrixelements,thescript“DoubletFit”usestheMATLABfunction“fminsearch”tofindthefocallengthswhichsatisfycertainbeamconditions,and“DoubletPlot”makesaplotofthesolutiontothefit.Becausethefitisnon-linear,startingestimatesforthesolutionareneeded,andtheyareprovidedbythescript“ThinLense”whichhasexplicitsolutionsforthecaseofathinlens.Theusercanfindthethinlenssolutionsthereandverifythemifinterested.TheprintoutfortheuserdialogueisshowninFigure4.25.Thegeometryofthedoubletisdefinedandiscompletedbytheuser,inthiscasea10mdistancefromtheinitialbeamtotheentranceofthefirstquadrupole.A“drift”isaspacewithnomagnets,andparticlesareun-deflectedina“driftspace”.Allthreesolutionsaredisplayed,pointtargettoparallelcapturedbeam,parallelbeamto

129November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch044.WavesandOptics113Figure4.25:Printoutforthe“QuadDoublet”script.Thefocallengthsinthinlensapproximationsandafterthenon-linearfitareprintedforthethreedefinedsolutions.pointfocus,andpointtargettore-focusedpointbeam.Thethinlensstartingvaluesandthefitvaluesarealsogiven.TwooftheraytracesareshowninFigures4.26and4.27.Thetrajectoryinthequadrupolesisexact,aslongasthemotionislargelyinthez,orbeam,direction.TheraysinFigure4.26correspondtothecaseofapointliketargetwhereparticlesarecreatedandcapturedintoabeam.Thefirstquadrupoleisyfocusingandxde-focusing,leadingtoratherdifferentbeamsizesinthetwotransversedimensions.Thesecondcasefullyrefocusesthebeam.However,theapertureofthequadrupoleisagainfilledveryasymmetrically,withalargexvalueinthesecondone.Arealtargethasafinitesizeandarealquadrupolehasmagneticfieldimperfections.Thesolutionsshownhereareforamonochro-maticbeamandanyrealbeamcontainsaspreadinmomentum.Ingeneral,thereisacentralmomentum,usuallydefinedbybendingthebeaminadipolemagnetandthencollimatingwhichservestoselectparticlesoflikechargeandmomentum.Nevertheless,theexer-

130November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch04114OneHundredPhysicsVisualizationsUsingMATLABFigure4.26:Solutioninthecasewhereapointtargetiscapturedintoaparallel(dx/dz=dy/dz=0)beam.Theboundariesofthequadrupolesareshowninred.Figure4.27:Solutioninthecasewhereapointtargetiscapturedandre-focusedintoapointlikebeam.

131November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch044.WavesandOptics115ciseshownhereinbeamdesignandraytracingisonethathasuseinthepracticalworkofanexperimentalphysicist.Thisdemonstra-tionisonewhichshowshowcomplexproblemscanbeapproachedbylinkingtogethermodulescriptswhichmakespecificandlimitedcomputations.

132November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05116Chapter5GasesandFluidFlow“Timeflowsawaylikethewaterintheriver.”—Confucius“Itislife,Ithink,towatchthewater.Amancanlearnsomanythings.”—NicholasSparks5.1.TheAtmosphereTheatmosphereoftheEarthisamixtureofgases.Forexample,thereisessentiallynoheliumintheatmosphere,althoughhydrogenandheliummakeupthevastbulkofthemassesofthestars.Thisfactisrelatedtothedistributionofthevelocitiesofmoleculeswithdifferentmolecularweights.Heaviermoleculesmovemoreslowlythanlightonesbecauseallspecieshavethesamemeanthermalkineticenergy.Basically,forabodytohaveanatmosphere,itmustbecoldenoughandmassiveenoughthatitsgravitywelldefinesanescapevelocitywhichislargewithrespecttothethermalvelocity.TypicalthermalvelocitiesatSTPareafewkm/sec.Thescript“Atmosphere”beginstoexplorethistopic.Theprint-outmadebythisscriptappearsinFigure5.1.SeveralfactsabouttheidealgaslawandBoltzmanndistributionsaregivenintheuserdialogue.Theparameter,E,isnowagaintheparticlekineticenergybyestablishedconventionandnottobeconfusedwiththeelectricfieldorthetotalenergy.TheMaxwell–Boltzmanndistributionofenergyatdifferenttem-peraturesisshowninFigure5.2.Thedistributionandtherelateddis-tributionofvelocitiesaregiveninEquation(5.1).Thedistributionistheprobabilityofobservingakineticenergy,E,forasystemofmanyobjectsofmass,m,inthermalequilibriumattemperature,T.TheconstantkinthissectionistheBoltzmannconstant,k∼1/40eVat

133November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch055.GasesandFluidFlow117Figure5.1:PrintoutwhichgivessomenumericalvaluesfortheatmosphereoftheEarth.Figure5.2:Maxwell–Boltzmannenergydistributionforoxygenmoleculesatdif-ferenttemperatures.

134November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05118OneHundredPhysicsVisualizationsUsingMATLAB300degreesKelvin.Normalizingtothetotalnumberofobjects,N,theprobabilityis1/N(dN/dE).√dN/dE∼Ee−E/kT(5.1)dN/dv∼v2e−mv2/2kTItiseasytoconvertvariablesbyfindingthevalueofdE/dv,forexample,inordertoswitchfromthedistributionofEtothatforvelocity.Themeanvelocitiesatroomtemperature,300KarequotedinFigure5.1.Themeanenergyincreasesproportionaltothetempera-ture,sothatthemeanvelocitygoesasthesquareroot.ThevelocitydistributionforheliumandoxygenisshowninFigure5.3.Theplotshowsthattheheliumismuchmorelikely(notethelogarithmicver-ticalscale)toattainescapevelocitythantheoxygen,whichimpliesFigure5.3:VelocitydistributionforHe(blue)andoxygen(red).Theescape∗velocityfortheEarthistheingreen.Escapeseemsunlikely,buttherearemanypossiblethermalfluctuationsinthecourseofeons.

135November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch055.GasesandFluidFlow119thattheEarthatpresenthasanatmospherecomposedofheavierdiatomicmolecules.5.2.AnIdealGasModelinTwoDimensionsItisinstructivetomakeasimplemodelofatwo-dimensionalnon-interactinggas.TheMATLABfunction“rand”isusedtocreatedistributionsfortherandomvariablesoproduced.ThismethodofcreatingmodelsiscalledtheMonteCarlomethod.Forexample,inthescript“MaxwellBoltz”,thedistributionofenergyintwodimen-sionsisasimpleexponentialandthatbehaviorcanbeproperlyweightedbytakingthelogofarandomnumber.Theusershouldtrythisbymaking,say,1000trialsandhistogrammingtheresultsusingtheMATLABscript“hist”.Thescript“MaxwellBoltz”adoptsamoregeneralcasewheretheenergyisdefinedbetweenmaximumandminimumlimits.Theusermaywishtolookatthatspecificcode.Similarly,theinitialpositionsofthe“gasmolecules”inthetwo-dimensionalboxarerandomlychoseninxandy.TheprintoutofthescriptforaspecificsetofuserchoicesisgiveninFigure5.4.Theuserpicksthetemperatureofthegasandtheareaoftheboxwhichholdsthegas.Intheexampleshown,anareaofoneandtwotemperaturesarepicked.Thenumberofcollisionsofthemoleculeswiththewallsistrackedasisthetotalmomentumimpulsegiventothewallsbythereflectionofthemolecules.Inthisway,theidealgaslawcanbemodeled,albeitwithonlyabout100moleculesandnot1023.Withatwo-foldincreaseintemperature,themeanvelocityisexpectedtoincreasebythesquarerootoftwo,whileanincreaseofafactor1.38isseen.Thetemperatureincreaseleadstomorewallcollisionsperunittimeandalargermomentumtransferimpulsepercollision,witha“pressure”increaseofafactor1.68.Notethatthestatisticalaccuracyhereislimitedbythesmallnumberof“molecules”.Theusercantryseveraltimeswithafixednumberof“molecules”toseethestatisticalvariationsor,althoughitisslow,increasethenumberof“molecules”orthenumberoftimesteps.AsnapshotofthegasareawithparametersdefinedinFigure5.4isshowninFigure5.5.

136November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05120OneHundredPhysicsVisualizationsUsingMATLABFigure5.4:Printoutforthescript“MaxwellBoltz”forspecificuserchoices,inthiscaseareaequaltooneandtwotemperatures,oneandtwo.5.3.Maxwell–BoltzmannDistributionsAclassicalgasofnon-interactingparticlesfollowstheMaxwell–Boltzmanndistribution.Thedistributionfollowsfromthestatementthatallvelocitycomponentsareequallyprobable,subjecttoanoverallweightingfactordependingontemperature.Thedistribu-tions,asyetun-normalizedinvelocityandkineticenergyforathree-dimensionalgasare:dN∼dvdvdv[e−Mv2/2kT]xyzdN/dv∼v2[e−Mv2/2kT](5.2)E=Mv2/2,dE/dv=Mv√dN/dE∼E[e−E/ktkT]

137November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch055.GasesandFluidFlow121Figure5.5:Snapshotofthemovieofatwo-dimensionalareacontaining“molecules”withadistributionofenergiesandinitiallyrandompositionsandangulardirectionsofthevelocitieswithinthearea.Thedistributionofkineticenergy,dN/dE,followsfromtheJaco-bianconnectingenergy,E,andvelocity,dN/dE=dN/dv(dv/dE),dv/dE∼1/v.Itiseasytoseethatintwodimensions,thevelocitydistributiongoesasdN/dv∼vtimestheexponentialfactor,whileinonedimensiondN/dv∼1timestheexponential.Theenergydis-√tributionsgoesas∼1timestheexponentialand1/Etimesforthetwo-andone-dimensionalcases,respectively.TheseresultswerealreadyquotedinSection5.2forthetwodimensionalgasexample.Thenormalizeddistributionsforvelocityandenergyarecom-putedsymbolicallyinthescript“momentsmaxboltz”.Inaddition,expressionsforthemean,rootmeansquareandmostprobablevaluesforenergyandvelocityarealsocomputedandprinted.TheresultsaregiveninEquation(5.3).TheenergyisinkTunits,whilethevelocityisalsocomputedindimensionlessunits,inthiscasekT/M.ThedistributionsareshowninFigures5.6and5.7,respectively.Thedistributioninvelocityismoreclusteredbecauseofthedependence

138November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05122OneHundredPhysicsVisualizationsUsingMATLABFigure5.6:DistributionofkineticenergyinkTunitsforaMaxwell–Boltzmanngas.Figure5.7:DistributionofvelocitiesforaMaxwell–Boltzmanngas.

139November20,201310:469inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch055.GasesandFluidFlow123ofthedistributiononthesquareofthevelocitycomparedtotheenergydistributionwherethefactoristhesquarerootoftheenergy.VelocityEnergyMean8kT/πM(3/2)kT√(5.3)r.m.s.3kT/M(15/2)kTmostprob2kT/MkT/25.4.Fermi-DiracandBose-EinsteinDistributionsQuantummechanicsimpliesthatnon-interactingparticlesstillhaveeffectsduetothespinandstatisticsobeyedbyfermionsandbosons.Forbosonstherecanbeanynumberofparticlesinagivenquantumstate,whileforfermions,theFermiExclusionPrinciplerequiresatmosttwoparticlesforspin1/2,inaparticularspatialquantumstate.Therefore,atlowtemperature,bosonswilltendtopileupinthelowestquantumstate,whileforfermions,allstatesuptosomemax-imumenergywillbepopulatedbyapairoffermions.Thefunctions,f,arethemeanoccupationnumberofaquantumstateofenergy,E,approximatedasacontinuousvariable,sincethespacingbetweenquantizedenergylevelsissmallandun-normalizedhereinthethreecasesareshowninEquation(5.4):Maxwell–BoltzmannfMB(E)=e−E/kTFermi–DiracfFD(E)=1/[eE/kT+1](5.4)Bose–EinsteinfBE(E)=1/[eE/kT−1]Thenormalizationwillbecalculatedlater.Itisdefinedbyreplac-ingtheenergy,E,byE−µ,whereµisthechemicalpotentialwhichthennormalizesthefunctionstobethemeanoccupationnumber.AplotofthesethreedistributionsisshowninFigure5.8.Atlowtem-peratures,theFermi–Diracdistributionbecomesconstantbecauseallthestatesarefull,whilefortheBose–Einsteincasethereisnolimitation.Athightemperatures,thestatesareonlysparselyfilled,sothatthetwoquantumdistributionsandtheclassicalMaxwell–Boltzmanndistributionareallsimilar.Notethatthesedistributionsarenotyetproperlynormalized,norarethepowerlawenergyfactors

140November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05124OneHundredPhysicsVisualizationsUsingMATLABFigure5.8:Energydistributionsforthethreecasesofaclassicalgasorafermionicorbosonicgas.havingtodowiththe“phasespace”oftheparticlesincludedastheywerefortheclassicalgas,Equation(5.2),inSection5.3.ThethreedistributionsaredefinedtoagreeatE=kT.Inthequantumcase,thedensityofstates,dn/dE,thenumberperunitvolume,n,hasanenergydistributionwhichisnormalizedtothepossiblenumberofquantumstates.ThewavenumbersarequantizedinaboxofsideL,kx=(2π/L)nx,whichleadstoanum-berperunitvolumeandmomentumof,dn=dk/(2π)3,dp=dk.Thedistributioncanthenbeconvertedtoenergy,E.Theresultingvaluefordn/dEisproportionalto1/3,andthevolumeofavailablestatesinpositionandmomentumisfoundtobeproportionaltothequantumgraininessoftheworld,asonemightexpect.ThissetstheproportionalitywhichwaslackinginEquation(5.2).√√dn/dE∼2M3/2E/3π2(5.5)

141November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch055.GasesandFluidFlow1255.5.ChemicalPotential,BosonsThenormalizationofthemeanoccupationnumbersofaquantumstateofenergyE,f(E),willnowbecalculatedforbosons.Thenor-malizationisfixedbythetotalnumberofparticles,N,andthevol-umeinwhichtheyarecontained,V.Thenumberdensityisn=N/V,whilethemassdensityisρ=mn,wheremisthemassoftheatomorelectron.TheenergydensityisuwhilethetotalenergyisU.Thespectralenergydensityisu(E),whoseintegralisu.Theparticleseffectivelyhaveenergiesreducedbythe“chemicalpotential”,E→E−µinEquation(5.4),whichis,forexample,theworkfunctionofelectronsboundinametal.Thechemicalpotentialmustbeevaluatedbyproperlynormalizingtheprobabilities.IntheBose–Einsteincase,fornon-relativisticparticles,thenum-berofstatesgoesasthesquareofthemomentum,asshownalreadyintheBoltzmanncase.Theintegralfornisthen,ignoringnumer-√icalfactors,dn∼E[1/(e(E−µ)/kT−1)]dE.Thisintegralcanbedoneinclosedform.Integratingthedistributionovertheparticleenergy,E,thenumberdensityandtotalenergy,U,are:N/V=n=s(mkT/2π2)3/2ζ(eµ/kT)3/2U=3/2kTV(mkT/2π2)3/2ζ(eµ/kT)(5.6)5/2U→3/2kTNThenumberofquantumstatesofspiniss.TheRiemannzetafunction,ζ,arisesfromintegratingthespectralnumberdensityoverallenergies,andthechemicalpotentialµisanormalizationfactor.Thezetafunctionhasaradiusofconvergencefromzerotoone,orchemicalpotentialsfromzerotoinfinity.Theenergydensity,u,arisesfromintegratingthespectralenergydensity,u(E)=En(E)overallenergiesanditalsocontainsazetafunction.MATLABhasutilityfunctionstoevaluatethezetafunctionsasaninfinitepowerseries.Ifn=N/Vissmallorthetemperatureishigh,thentheRie-mannzetafunctionratiosinU/Nareroughlyone,andtheclassicalresultshowninEquation(5.6)isrecovered.However,atlowtem-peratures,theinter-particlespacingbecomescomparabletothedeBrogliewavelength,h/P,andacriticaltemperatureisreachedwhen

142November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05126OneHundredPhysicsVisualizationsUsingMATLABthechemicalpotentialiszero.Thiscorrespondstothebehaviorofliquidheliumspinzeronucleusasthetemperatureisdecreased.Atacriticaltemperatureitbecomesa“super-fluid”.Takings=1,2.612=thezetafunctionoforder3/2andofargumentone,orchemicalpotentialequaltozero,thecriticaltem-peraturewhenthisoccursisestimatedtobe:T=2π2/Mk[(n/sζ(1))2/3c3/2E=kT=2k2/2M(5.7)ccc√k=4π[n/sζ(1)]1/3c3/2ThecriticaltemperatureforHe,massM,isevaluatedinthescript“ChemicalPotential”.Thezetafunctionsareevaluatedasaseriesoffivehundredterms,andtherelationshipofN/Vtothechem-icalpotentialatagivenTisevaluatedusingtheMATLABfunction“fminsearch”inordertosolveforthechemicalpotentialexplicitlyusingEquation(5.6)atfixednumberdensity.TheresultingsolutionsareplottedinFigure5.9.Theestimatedcriticaltemperature,usingFigure5.9:PlotofthechemicalpotentialforHeasafunctionoftemperature.∗TheapproximateresultofTcatzeropotentialisshownasa.

143November20,201310:469inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch055.GasesandFluidFlow127Equation(5.7)forzerochemicalpotential,isTc=2.8K.Theexper-imentalnumberwhenheliumbecomesasuper-fluidis5.2degrees.TheexplicitcalculationofthechemicalpotentialasafunctionoftemperatureismadeavailableusingthepowerfulMATLABtoolswhichareprovided.NoteinEquation(5.7)thatthewavenumberscalesastheone-thirdpowerofthenumberdensity.Thisbehaviorisalsotrueforthechemicalpotentialforfermions.Criticalbehavioroccurswhenthewavenumberbecomescomparabletotheintermolecularspacing.Atthattemperature,quantumeffectscanbeexpectedtomanifestthemselves.5.6.ChemicalPotential,FermionsTheFermilevelisoftenthoughtofasthechemicalpotentialatzerodegrees,whereallstatesbelowthatenergyarefilledsothattheoccupationnumberisonebelowthe“FermiEnergy”andzeroabove√EF3/2it.Inthiscasetheintegrationistrivial,n∼EdE∼E.0FE(0)=2/2m(3π2N/V)2/3Fe=2k2/2m,k=(3π2n)1/3(5.8)FeFAllstatesabovetheFermienergyareemptybecausenothermalexcitationispossible.TheexampleusedisforLi,andanapproxi-mateexpansionforthetemperaturedependenceoftheFermiEnergyisplottedinFigure5.10.Thezerotemperatureresultsimplyagainfollowsfromthedensityandis4.7eV,oranequivalenttempera-tureof56,000degrees.Theveryhighcharacteristictemperatureisareflectionofthefactthatforbosons,theenergiesaresmallerthantheclassicalcaseduetoclustering,whileforthefermionstheeffectiveenergiesarepushedhigherduetotherequirementsoftheexclusionprinciple.Atroomtemperature,theapproximationofusingthezerotemperatureFermienergyisoftenveryuseful.Theenergydensitycaneasilybefoundinthelowtemperaturelimit.u(o)=3/5(nE)(5.9)F

144November20,201310:469inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05128OneHundredPhysicsVisualizationsUsingMATLABFigure5.10:Approximatecalculationofthetemperaturedependenceofthe∗chemicalpotentialdividedbytheT=0FermilevelforLi.TheredistheT=0Fermilevelintemperatureunits.5.7.CriticalTemperatureforHeThetemperaturedependenceofthechemicalpotentialwasdiscussedinaprevioussection.Furthercalculationsaremadeavailableinthescript“CritTempHe4”.PrintoutfromthatscriptisshowninFigure5.11.Theuserchoosestheatomicweightoftheatom.Figure5.11:Theestimatedcriticaltemperatureisarepeat.Theappropriatescalingofimportantparametersisalsoindicated.

145November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch055.GasesandFluidFlow129IthasalreadybeencommentedthatinaBose-Einsteingas,themeanenergyperatomislessthanthatforaclassicalsystem.ThatstatementisquantifiedinFigure5.12.TheplotisthemeanenergyofHeasafunctionoftemperaturescaledtotheclassicalmeanenergy.Thisbehaviorisverycharacteristicofabosonicsystem.NotethatwhatisplottedareapproximationsforlargeandsmallvaluesofT/Tc.TheexperimentalcriticaltemperatureforHeisalsoindicatedbyared∗.Figure5.12:MeanthermalenergyofHeasafunctionoftemperaturerelative∗totheclassicalresult.Theredistheexperimentalcriticaltemperature.Thebehaviorofthemeanenergyhastwoexpansions,atlowtemperaturesandathightemperaturesoneofwhichfollowsfromEquation(5.6):E∼(1−T/T)3/2c(5.10)E∼[ς(eµ/kT)/ς(eµ/kT)](T/T)3/25/23/2cQuantumeffectsareexpectedatlowtemperaturesbecause,asthetemperaturefalls,themomentumdecreasesandhencethe

146November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05130OneHundredPhysicsVisualizationsUsingMATLABdeBrogliewavelengthrises.Whenthatwavelengthexceedsthetypi-calspacingbetweenatoms,estimatedtobeapproximately(1/n)1/3,quantumeffectswillbecomeimportant.√λdB∼2π/3kTM(5.11)AplotofthetemperaturedependenceofthedeBrogliewave-lengthusingEquation(5.11),andtheinteratomicspacing,assumedtobeconstant,isshowninFigure5.13.Thecurvescrossnearthecriticalpointforhelium,indicatedbyared∗,asexpected.NotethatfromEquation(5.6)and(5.7),n∼1/λ3,k∼1/λdBasisexpecteddBfromsimpledimensionalarguments.Figure5.13:TemperaturedependenceofthedeBrogliewavelengthforheliumincomparisontotheinteratomicspacinginangstroms.Theexperimentalvalue∗ofthecriticaltemperatureisindicatedbyared.5.8.ExactFermionChemicalPotentialTheintegralsthatneedtobeevaluatedsuchasthatforthenumber√density,n∼∞E/[e(E−µ)/kT+1]dE,inordertofindthefermion0

147November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch055.GasesandFluidFlow131chemicalpotentialarenotanalyticallytractableintheFermi–Diraccase.Becauseofthat,thescript“FermiDiracTne0”usestheMATLABnumericalintegrationtool“quad”tomakenumericaleval-uations.Thespecificationofthenumberdensitygivesanimplicitrelationshiptothechemicalpotentialasnotedpreviously.AtT=0,thenumberdensityshouldgoasthethirdpoweroftheFermienergy,asdisplayedbythescriptandquotedabove.Operationally,achemicalpotentialischosenandthenumberdensityissolvedforusing“quad”.Thisprocedureisdoneasafunc-tionofthetemperature.Theresultsareplottedasasurfaceofdensityinthevariablesoftemperatureandchemicalpotential,calledFermienergyhere,EF,inFigure5.14.Acontourplotofconstantdensityinthetemperature—chemicalpotentialplaneisgiveninFigure5.15.AlsoplottedtherearepointsfromanexpansioninpowersofTaroundT=0fortheFermienergy,usedincomputingpointsforFigure5.10.Theapproximatebehaviorisquitegoodifthetempera-tureislow,however,athighertemperaturesitbecomesnegativeandunphysical.Figure5.14:Densityasafunctionoftemperatureandchemicalpotential.

148November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05132OneHundredPhysicsVisualizationsUsingMATLABFigure5.15:Contours,fromthenumericalexerciseofFigure5.14,ofconstant∗densityasafunctionoftemperatureandchemicalpotential.TheblueareapowerlawexpansionintemperatureusedinFigure5.10,whichbecomesnegativeathighT.Giventheubiquityofsolidstateelectronicsinourculture,anoddingacquaintancewiththeenergeticsofelectronsisausefulthing.Clearly,asthetemperatureincreases,theFermilevelincreases.HighernumberdensitiesimplyhigherFermienergies,albeitwithaweakdependenceonn.5.9.ComplexVariablesandFlowThecomplexvariabletechniqueswhichwereusedintwodimensionalelectrostaticscanalsobeappliedtofluidflow,sincetheunderlyingmathematicsisthesame.Thepotentialsofelectromagnetismbecomethestreamlines,andthegradientwhichdefinedtheelectricfieldsbecomesthefluidvelocity.Otherwisethesamedifferentialequationisbeingsolvedinthetwocases.ForafluidflowpotentialofΦ,thevelocityofthefluidflowis∇Φ=v.Notethatthisflowformulationonlyappliestotheidealcaseofnofrictionorviscosityforthefluid.

149November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch055.GasesandFluidFlow133Theflowstreamlinesforanobstacleplacedinauniformflowalongthexaxisareexploredinthescript“Flowwindtun”.Plotsoftheunobstructedflow,scalechosenbytheuser,withacircularobstructingobjectandwithalinearobjectarepresentedaschoices.Inthelinearcase,anuprightlineisshownandthentheuserisaskedtogiveanangletothelinearobstacle.ThestreamlinesfortheverticallineareshowninFigure5.16,whilethesameobjectinclinedbythirtydegreesappearsinFigure5.17.5.10.ComplexVariablesandAirfoilsAmappingexistswhichgivesanobstaclewithashapesimilartoanairplanewing.ThesearecalledJoukowskiprofiles.Thescriptusedis“FlowAirfoil”.Theuserdialogueallowsforachoiceofaparameterwhichdefinestheairfoilshapeandalsoachoiceoftheangleofattackoftheshape.ThereisanangleofattackwithrespecttotheexternalflowofsixtydegreesinFigure5.18.Figure5.16:Streamlinesforaverticallinearobstacleplacedinflowalongthexdirection.

150November20,201313:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05134OneHundredPhysicsVisualizationsUsingMATLABFigure5.17:Streamlinesforalinearobstacleinclinedat30degreesplacedinflowalongthexdirection.Figure5.18:StreamlinesinthespecificcaseofanairfoilshapedefinedbyR=0.5andwithanangleofattackwithrespecttotheexternalflowof60degrees.

151November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch055.GasesandFluidFlow135ThevelocityvectorscorrespondingtothestreamlinesofFigure5.18appearinFigure5.19.Theviewenhancestheideathatthisairfoilhas“lift”.Figure5.19:VelocityvectormapofthefluidflowaroundtheairfoilofFigure5.18.5.11.ComplexVariablesandSourcesofFlowThereareseveralflowsourcesdisplayedinthescript“FlowSource”,includingbothsourcesandsinks,rotationalflowandbarriers.Oneexampletakenfromthescriptisapointsourceofflowinthepresenceofabarrieratxequaltozero,whichextendsoverally,whilethesourceisatpositivexontheyaxis.ThestreamlinesforthiscaseappearinFigure5.20,whilethexvalueofthevelocityisdisplayedinFigure5.21.Thesecomplexvariabletechniquesgiveaverynicevisualpresen-tationofthepotentials/streamlinesandfields/velocityvectors.Theinterestedusercanmodifytheprovidedscriptsandthentrydifferentgeometricconfigurationssincetherearemanymappingsprovidedintheliterature.Forexample,aGOOGLEsearchyieldshttp://www.math.umn.edu/∼olver/pd/cm.pdf.

152November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05136OneHundredPhysicsVisualizationsUsingMATLABFigure5.20:Streamlinesforthecaseofapointflowsourcelocatedontheyaxisinthepresenceofabarrieratxequalzerocoveringallylocations.Figure5.21:Velocityalongthexdirectionforthecaseofapointflowsourcelocatedontheyaxisinthepresenceofabarrieratxequalzerocoveringallylocations.

153November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch055.GasesandFluidFlow1375.12.ViscosityModelIdealgasesdonotself-interact,whichwasassumedintheflowexam-plesshownabove.Asasimpleattempttomakeamorerealisticgasmodel,thescript“ViscosityModel”allowsthemoleculesofthegastoelasticallyscatteroffoneanother.Thesizeofthemoleculesinthenumerical,twodimensionalsimulation,issuchthat400moleculeswouldfilltheareaofthegas.Theuserchoosesthenumberofmolecules,thenumberoftimestepstofollowthegasvolume,thegastemperature,andtheacceler-ationduetoanappliedfield.Anidealgaswouldsimplyflowinthefielddirectionwithoutimpediment.Theaccelerationmightbeduetoaheatdifferentialasinthermalconductivityoranelectricfieldinthecaseofelectricalconductivityofelectronsorionsinagas.AnexampleofthedialogueappearsinFigure5.22.Figure5.22:Userdialogueforevaluatingtheeffectofanexternalacceleration.Iftherewerenocollisions,themoleculeswouldbeswepttotherightxwallofthegasarea.Thewallcollisionsandthetemperaturearetreatedinthesamewayasinthecaseoftheidealgasmodel.Thescriptinthiscasechecksforacollisionbetweenmolecules,andrandomizesthevelocitydirectionincaseofacollision.Theusercanwatchthemovieoftheevolutionofthesystem.Inaddition,themomentumtransferredtothewallsistrackedand

154November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05138OneHundredPhysicsVisualizationsUsingMATLABprintedout.Ascanbeexpectedfornoacceleration,theleftandrightmomentumtransfersareequal—statistically.Anaccelerationof“2”enhancestherightmomentumtransferwithrespecttotheleft.Increasingthetemperaturereducestheleft-rightasymmetry,sincethethermalmotionwashesouttheacceleration.Finally,reducingthenumberofmoleculesenhancestheasymmetrybecausethenumberofcollisionsbetweengasmoleculeswhichgoesasthesquareofthenumberofmolecules,isreduced.ThelastframeofamoviearisingfromthedialogueaboveappearsinFigure5.23wheretheasymmetryinspaceisalsoevident.Figure5.23:Lastframeofthemovieforthespecificchoiceof100molecules,withtemperature=1andacceleration=2.Forexample,anelectroninanappliedelectricfieldEinagashasadriftvelocityvd:vd=(eE/me)τ(5.12)τ=1/vTσnThemeantimebetweencollisions,τ,dependsontheaveragethermalvelocity,vTthecollisioncrosssection,σ,andthegas

155November20,201310:469inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch055.GasesandFluidFlow139numberdensity,n.Asaresult,thedriftvelocityofthemediumisproportionaltotheaveragethermalvelocity.Theelectricalcon-ductivity,κe,orcurrentflowperunitelectricfield,isκe=ne2τ/m,proportionaltothedriftvelocity.5.13.TransportandViscosityTransportphenomenaingasesandliquidscanbeformulatedusingtheMaxwell–Boltzmannvelocitydistribution.Anexampleisworkedoutinthescript“MBTransport”.Thecollisioncrosssection,σ,forahardspheregasistakentobeπtimesthediameterofasinglemoleculesquaredbygeometry.ThemeanthermalvelocityofthemediumisvT,whichwasalreadyevaluatedtobe8kT/πm.Thenumberofcollisionssufferedbyagivenmoleculeperunittimeis:√Nc=nσvT/2(5.13)wherenisthenumberofmoleculesperunitvolume.ThemeantimebetweencollisionsistheinverseofNc.Themeanfreepath,L,betweencollisionsisvTtimesthemeantimebetweencollisions,√L=τvT=vT/Nc=2/nσ,whichisindependentoftempera-ture.Theviscosity,η,canthenbeevaluatedanddependsonlyonthethermalvelocityandthecrosssection:√η=mnLvT/3=2mvT/3σ(5.14)TheprintoutfromthescriptfortheuserchoiceofhydrogengasisshowninFigure5.24.Figure5.24:PrintoutforauserdefinedchoiceofHgas.OtheroptionsareHe,N2,orO2eitherasagasoraliquid.

156November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05140OneHundredPhysicsVisualizationsUsingMATLABTheexperimentalvaluefortheviscosityofH2atSTPis∼9.5×10−5gm/(cm∗sec).Thetreatmenthereimplicitlyassumedthatthemediumisdiluteandthatthemeanfreepathismuchgreaterthanthesizeofthemolecules,whichisappropriateforagassincethemeanfreepathisapproximately1000timesthesizeofthemoleculeswhicharetypicallyangstroms.ThetemperaturedependenceofH2gasinthismodelisshowninFigure5.25,wherethesquarerootbehaviorofthemeanthermalvelocityisobserved.Thesimpletreatmentgivenhereisapproximatebutqualitativelycorrect.Figure5.25:TemperaturedependenceoftheviscosityofH2gas.5.14.FluidFlowinaPipeThenextlevelofapproximationforflowistoallowforinternalfric-tion,orviscosity,butnottaketurbulenceintoaccount.Inthatcase,theflowislaminarandtheboundaryconditionsarethatthevelocityofthefluidatthepipeinterfaceiszero.Forafluidwithviscosity,therearecollisionswhichcreatefrictioninthefluid.Forexample,thereisadragforce,Fd∼aηv,onanobjectofsizeainafluid

157November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch055.GasesandFluidFlow141movingwithvelocity,v,andhavingviscosity,η.Theequationsforfluidvelocity,v,asafunctionofradius,r,fromthepipecenterandforthevolume,V,flowwithtimeare:dv/dr=−pr/(2ηL)(5.15)v=p/(ηL)[R2−r2](5.16)dV/dt=πpR4/(8ηL)(5.17)Thepressureisp,thepipelengthisLandtheviscosityisη.Thevolumeflowisproportionaltothefourthpowerofthepiperadiusandproportionaltothedrivingpressuredividedbythepipelength.Printoutforthescript“FlowPipe”isdisplayedinFigure5.26.Theuserdialoguecoversthechoiceofdrivingpressure,thepipelengthandtransversesize,aswellasachoiceoftwogeometries;acircularpipeorflowbetweentwoinfiniteplates.Thefluidisassumedtobewateratnearroomtemperature.Themaximumvelocityiscomputedasistheoverallvolumeflowofthewaterforthepipe.TheshapeofthevelocityprofilefollowsfromtheboundaryconditionswhichrequirevanishingvelocityatthepipeboundaryandisshowninFigure5.27foraspecificchoiceofparametersforthecircularpipeoption.Figure5.26:Printoutforaspecificexampleofviscousflowinapipe.Laminarflowisareasonabledescriptionofviscousflowintheabsenceofturbulence.Idealflow,ontheotherhand,hasnofric-tionalforces.Thisidealizationisnotasrealistic,butitdoesadmitofsolutionswhichareknownfromelectrostaticssincetheLaplaceandPoissonequationsapply.

158November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05142OneHundredPhysicsVisualizationsUsingMATLABFigure5.27:TransversevelocityprofileforthecaseofacircularpipewithparametersshowninFigure5.26.5.15.HeatandDiffusionMATLABhastheabilitytosolvepartialdifferentialequationsnumericallyinonespatialdimension.Thescriptiscalled“pdepe”whichcanhandleonedimensioninspaceandfirstorderpartialderivativesintime.Theheatdiffusionequationisstudiednumer-ically,solving:κ∂2T/∂2x=∂T/dt(5.18)Thethermalconductivityisκ.Thespatialandtemporalcoordi-natesarexandt,respectively.Thescriptsolvesforthetemperature,T(x,t),distributionsubjecttoinitialconditionsandboundarycon-ditions.TheboundaryconditionsarethatTvanishesattheextremevaluesofx.Theyshouldbeplacedfarenoughfromtheregionsofinterestsoasnottoaffecttheresults.Thescriptwhichwaswrittentosolvetheheatequationis“PDEHeat”.InitialconditionsforthetemperaturedistributionT(x,0)aresuppliedandthevalueandfirstderivativeofTonthex

159November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch055.GasesandFluidFlow143boundariesarefixed.TheshapeoftheinitialT(x,0)distributionischosenbytheuserfromfourpossibilities.AmoreadvancedusewouldbetohavetheuserrewriteT(x,0)toenableanarbitrarysymbolicfunctionalinputoraltertheconductivityκ.Theresultsforaninitialsquaredistributionatstartingandend-ingtimesareshowninFigure5.28.Theuserseesamoviewithalltheintermediatetimesolutionsasthetemperatureevolvesintime.Theheatdistributiondiffusesintotheinitiallycoolregionsasexpected.AsecondoptionisshowninFigure5.29.Figure5.28:Initial,blue,andfinal,red,temperaturedistributionsforaninitiallysquaredistributionoftemperature.Inaddition,theheatequationiscloseinstructuretotheSchrodingerequation,exceptthattheappearanceofiinthelat-terallowsfordiffusionbutalsotocontainoscillatorysolutions.Thisaspectwillbetakenupinthenextsectionwhichlooksatquantummechanicaldemonstrations.Aswiththeheatequation,anumeri-calstudyofthesolutionsoftheSchrodingerequationwillbemadeusingwavepacketstosimulatea“particle”localizedinposition

160November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch05144OneHundredPhysicsVisualizationsUsingMATLABFigure5.29:Initial,blue,andfinal,red,temperaturedistributionsforaninitialdistributionwithsharperstructurethanthatinFigure5.28.andmomentum,butwhoseprobabilitydensityspreadsspatiallyintime,ratherlikethebehaviorofthetemperaturedistributionsshownabove.Clearly,manytopicsinphysicsareinter-related.Someintuitionaboutthediffusionofheatcanbegainedbytryingtheseveralexamples.

161November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06145Chapter6QuantumMechanics“Wehavesoughtforfirmgroundandfoundnone.Thedeeperwepen-etrate,themorerestlessbecomestheuniverse;allisrushingaboutandvibratinginawilddance.”—MaxBorn“Thosewhoarenotshockedwhentheyfirstcomeacrossquantumtheorycannotpossiblyhaveunderstoodit.”—NielsBohr“Photonshavemass?Ididn’tevenknowtheywereCatholic.”—WoodyAllen6.1.Preliminaries—PlanckDistributionTheadventofquantummechanicsbeganwiththeexplorationofblack-bodyradiation.Thisproblemisnowviewedasthebehaviorofaphotongaswithzerochemicalpotential.Inthelastsection,thechemicalpotentialwasdefinedforasystemwithafixednumberofparticles.Inthiscase,photonscanbeemittedandabsorbed,sothatthechemicalpotentialmustbezero.ThePlanckdistributioninphotonnumberisasassumedclassically;allmomentum,P,compo-nentsareequallyprobable.However,sincethephotonismassless,thisleadstoanumberdistributionthatgoesasthesquareoftheenergy,E,andatotalenergy,U,distributionthatgoesasthethirdpower,modulatedbytheBose–Einsteinfactor.dn/dP∼P2dP/[eE/kT−1]E=cP,du/dE=Edn/dEdn/dE∼E2dE/[eE/kT−1](6.1)Themomentsofthedistributionareevaluatedinthescript“MomentsPlanck2”.TheresultsareplottedinFigure6.1below.

162November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06146OneHundredPhysicsVisualizationsUsingMATLABFigure6.1:Energydensitydistributionforaphotongaswithzerochemicalpotential.Thescriptprintoutgivesthesymbolicvaluesforthedifferentmoments.Theintegralsaredonesymbolicallyandareprintedout.ThemeanenergyisexpressedintermsoftheRiemannzetafunctionsofargumentone(zerochemicalpotential),whichis,inkTunits,numericallyequalto3.83.Sincedu/dEgoesasthecubeofE,theenergydensitygoesaskTtothefourthpower,whichistheStefan–Boltzmannlaw.Thethermalenergydensityisu,whilethepowerperunitarea,ortheluminosityisL.E/kT=360ζ(1)/π45(E/kT)2=π40/21u=4/c(σT4),L=σT4σ=π2k4/(603c2)(6.2)Theresultforuissimply,u=4π2(kT)4/60(c)3,wherekThasdimensionsofenergyandchasdimensionsofenergytimesdistance.Numericallyσis5.67×10−8W/m2×k4.

163November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics1476.2.BoundStates—OscillatingorDampedQuantummechanicshasadescriptioncalledtheSchr¨odingerequationwhichisformallysimilartotheheatdiffusionequationwhichwasalreadystudied.Theappearanceoftheimaginarynum-beri,however,allowssolutionstothisequationwhichareeitheroscillatoryorexponentiallydamped.Thesearethenthetwomaincategories,boundstateswhichareexponentiallydampedfarfromtheconfiningpotentialandscatteringstateswhicharenotsocon-fined.TheSchr¨odingerequationdeterminesthebehaviorofthewavefunctionψwhosesquaremodulusgivestheprobabilitytoobservetheobject:(T+V)ψ=EψP→i∂/∂x[−(22m)∂2/∂2x+V(x)]ψ=Eψψ∼eikx,k=2m(E−V(x))(6.3)ThekineticenergyisT,thepotentialisV,andEisnowthetotalenergyoftheparticle.Itdeterminesthewavefunctionψ(x).Theclassicalmomentum,P,becomesadifferentialoper-atorandtheoscillatorysolutionshaveawavenumber,k,pro-portionaltothesquarerootof(E−V).IfEislessthanV,thewavenumberiscomplexandthewavefunctionisexponen-tiallydamped.Thereisamoregeneralequationallowingfortimedependencewheretheenergy,E,isreplacedbytheoperator,i∂/∂t.Thesizesofquantumsystemscanbeestimatedbylookingatthebasicquantum,Planck’sreducedconstant,.TheelectronmassisexpressedinenergyunitsinEquation(6.4),whilePlanck’sreducedconstantisexpressedinenergy–lengthunits.Anappropriateatomiclengthscaleistheangstrom,10−10m.Subsequently,quantitiesscaledtoc,forexamplePc,willbewrittenasPandenergyunitsused.Thisiscustomaryandsimplifiestheformulae.Onecanrestoretheresultsbyinsertingclater.Forasystemcharacterizedbyasizeof

164November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06148OneHundredPhysicsVisualizationsUsingMATLABFigure6.2:Wavefunctionfora4eVelectroninaconstantpotentialof−2eV.oneangstrom,theenergyscaleisafeweV.c=2000eV˚Amc2=511000eVea=1˚A,c2/2mc2a2=3.9eV(6.4)eThescript“qmintro”setsupanelectronwith4eVkineticenergyandaskstheuserforapotential.Theresultingplotsforapoten-tialV=−2eVand10eVappearinFigures6.2and6.3.Notethatthewavenumberisnumericallythesameinthetwocases,0.81angstroms,since|E−V|is6eVineithercase.6.3.HydrogenAtomThereareonlyafewsolvableproblemsinquantummechanics.Oneofthemisthehydrogenatom,inanalogytotheKeplersolutioninclassicalmechanics.Thebindingenergydependsontheprincipalquantumnumber,n,astheinversesquare.Theatomicsize,a,riseswithn.TheoverallenergyscaleiseVandthecharacteristicsizeis

165November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics149Figure6.3:Wavefunctionfora4eVelectroninaconstantpotentialof10eV.theangstrom,˚A.Thefinestructureconstantisα=e2/c=1/137andisameasureofthestrengthofthebindingbytheCoulombpotential.Inthegroundstate,theenergyisEo=−13.6eVforanelectronwithmass,m,andcharge,e.Thespeedwithrespecttolight,β,issmall,sothatnon-relativisticmechanicsisappropriate.E=−mc2α2/2=−13.6eVoαo=/mcα=0.54˚AE=e2/2a,β=α(6.5)oTheexactsolutioncanbeevaluatedusingresultsinthelitera-tureandtheMATLABmfunLaguerre,mfun(‘L’,n,x).However,someimportantfeaturescanbefoundmoresimply.FirsttheSchr¨odingerequationinthreedimensionsforacentralforcehasasangularsolutionsthesphericalharmonics,Ym,whichwillbeshownlater.Theseangularsolutionsareappropriateforallcentralforcesandarethequantumanalogueoftheclassicalcentralforcemotioninaplanewithconservedangularmomentum.

166November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06150OneHundredPhysicsVisualizationsUsingMATLABThereisaneffectiveone-dimensionalequationofmotionaswasthecaseinclassicalmechanics.AcomparisontotheKeplerdiscus-sionprovidessomeinsight.Theequationatsmallrisdominatedbythecentrifugalpotentialwhichiseffectivelyarepulsiveinversecubeforce.Atlarger,thepotentialVfallswithr,sothattheenergyfactordominates.ψ∼(u/r)Ymd2u/d2−[(+1)/r2+2m(E−V)/2]u=0(6.6)Puttingthattogether,thebehaviorisapowerlawatsmallrdefinedbytheangularmomentumquantumnumberandafallingexponential(boundstatewithnegativeenergy)atlarger.ψ∼re−r/a0n(6.7)Theatomicwave-functionsareplottedusingthescript“qmHAtom”whichshowsenergylevelsandmeanradiiinFigure6.4andwavefunctionsinFigure6.5forthethreelowestenergyboundstates.Figure6.4:Meanradiusandenergylevelforthethreemostdeeplyboundhydro-genstates.

167November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics151Figure6.5:Probabilitydensityasafunctionofradiusforthethreelowestenergystatesinhydrogenwithzeroangularmomentum.Themeanradiusincreasesasn2reflectingthatthehighernstatesarelessdeeplyboundinthepotential.Notethat,inFigure6.5,thenumberofmaximaincreaseswithn.Sincetheoscillationraisesthemomentumwhichisproportionaltothederivativeofthewavefunction,thehighernstatesarelessdeeplybound.Indeedforthezeroangularmomentumstates,thenumberofoscillationsisjusttheprinciplequantumnumbern.6.4.PeriodicTable—IonizationPotentialandAtomicRadiusThereareatomicdatawhichgivegoodinsightsintotheunderly-ingquantumstructureoftheelements.AllofthecomplexityoftheperiodictableiscontainedinthesimplicityofthehydrogenatomsolutionandtheFermiexclusionprinciple.Itisawonderfulthingthatchemistrycanbesosimplyunderstood,atleastinbroadbrushstrokes.Someofthedataarepresentedbythescript“qmAtomPeriodicTab”.Plotsofthefirstionizationpotentialandatomic

168November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06152OneHundredPhysicsVisualizationsUsingMATLABFigure6.6:Ionizationpotential(first)asafunctionofZ.radiusaredisplayed.TheionizationpotentialhasacharacteristicstructureasafunctionofatomicnumberZandisdisplayedinFigure6.6.Themeanatomicradius,measuredusingscatteringdataandarenotnumericallythesameastheradiusmentionedabove,isshowninFigure6.7.Forahydrogen-likeatomwithatomicnumberZandignoringatomicscreeningofthechargeZbyinterveningelectrons:E=EZ2/n2oa=a/Z,r=an2(6.8)oThesubscriptreferstothehydrogenatom,asinEquation(6.5).ThebehaviorcanbeunderstoodasduetothefillingofatomicenergylevelsconsistentwiththeFermiexclusionprincipleandwiththelowestenergystatesbeingfilledfirst.Forl=0,onlytwospinpairedelectronsarepossible.Forl=1,therearethreepossibleangu-larmomentumprojectionsspecifiedbym=−1,0and1whichallowsforuptosixelectrons,whileforl=2therearetenelectronstatespossible,usingthefivepossiblemvalues−2,−1,0,1,2.Asforthe

169November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics153Figure6.7:AtomicradiusasafunctionofZ.energetics,theenergyshouldscaleapproximatelyas(Z/n)2,whiletheradiusshouldscaleasn2/Z.Theexpectedstatefillingsequenceis:(1s)2(2s)2(2p)6(3s)2(3p)6Forhistoricalreasonsthesandpnotationreferstol=0and1,respectively.Theexponentreferstothenumberofelectronsinthatstateand1,2and3refertothequantumnumbern.The1s“shell”closeswithanoblegas,helium.The2sshellstartswithalooselyboundelectron—ametallithium.The2pshellisalmostfullatfluorine,abase,andcloseswithneon,anothernoblegas.The3sshellbeginswithametal,sodium.The3pshellisalmostclosedwithchlorine,anotherstrongbase,andcloseswithargon.Clearly,muchoftheperiodictablecanbeunderstoodonthebasisoftheenergystatesofthehydrogenatom,althoughthedetailsarecomputationallychallenging.Itisimportanttoobservethatthepropertiesofcomplexatomscanbecalculatedveryaccurately.Letusexplorethelowestordercorrections.Taketheheliumatomasthesimplestcase.Theenergy

170November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06154OneHundredPhysicsVisualizationsUsingMATLABofasingleelectronboundtoanucleuswithZprotonsisgiveninEquation(6.8).Withtwonon-interactingelectrons,theenergyoftheheliumgroundstatewouldbeeighttimesthatforhydrogen,or−109eV.Experimentallyitis−79eV.Thereisanenergyshiftduetothemutualrepulsionoftheelectronswhichcanbeestimatedusinghydrogenicwavefunctionsandquantumperturbationtheorytobe∆E∼5/8(Zα/ao)or34eVforhelium,changingthebindingenergyto−74.8eVwhichisclosetotheobservedvalue.Theeffectoftheelectronsscreeningofthenuclearchargehasnotbeentakenintoaccountyet.Avariationalapproachtotheproblem,lettingtheeffec-tiveZvary,leadstoanestimateofthebindingenergyof−77.4eVwhichisanimprovementandaneffectiveZvalueof1.69isobtainedwhichshowsthescreeningeffect.ComparingtoFigure6.6whichplotsthefirstionizationpotentialof24.6eV,the79eVbindingenergyshouldbeadjustedfortheenergyafteroneelectronisremoved,Z=2,andtheonceionizedbindingenergyis54.4eV.Theionizationpotentialisthenestimatedtobe24.6eV.Lithium,assumingperfectscreeningbythetwo1selectronswillhaveanionizationenergyofabout3.4eVinthen=2hydrogenicstate.Lithium,seeFigure6.6,isobservedtobemoredeeplybound,5.4eV,whichmeanstheeffectiveZis1.26ratherthanoneduetoscreeningbythe1selectrons.ThesizeofhydrogenisroughlytheBohrradius,0.54angstroms.Forlithium,withperfectscreening,aradiusof1.55angstromsisexpectedwhichisclosetothepointinFigure6.7.Otheratomscanbeexploredandwithmoderncompu-tationaltools,modelsofanyneededaccuracyareavailable.6.5.SimpleHarmonicOscillatorThesimpleharmonicoscillatorisalsoasolvableproblem.Itis,inaddition,ausefulapproximationtothegeneralcaseofthelowestboundstateofaquantumsystem,sincetheTaylorexpansionabouttheminimumofanarbitrarypotentialyieldsanoscillatorpoten-tial.TheexactnumericalsolutionisavailableusingtheMATLABmfun(‘H’,n,x)forevaluatingtheHermitepolynomialswhicharethe

171November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics155solutions.However,somegeneralcharacteristicscanagainbefoundbylookingattheSchr¨odingerequationatlargedisplacements.Thequadraticpotentialis:F=−kx,V=kx2/2=mω2x2/2(6.9)ThepotentialtermintheSchr¨odingerequationdominatesatlargex,leadingtoaGaussiancomponentofthewavefunctioninonedimension.Thisbehaviorensuresthatthestateisboundbythepotential.1/a=mω/ψ∼e−x2/2a2(6.10)TheexactwavefunctionsforthelowestthreestatesareshowninFigure6.8.Asinothercases,theincreasingenergywiththeprinciplequantumnumbernisduetotheincreasingnumberofoscillations,ortheincreasingmomentum.Figure6.8:Squareoftheharmonicoscillatorwavefunctionsinonedimensionforthethreelowestenergyboundstates.

172November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06156OneHundredPhysicsVisualizationsUsingMATLAB6.6.OtherForceLawsItisofinteresttotrytoconnecttheobservedspectroscopyofenergylevelstotheunderlyingforcelaw.Thehydrogenatomhasa1/rpotentialwhichleadstoenergieswhichgoas1/n2.Theharmonicoscillatorhasax2potentialwhichleadstoenergylevelstogoasn.OthercasesareestimatedbyrequiringthatthedeBrogliewavelengthcorrespondingtoacircularorbitofradiusrcontainanintegralnum-berofphaseadvancesinordertosetupastablestandingwave.Forapowerlawpotential,theenergyisthenminimizedwithrespecttotheradialvariable,r,whichyieldsanestimateofthequantizedenergylevelsandthesystemsize.Thisprocedureisnotrigorousanditonlymeanttobeindicative.Theresultsforthiscalculationaredisplayedinthescript“qmforcelaw”andausermenuallowsforalookatotherpowerlawpotentials.λ=/p=r/nV=α/rbr=(n2/mαb)γ,γ=1/(2−b)E=n−2bγmbγα2γ(6.11)TheprintoutfortheCoulombforceandthesimpleharmonicoscillatorisshowninFigure6.9.Theexamplesofthehydrogenatomandtheharmonicoscillatorareprintedout,asisthegeneralsolution.Notethatthisprocedureisnotexact,butisheuristic.TheresultofthisexerciseforaCoulombpotentialisa∼n2/αm,E∼mα2/n2whichagreeswiththeexactsolution.Theusercantryseveralotherforcelawsinordertoseehowtheenergylevelschange.6.7.DeepSquareWellContinuingwiththestudyofboundstates,considerthecaseofaonedimensionalwellwithveryhighpotentialsides,oraverydeepwell.Thewavefunctionmustvanishatthewellboundaries,locatedatx=aand−a,whichlimitsthewavelengthstoquantizedvalues.

173November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics157Figure6.9:Printoutforthesizeandenergylevelsforthegeneralcaseofanarbitraryforcelawfortwoknownspecialcases.Thisisformallythesamerequirementaswasseenalreadyinthe“pluckedstring”exercise.ka=nπ/2E=2k2/2m=2/2m(nπ/2a)2(6.12)Theenergylevelsgoasn2.Thescript“qminfbox”hasadia-loguewiththeuserwheretheuserchoosesawellsizeandthescriptreturnsthegroundstateenergyandaplotofthethreelowestenergywavefunctions.TheresultsforawellofsizefourangstromsfullwidthisshowninFigure6.10.

174November22,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06158OneHundredPhysicsVisualizationsUsingMATLABFigure6.10:Wavefunctionsforadeeppotentialwellofsizefourangstromsfullwidth.Thenumberofoscillationsinsidethewellincreaseswithn,thusincreasingtheenergy.6.8.ShallowSquareWellTheverydeepwellisausefulfirstapproximationtothemoreprac-ticalproblemofawelloffinitedepth.Inthatcase,therearenotaninfinitenumberofboundstates.Indeed,itmaybeforalocalizedandshallowwellthattherearenopossiblestableboundstates.Theboundstatesolutionhasexponentialbehavioroutsidethewellandoscillatorybehaviorinside.Thewavefunctionanditsderiva-tivearematchedonthewellboundariesandthatrequirementquan-tizestheenergies.ForV=0insidethewellandV=Vo>0outside,theboundenergyis,0ao(K)2=2mE,|x|

175November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics159Figure6.11:Printoutofthescript“qminwell2”fortheexampleofawelloffullwidth4Aandadepthof5eV.Thematchingisdistinctforodd(sinelike)andeven(cosinelike)interiorsolutions.Theproblemisexploredusingthescript“qminwell2”.ThescriptusestheinfinitesquarewellenergiesasastartingvalueandimposesmatchingboundaryconditionsontheinterioroscillatorysolutionsandtheexternalexponentiallydampedsolutionstofindtheboundstateenergiesusingtheMATLABfunc-tion“fminsearch”.TheprintoutforanexampleisshowninFig-ure6.11.Theusersuppliesawellsizeandawelldepth.Thescriptcomputestheenergiesofthefirsttwolowestenergies,iftheyexist,plotsthemasinFigure6.12andplotsthewavefunctionofthelowestenergystate,asseeninFigure6.13.Thelowestenergystateisevenwhilethefirstexcitedstateisodd.Itisinstructivefortheusertovarythedepthandsizeofthewellinordertoseewhenaboundstatebecomesimpossibleduetothewellbeingtoonarrowortooshallow.Forexample,witha4-angstromfullwidth,afirstexcitedstatejustbecomespossibleforawelldepth>2.95eV.6.9.WavePacketsAwavefunctionwithaprecisemomentum,ψ=e±ikx,aplanewave,istotallyun-localizedsincethemodulusisthesameatallspatialpoints.Conversely,acompletelylocalizedwavefunctioncontainsallfrequencies.Thatisaconsequenceofthefundamentaluncertaintyprincipleinquantummechanics,dkdx∼1,dEdt∼.Aclassical

176November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06160OneHundredPhysicsVisualizationsUsingMATLABFigure6.12:Energylevelsforthelowesttwoboundstatesforaninfinitewellandthewelloffullwidth4angstromsanddepth5eV.Figure6.13:Wavefunctionsforthelowestboundstateforaninfinitewellandthewelloffullwidth4angstromsanddepth5eV.

177November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics161particlecanbeapproximatedbyasuperpositionofwaveslocalizedinbothpositionandmomentumwithlocalizationconsistentwithquantumlimitations.Aspatiallylocalizedwavepacket,withaspreaddx,whichcon-tainsaspreadoffrequencies,dk∼1/dx,canbepartiallylocalized.Thispacketwillspreadspatiallyintimebecauseoftheuncertaintyrelationship.Thecharacteristictimeofspreadingisdt∼/dE,dE=(c)2(dk)2/(2mec2).Nevertheless,thewavepacketisausefulapprox-imationtotheclassicalbehaviorofaparticle.Thecharacteristictimeofpacketspreadingissetbyandisequalto0.66,withenergyineVunitsof10−15sec.Lightgoes3000angstromsinthistime,soapacketwithv/cof0.01willgoabout30angstroms.ThisunitoftimeisadoptedinwhatfollowswhenthetimedevelopmentofasystemisexploredusingMATLABtomakemoviesofsystems.Thescript“qmWavePak”setsupawavepacketbasedonuserinput.AnexampleoftheuserdialogueisshowninFigure6.14.Theinputparametersareaspatialspread,dx,andawavepacketcentralwavenumbervalue,k.Giventhatthemomentumspreadfollowsfromtheuncertaintyrelationtheenergyspreadisalsofixed.Theenergyspreadsetsthetimeforthespreadingofthepacket.Thepacketis:ψ∼e−[(x−)/2dx]2eikx(6.14)Thevelocitysetsthesizeofthewavenumber,k=250−12β(˚A),E(eV)=3.9k.ThesewavepacketswillthenbeusedtoFigure6.14:Userdialogueandprintoutforthescript“qmWavePak”.Atypicalatomicstatewithsizeofabout1angstromandspeedofabout1/100thatoflightisusedinthisexample.

178November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06162OneHundredPhysicsVisualizationsUsingMATLABFigure6.15:Wavepacketprobabilitydensityforthespecificcasedx=1˚A,x=0andv/c=0.1fortime,t=0.studythebehaviorofboundstatesorfreeparticles(V=0)andareusedastheprobesfornumericalscatteringandboundstateexercises.AnexamplepacketappearsinFigure6.15fortimeequaltozero.6.10.NumericalSolutionforBoundStatesBoundstatesareprobedwithwavepacket“particles”inthescript“PDESchWellSHO”.Afreeparticlecanbestudiedasaspecialcaseofawellwithzeropotential.Generally,auserdefinesawidthanddepth.Theharmonicoscillatorpotentialcanalsobesetupwiththewavepacketboundneartheorigin.TheMATLABpartialdifferentialequationfunction“pdepe”isusedinanalogytotheuseofthepackagewiththeheatequation.Theuserissuppliedwithamovieofthesubsequentmotionofthewavepacketwhichtheuserhasspecifiedintheinitialdialogue.Thepackethasanenergyof5eVandx=0,startingatthecenterofapotentialwell.Theuserspecifiesapacketwidthandvelocity.

179November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics163Figure6.16:Lastmovieframeforafairlydeeplyboundwavepacket.Thewellextendsfor|x|<5˚Aandis20eVdeep.Thewellpotentialiszeroinside|x|

180November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06164OneHundredPhysicsVisualizationsUsingMATLABFigure6.17:Lastmovieframeforafairlydeeplyboundwavepacket.Thehar-monicpotentialissetwithalargek,k=2,whichcontainsthepacketinlocationsnearthex=0origin.6.11.ScatteringOffaPotentialStepPreviouslythefocushasbeenonboundstates,usingbothanalyticandnumericalmethods.Nowthereisashifttoscatteringstateswhicharenotlocalizedinspace.Thesestatescanbeusedtoprobetheforceswhichactonthem.Thesimplestexampleisthechangeinaconstantpotential,Vo.Thealgebraisinexactanalogytothechangeinindexofrefractionataninterfaceinoptics,atnormalincidence.√Theindexofrefractionisdefinedbythepotential,n∼E−V.Ifnbecomescomplex,thentheanalogyistoametalinopticsandthereflectionistotal.ComparingtoFigure4.17,theresultsareexactlythesamewithn=1−Vo/E.Thisillustratesthedeepconnectionsbetweenwaveopticsandquantummechanics.Thesolutionsforinci-dentenergy,E,bothforElessthanthebarrierheightandabovethebarrierare:k=2m(E−Vo)/K=2m(Vo−E)/1+r=t,t=2k/(k+K),t=2k/(k+iK)(6.15)

181November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics165Figure6.18:Incident,reflectedandtransmittedwavesfora6eVelectroninci-dentonasteppotentialof5eV.ForEgreaterthanVo,solutionsareoscillatorywithwavenumberk.ForElessthanVo,thesolutionsaredampedexponentiallywithlengthparameterequalto1/K.Matchingthewavefunctionsandthederivatives(continuityofprobabilityandmomentum)atthebound-ary,x=0,leadstothesolutionsforthereflectedwavefunctionamplituderandthetransmittedwaveamplitudetattheboundary.Theresultfora6eVelectronincidentona5eVpotentialisgiveninFigure6.18.Thematchingofthesolutionsatx=0isclearinFigure6.18.However,thesearecomplexfunctionssothatthereflectioncoefficientR=|r|2islessthanoneasisthetransmissioncoefficientT.Thesituationforastepof4eVisshowninFigure6.19.Inthiscase,thesolutionforx>0isexponentiallydecreasing.Thisplotillustratesthematchingattheboundary.However,itisverymislead-ing.Thereflectioncoefficientis,infact,equaltooneand,althoughanincidentwavewouldpenetrateintotheregionx>0forashortperiodoftime,itisultimatelytotallyreflected.ThisfactisreflectedinFigure6.20whichdisplaystheRandTvaluesfordifferentenergy

182November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06166OneHundredPhysicsVisualizationsUsingMATLABFigure6.19:Incident,reflectedandtransmittedwavesonasteppotentialof5eVbya4eVelectron.Figure6.20:ReflectionandtransmissioncoefficientsforawaveofenergyEincidentonastepofpotentialVo.

183November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics167wavesincidentonthestep.NotethatRisequaltooneforElessthanVo.Thescriptisfoundin“qmstep”.Theuserhasachoiceoftheenergyoftheparticleincidentfromx<0.Thepotentialisfixedat5eV.Classically,thereisperfecttransmissionforE>Vo,but,duetothequantumwavebehavior,thereisaregionofEgreaterthanVobutneartoitwherethereflectioncoefficientisnotzero.Thisbehaviorisfamiliarfromwaveoptics.6.12.ScatteringOffaPotentialWellorBarrierThenextlevelofcomplexityistoscatteroffawellwithafinitewidth.Thissituationisconsideredinthescript“qmtunn”.Themostinterestingcaseisprobablytheoneof“tunneling”whereclassicallythebarrieristoohightobepenetratedbutinquantummechanicstheexponentiallyfallingsolutionscan,withsomeprobability,penetratethebarrier.Thewaveisincidentfromtheleft.Thereisareflectedwave,ingeneral.Insidethewell/barriertherearewaveswithwavenumberK[Equation(6.15)].Exitingthepotentialregionontheright,thereisatransmittedwave.Thesolutionsforthesewaveamplitudesfollowfrommatchingthewavefunctionanditsderivativeatthetwobound-aries,inanextensionofthetechniqueusedforthesteppotential.Therearetwolimitingcasesofinterest.Inthecaseofabarrierwithheightabovethewavefunctionenergy,thetransmissioncoef-ficientdependsexponentiallyonthewidthofthebarrierandthewavenumberinthebarrierregion.ThemostimportantfactoristheexponentialdecreaseofTwithtunnelingdistancea,althoughotherpowerlawbehaviorispresent:T∼e−2Ka(6.16)Thisphenomenonisknownas“tunnelingthrough”abarrier.Itiscrucial,forexample,intheCoulombbarriersthatretardfusionbecauseoftherepulsiveCoulombforcesbetweenpositivelychargednuclei.TheSunworksonlybecauseitoperatesatanenormoustem-peraturewhichgivessufficientthermalkineticenergytothenuclei

184November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06168OneHundredPhysicsVisualizationsUsingMATLABtoovercomethesebarriers.OnEarth,thereactionswhicharebeingattemptedforfusionreactorsoralreadyachievedinfusionweapons,arethefusionofdeuteriumandtritium.H2+He3→He4+n(17.6MeV)111H2+H2→H3+p(4MeV)(6.17)111Thereisanotherinterestinglimitwhichoccursforpotentialwellsratherthanbarrierpenetration.ItiscalledtheRamsauereffect,whenthereisperfecttransmissionforanincomingwaveoffixedwavenum-berk.Itoccursbecauseofphasechangesforreflectedwaveswhichmakeitpossibleforthereflectedwavestobecancelledout.TheRamsauerrelationshipforincomingenergyE,wellpotentialVoandfullwellwidthacorrespondstoanenergyforaboundstateinaninfinitewell:Ka=nπE+V=2(nπ/a)2/2m(6.18)oTheRamsauertotaltransmissionisrelatedbydirectanalogytoanti-reflectionthinfilmcoatingsinoptics.Thereisaphasechangeuponreflection.Therefore,thereisadestructiveinterferencebetweenthewavesreflectedatthetwointerfaces.TheprintoutforaspecificexampleisshowninFigure6.21.Inthiscasethewellisathinbarrier,1eVhigherthantheelectronenergyand1˚Awide.Figure6.21:Printoutforthecaseofathinbarrier,ofwidth1˚Aandforabarrier1eVhigherthantheincidentwaveenergy.Thepandqaretheamplitudesinsidethewellwithpositiveandnegativexbehavior±Kx.

185November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics169Figure6.22:Electronof5eVincidentonabarrierofheight6eVextendingoverawidthof1˚A.Thesolutionwithinthebarrier,W,isexponentiallyfallingwithx.Thesolutionswhichmatchtheincident,reflectedandtransmit-tedwavesatthetwointerfacesareshowninFigure6.22.Indeed,thetransmittedwaveinsidethebarrierisexponentiallyfallingwithincreasingx.Thesurvivingwaveforlargexisagainoscillatory.AmapofthetransmissioncoefficientforarangeofconstantpotentialscoveringbothwellsandbarriersandwithdifferentwidthsforthepotentialisshowninFigure6.23.Thereisasteepfallinthetransmissioncoefficient,T,forbarriersabovethe5eVenergyoftheincidentwave.Thisfalloffissteeperasthewidthofthepotentialincreases,asexpected.Forpotentialwells,theRamsauerpointsofperfecttransmis-sionoccuratdifferentwellwidthsandwelldepths.Thesepointsareclearlyseeninthefigure.ThisisanotherconnectiontoopticssincethisconditionisexactlythatwhichappliesforaFabray–Perotinterferometer.6.13.WavePacketScatteringonaWellorBarrierThewavepacketswhichwerealreadyintroducedcan,inturn,bescatteredoffpotentialwellsorbarriers.Inthiscasethepacketis

186November20,201313:279inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06170OneHundredPhysicsVisualizationsUsingMATLABFigure6.23:Electronof5eVincidentonabarrier,Vo<0,orwell,Vo>0,extend-ingoverawidthofa(˚A).TheRamsauersolutionswithT=1areevident.notstartedatx=0,boundinapotential,butatx=−10˚A.Asbefore,amovieoftheevolutionofthewaveasitencountersthepotentialisprovided.Thereareseveraldistinctpossibilitiesavail-abletotheuser.Thestepcanbecheckedbymakingtheregionofthepotentialverywide.Forabarrier,themeanpacketenergycanbeaboveorbelowthebarrierheight.Forawell,theRamsauereffectcanbeexplored,althoughthewavenumberspreadofthepacketmakestheeffectsomewhatdiluted.Aspecificexampleisshownusingthescript,“PDESch”.Asbefore,theMATLABtool“pdepe”isusedtonumericallysolvetheSchr¨odingerequationwiththeinitialconditionsbeingthedefinedwavepacket.Theuserselectsawavepacket,inthisexam-ple,x=−10˚A,dx=1˚A,v/c=0.01.Thescatteringisoffabarrierofheight20eVextendingover5˚Afora5eVincidentelectron.Amovieisprovided,oneframeofwhichisshowninFigure6.24.Itisdifficulttodisplaythedetailsavailableinamovieortoseehowvary-ingtheparametersoftheproblemhelptobuildupinsight.Indeed,thatiswhytheexercisesareopenended.

187November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics171Figure6.24:Wavepacketscatteringoffabarrierofheight20eVandwidth5˚A.Thewaveislargelyreflectedbutaportionisextendingintothewellandwilltunnelthrough.Intheframeshown,thewavehasbeguntoencounterthepoten-tial,islargelyreflected,buthasaportionwhichispropagatingthroughthewellandwhichwillultimatelytunnelthroughtolargexvalues.Thesolutionsforapotentialwellareillustratedbyonespe-cificexampleofapacketscatteringoffawellof20eVdepthand2-angstromwidth.OneframeisshowninFigure6.25,whenthewavehasencounteredthepotentialandtheoscillatorybehaviorinsidethedeepwellbecomesevident.Theusershould“play”withthisscriptinordertoseetheeffectofchangingalltheparameters.Thetimedevelopmentofthesolutionsisinstructive.6.14.BornApproximation—ScatteringandForceLawsContinuingthestudyofscatteringstates,theBornapproxima-tioncanbeusedtocomputethescatteringamplitudeinthe

188November20,201310:509inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06172OneHundredPhysicsVisualizationsUsingMATLABFigure6.25:Wavepacketscatteringoffawellofdepth20eVandwidth2˚A.Thepackethasoscillatorybehaviorevidentinthepotentialwellregion.approximationthattheinitialstateisaplanewaveasisthefinalstate.Inthatcase,thescatteringamplitudeisessentiallytheFouriertransformofthescatteringpotential,V(r),intothemomentumtrans-fervariableq.∞A∼V(r)[sin(qr)/qr]r2dr(6.19)Born0TheBornamplitudeissetupbythescript“qmBornScatt3”.UseismadeofthesymbolicintegrationtoolinMATLAB“int”.Examplesaregivenintheprintout;asquarewellamplitudegoesastheinversethirdpowerofq,whileaCoulombpotentialgoesastheinversesquare,andascreenedCoulombgoesastheinverseofthesumofthesquaresofqandtheinverseofthescreeningcut-offlengtha.ThesquarewellamplitudeisplottedinFigure6.26.Theamplitudefallsrapidlyforqgreaterthana,thesizeofthewell.Thatfalloffistrueingeneralforanobjectofcharacteristicsizea.

189November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics173Figure6.26:Bornamplitudeforscatteringfromasquarewellofdepthainqaunits.Themomentumtransfer,q,isthevectordifferenceinwavenumberbetweentheincomingandoutgoingstate.Itassumeselasticscatteringandisdeterminedbytheincomingmomentum,P,andthescatteringangleθ.q2=2(p/)2(1−cosθ)=(P/)2sin2(θ/2)(6.20)InthecaseofaCoulombpotential,theamplitudeA(q)goesastheinversesquareofthemomentumtransfer.Ifthereisscreeningofthenuclearchargebytheatomicelectrons,thereisacutoffdistance,a,whichisonthescaleofthesizeoftheatom,whichisabout100,000timeslargerthanthesizeofthenucleus.Ignoringthesmallscreeningeffect,theRutherfordcrosssectionisobtained.V(r)∼e−r/a/rA(q)∼1/(q2+1/a2)dσ/dΩ∼|A(q)|2→1/sin4(θ/2)(6.21)

190November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06174OneHundredPhysicsVisualizationsUsingMATLABFigure6.27:Bornamplitudeforpowerlawpotentials—inversesquareandinversecube.Theinverse-cubicpotentialgivestheamplitudewiththelargestvalueathighqvalues.Theuserisgivenachoiceofseveralpotentials.TheBornampli-tudeisthenevaluatednumericallyusingtheMATLABtoolfornumericalintegration,“quad”.Theusershouldtrydifferentscat-teringforcelaws.TheresultsforpotentialsgoingastwopowerlawsareshowninFigure6.27—forinversesquareandinversecubepoten-tials.Themoresingularpowerlaws,suchasinversecubic,haveanamplitudethatextendstohigherqvalues.Generallymoresingu-larpotentialssupporthighermomentumtransfers,allowingonetodifferentiatebetweendifferentforcelawsbystudyingthescatteringangulardistributions.6.15.SphericalHarmonics—3DTheSchr¨odingerequationinthreedimensionsforcentralforceshasacommonsetofangularsolutions.Thisfeaturehasasitsanaloguethefactthatcentralforceshaveaconservedangularmomentuminclassicalmechanics.Thesolutionsarecharacterizedbyaquantumnumberspecifyingtheangularmomentum,,andaquantumnumber

191November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics175specifyingtheprojectionoftheangularmomentumontothezaxis,m.Afewplotsofthelowvaluesofthesefunctionsareprovidedbythescript“qmYlm2”andaredisplayedinFigure6.28.MATLABdoesnotprovideasymbolicfunctiontoevaluatethefunctions.Thereare+1maximaseeninFigure6.28forthem=0state.For=m,thereisonlyasinglemaximum.Surfacesofthesphericalharmonicsfor=2andm=0and2areshowninFigure6.29.Thescriptsuppliesplotsofalltheharmonicsfor<3.Figure6.28:Contoursofthesphericalharmonicsfor=1states(left)and=2states(right)inthe(x,z)plane.01Figure6.29:SurfacesforthesphericalharmonicsforY2(left)andY2(right).

192November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06176OneHundredPhysicsVisualizationsUsingMATLAB6.16.FreeParticlein3DAfreeparticleinthreedimensionsisthesimplestextensionoftheplanewavescatteringstateinonedimension.Inthecaseofasphericallysymmetricsituation,thebestapproachistoexploitthesphericalsymmetryandusetheangularsolution,Ym.TheradialSchr¨odingerequationisthen:d2u/d2r−u(+1)/r2+k2u=0(6.22)Thetermsintheradialequationaretheradialkineticenergy,theeffectiverepulsiveinversesquarecentrifugalpotentialproportionaltothesquareoftheangularmomentum,andtheenergyofthestate,setbythewavenumberk.TheconnectionstotheclassicalKeplerproblemshouldbenoted.Thesolutionsareknownandaredisplayedinthescript“qmSchro3dJ”.ThesolutionscanbefoundsymbolicallyinMAT-LABusingthefunction“dsolve”forEquation(6.22).ThesolutionsareBesselfunctions,whicharesymbolicallyavailableusingtheMAT-LABfunction“besselj(n,x)”j(z)=π/2zJ+1/2(z)(6.23)Thewavefunctionsarethenfoundasu(k)andthefullsolutionistheproductofthesphericalharmonicsappropriatetoacentral,orno,forceandtheBesselfunctionsforthefreeparticlecase.GenerallyJisappropriateforcylindricalgeometries,whilejisappropriateforsphericalgeometries.√u(r)=rJ(+1/2)(kr)√k=2mE/cψ=[u(r)/r]Ym(6.24)lTheresultsofthesymbolicprintoutareshowninFigure6.30.Explicitsolutionsareprovidedforthe=0,1cases.ThesesolutionsareplottedinFigure6.31.Itisseenthatthehighersolutionsarepushedawayfromtheoriginbythecen-trifugalpotentialasexpected.TheBesselfunctionsarefunctions

193November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics177Figure6.30:SymbolicprintoutforthesolutionsofthefreeparticleSchr¨odingerequationinthreedimensions.Figure6.31:Probabilitydensityforthelowestthreeangularmomentumvaluesforafreeparticlemovinginthreedimensions,withm=0.

194November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06178OneHundredPhysicsVisualizationsUsingMATLABofcosandsinandpowersofr.TheirexplicitformscanbefoundsymbolicallyinMATLABbydeclaringxsymbolic,symsx,andthentyping,forexample,besselj(1/2,x)intheCommandWindow.Theresultis(2∧(1/2)∗sin(x))/(pi∧(1/2)∗x∧(1/2)),whichappearsinFigure6.30.6.17.RadioactiveDecay—FittingWiththediscoveryofradioactivedecays,itbecameclearthatelementswereunstableandcouldtransmute.Soonafternucleartransmutationwasestablishedexperimentallyusingneutronbom-bardmentandbyothermeans.Itisapredictionofquantummechanicsthatsuchdecaysfollowanexponentialbehaviorintimewithalifetimewhichischaracteristicoftheparticulardynamics.Thescript“RadioactiveDecay”usestheMATLABfunction“rand”tosimulatedecaysbycreatingadatamodelofdecaytimeswithafixedlifetime.Randomnumbersareakeyelementinmak-ingdetailedmodelsofprocesses,usingwhatiscalledthe“MonteCarlo”method.AsimplescripttogeneratedecaytimestwithunitlifetimeandplotthemisshownbelowinEquation(6.25).TheusercanenterthisscripteasilyusingtheCommandWindow.Otherfunc-tionaldependenciesarepossibleand,ifinterested,theusercantrytogenerateafew.>>fori=1:1000t(i)=−log(rand);end>>[n,t]=hist(t,50);>>semilogy(t,n,−o)(6.25)Theuserisfirstaskedtopickalifetimeforthesample.Ahis-togramoftheresultsofchoosingalifetimeoftenyearsisshowninFigure6.32.Theexponential,withinthestatisticsofthesampleofonethousanddecays,isastraightlineonasemilogplot.TheerrorsshowninFigure6.32arethesquarerootofthenumberof

195November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch066.QuantumMechanics179Figure6.32:Histogramof1000simulateddecaytimesforasamplewithalife-timeof10years.Figure6.33:ResultsofusingtheMATLABfittingpackage.Topfigureisthehistogramdataplottedasthelogofthebincontents.Thefitistoastraightlineandtheslopeis0.11.

196November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch06180OneHundredPhysicsVisualizationsUsingMATLABeventsintherespectivehistogrambin.TheMATLABsimplefittingtoolisusedagaintofitastraightlinetothelogplotofthesimulateddecayhistogram.Theresult,showninFigure6.33,is0.11/yroralifetimeof∼9years.Ifmoreeventswereused,orifthestatisticalerrorsweremoreproperlyusedtoweightthefit,seeSection6.1,theresultwouldbeabitclosertotheexpectedvalueoftenyears.

197November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07181Chapter7SpecialandGeneralRelativity“Timeisanillusion.”—AlbertEinstein“Insomesense,gravitydoesnotexist;whatmovestheplanetsandthestarsisthedistortionofspaceandtime.”—MichioKakuRelativitycoversextremesituations,farremovedfrom‘normal”life.Eitherthespeedsinvolvedarenearthatoflight,specialtheory,orthegravitationalfieldsareverystrong,generaltheory.Insuchcases,acomparisontopriorclassicaldemonstrations,suchasrocketmotionorKeplerianorbitscanbemadewhichbringsoutthesalientdifferences.However,thisisnottosaythatrelativityisnotimportantinoureverydaylives.Topickoneexample,ourannualbackgrounddoseofradiationislargelyduetocosmicraymuonsattheEarth’ssurface.Thedoseisduetomuonsdepositingionizationenergy.Themuonsareproducedhighintheatmosphere.Atresttheyhavealifetimeof2.2µs.Iftheyhadavelocityofc,classicallythemuonswouldonlygoadistanceof660mbeforedecayingintoelectrons.Infact,wearebombardedbymuonsandthatissobecauseofrelativistictimedilation.7.1.TimeDilationThebasicpostulateofthespecialtheoryofrelativityisthatlighthasthesamespeed,c,inallreferenceframesmovingwithuniformvelocitywithrespecttooneanother.Thisthen,immediatelyleadstotimedilation,whereatimeintervalTinaframewhereaclockmoveswithvelocityv/c=βislargerthanthetimemeasuredona

198November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07182OneHundredPhysicsVisualizationsUsingMATLABclockatrest,thepropertimeTo.Thepropertimeismeasuredonasingleclock,whilethetimeintheframewheretheclockmovesismeasuredbydifferentobserverslocatedatdifferentspatialpoints,whouseasynchronizedarrayofclocks.T=Toγγ=1/1−β2β=ν/c(7.1)Asimple“proof”oftimedilationisprovidedinthescript“SRTimeDilate”whichusesaclockconsistingofalightflasherandamirror.Intherestframeoftheclock,thetimeTois2L/cwhereListhedistancebetweentheclockandthemirror.Intheframewheretheclockmoves,thelightmusttravelalongerdistance,butstillatthespeedc,sothatthetimeTinthatframeislargerthanthepropertime,T2=(2L/c)2+(βT)2.Thescriptmakestwomoviesfortheuser.Inthefirst,thelightgoestothemirrorandbackintheclockrestframe.Inthesecond,theclockmovesthroughtheframeandthetimeiscountedinclockticks.Theuserchoosesthevelocityinthatframe.ThelastframeforaspecificcaseisshowninFigure7.1.Thedistancetravelledbythelightflashisindicatedinthefigure,whichthengivesthetimedilationfactor.Theusershouldtryseveraldifferentvelocities.Inthespecificexample,thev/cvalueis0.9andthereare20clock“ticks”intherestframeand45inthemovingframe.The“observed”timedilationfactoris2.25,duetofiniteticksize,whilethecalculatedvalueis,Equation(7.1),2.29.7.2.RelativisticTravelThetimedilationeffectcanhavelargeconsequences.Considerthecaseofavehiclewhichhasauniformproperacceleration,inthiscasegsoastomakethetravelerscomfortable.Thevelocitychangeseenfromanobserveratrest,dv,canberelatedtothevelocitychangeintheframeofthevehicle,dv∗,dv/[1−(v/c)2]=dv∗usingtheLorentztransformationequationsfortimeandposition.

199November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity183Figure7.1:Thoughtexperimentfortimedilation.Ontheleftisthesituationintherestframeonthelastmovieframe.Ontherightthesituationintheframewheretheclockmovesisshown.Thealgebraofsuchatripisdisplayedinthescript“srrelrock”.Theuserpicksatraveltime,t∗,forthepassengers.Formally,themathematicsisthesameasthetrajectoryofachargedparticleinauniformelectricfield.Thereisaconstantproperaccelerationintherocketrestframeofg.Thevelocityanddistancetraveledandthetimeelapsedforthestayathomeobserversare:α=g/cβ=tanh(αt∗)γ=cosh(αt∗)t=sinh(αt∗)/αz=c[cosh(αt∗)−1]/α(7.2)Thenon-relativistic(NR)limitisthatv→gt∗,t→t∗andz→gt2/2sotheclassicalresultisrecovered.PrintoutfromthescriptisshowninFigure7.2.Foratwenty-yearvoyage,asexperiencedbythepassengers,439millionyearselapsedathomeandthepassengerswill

200November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07184OneHundredPhysicsVisualizationsUsingMATLABFigure7.2:Printoutforarocketunderconstantproperacceleration.travel439millionlightyears.Ofcourse,ithasnotbeenspecifiedhowtheaccelerationisachievednorhowthepassengersaretobeshieldedagainstthehighenergybombardmentbyinterstellardust.Still,itisawonderfulfactthatinterstellartravelispossibleinashorttimeforthepassengers.ThetriptimefortheathomeobserversasafunctionofthetimeforthepassengersisshowninFigure7.3.Asthevelocitybuildsup,Figure7.3:Triptimeforthepassengersvs.timeelapsedforthestayathomeobservers.Notethesemilogyscale.Classicallytimeisabsoluteandthesameindependentofspeedandtriptimeequalshometime.

201November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity185thetimedilationfactorcontinuestoincrease,leadingtotheenormoustimedifferencebetweenthetwosetsofpeople.Yes,interstellartravelispossiblebuttruly“youcan’tgohomeagain”.Figure7.4:Triptimeforthepassengersvsthespeedoftherocket.Theclassicalspeedisnotlimitedbylightspeed.InFigure7.4,thetripdistanceisshownforaclassicaltwentyyeartripandforarelativistictrip.Thereisnoclassical“speedlimit”,andv>cisnotforbidden.Eventhoughtheshipcanhaveaspeedgreaterthancclassically,theLorentzlengthcontractionisamuchlargerrelativisticeffect,allowingthetravelerstocoverimmensedistancesatspeedsclosetoc.7.3.TheRelativisticRocketThisstellartravelsoundsgreatbuthowisitaccomplished?Previ-ouslytheclassicalrocketwasdemonstratedaswellas“solarsailing”usinglightpressureaspossiblemethods.First,letuslookattherel-ativisticrocket.Itcanbethoughtofasanobjectofmass,m,which“decays”intoamass(m−dm)andanexhaustobjectmovingwithvelocityνo/c=βowithrespecttotherocket.Themodifiedrocket

202November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07186OneHundredPhysicsVisualizationsUsingMATLABequation,comparetoEquation(2.14)andEquation(2.15)intheclassicalrocketcase,andthefirstintegraloftheequationis:mdβ/dm=β/γ2oβ=(1−m/m)2βo/(1+m/m)2βo(7.3)ooThedifferentialequationapproachestheNRequationinthelimitoflowvelocity,dβ/dm→βo/m.Clearly,lightisthebestpropellant.Thereisaclosedformsolu-tionwhichispossibleforthevelocitybutnotfortheposition.Thevelocityisinitiallyzeroanditbuildsuptoavaluedefinedbytheexhaustvelocityandthepayloadratio.Withnopayload,thevelocitybecomesc.Printoutofthescript“srrocket3”isgiveninFigure7.5.Therocketequationisfirstsolvedsymbolicallyusing“dsolve”forthevelocityandthenintegratednumericallyusing“quad”toobtainthepositionspecifictotheuserinputforthepayloadratioandexhaustvelocity.Theuseralsosuppliesthemassburnratesothatthemassvariablecanbetranslatedintotime.Thescriptreturnsthevelocityattheendofthe“burn”.Figure7.5:Printoutforthescriptdescribingtherelativisticrocket.AsseenfromFigure7.5withareasonablepayloadratioandafancifullyoptimisticexhaustvelocity,arespectabletimedilation

203November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity187Figure7.6:TimedilationfactorofarocketasdefinedinFigure7.5asafunctionofthemassratio.factorcanbeachieved.TheplotofthegammafactorasafunctionofthemassremainingintherocketisshowninFigure7.6.Withahighenoughexhaustvelocity,stellartripsarepossible.7.4.ChargeinanElectricFieldAspecificrealizationofasituationwithuniformproperaccelerationoccursforachargedparticleimmersedinauniformelectricfield.Insteadofforce,inspecialrelativity,thereplacementoftheforcebythetimeratechangeofmomentumisoftenthecorrectmodifica-tiontoobtainrelativisticallycorrectequations.ThesolutionoftheequationsofmotioninonedimensionisshowninEquation(7.4).ThemomentumisP,theelectricfieldisE,a=qE/m,andthe√particleenergyisε=P2+m2.Themomentumincreaseslinearlywithtime.Ifatismuchlessthanone,theclassicalresultsarerecov-ered.Thescript“srEAccel”solvesforvelocityandpositionsymbol-icallyandcreatesplotsbothfortherelativisticandtheclassicalcases.ThevelocityplotisshowninFigure7.7.Thevelocityislimitedtoc

204November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07188OneHundredPhysicsVisualizationsUsingMATLABFigure7.7:Velocityasafunctionoftimeforachargedparticleinauniformelectricfield.inthecaseofrelativisticmechanics.NotethatinEquation(7.2),thetimet∗referredtothepassenger’srestframewhiletherereferstotheclocktimeintheframewherethechargemovesandhasmomentumofzeroatt=0.dP/dt=qEP=qEtβ=P/ε=at/(at)2+1a=qE/mz=a[(at)2+1−1](7.4)TheTaylorseriesfortheclassicalzresulthasafirstcorrectionterm,a3t4/8.7.5.ChargeinElectricandMagneticFieldsThemorecomplexcaseofbothelectricandmagneticfieldsinthreedimensionsistreatedinthescript“ExBODESR”.Again,the

205November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity189replacementisoftheforcebythetimeratechangeoftherelativisticexpressionformomentum.ThenotationisthesameaswasusedinSection7.4.TheequationsappearinEquation(7.5).ThisscriptistherelativisticgeneralizationofthatalreadydescribedinSection3ofthetext.dP/dt=q(E+νxB)β=P/ε=P/P2+M2dP/dt=q(E+PxB/ε)dx/dt=cP/ε(7.5)Whenthevelocityissmallwithrespecttoc,P→mν,ε→MandtheNRequationsarerecovered,thetimeratechangeofmomen-tumduetoamagneticfieldisnowlimitedbytheinverseenergyfactorwhichreplacestheNRmassfactor.Classically,theLarmorangularfrequencyofcircularrotationqB/mbecomesqB/γm,whiletheradiusofcircularmotiongoesfromvTm/qBtoPT/qBwherethesubscriptTmeanstransversetotheB-fielddirection.Therearepracticalramifications.Anacceleratorneedstochangethefrequencyofther.f.whichsuppliesenergytothebeamastheacceleratedparti-clesgainenergyandtheradiuscontinuestoincrease,requiringlargermagneticfieldvolumes,eventhoughthevelocityapproachesthelimitofc.Thescriptusesthe“ode45”MATLABtooltosolvethesixdifferentialequationsforthethreemomentumcomponentsandthethreepositionsaswasthecaseintheclassicaltreatment.Theunitsarechosensothatallquantitiesareoforderone.Theuserchoosesthethreeelectricfieldcomponents,themagneticfieldmagnitudeandthethreeinitialmomentumcomponents.Itisusefultostartbytryingspecialcaseswithonlyelectricoronlymagneticfields.Theexam-plewhichisplottedinFigure7.8andFigure7.9isforthechoicesE=[0.300.3],B=1,P=[1000].ThemomentumcomponentsareplottedinFigure7.8.ThePzstartsatzerobutisincreasedbyEz.ThePxstartsat10,increasesslightlyduetoExbutisalsocurvedbyBz.The(Px,Py)contourisshowninFigure7.9.Itiscircular

206November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07190OneHundredPhysicsVisualizationsUsingMATLABFigure7.8:PlotofPx,PyandPzasafunctionoftimeforaspecific,userdefined,example.Figure7.9:PlotofPxvsPyforaspecific,userdefined,example.Notethattheradiusofcurvatureinthemagneticfieldisnowdependentonthemomentumwhichincreaseswithtimeduetoaccelerationbytheelectricfield.

207November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity191duetoBzbuttheradiusofcurvaturedependsonthemomentumperpendiculartoBz,whichincreasesduetoExleadingtoaradiusofcurvaturewhichismomentumdependent.7.6.RelativisticScatteringandDecayTherelativisticallycorrectscatteringanddecaykinematicsarepro-videdinthescript“srdecscat”.Thesituationinclassicalmechan-icswaspreviouslydemonstratedinSection2ofthetext.Inthiscase,insteadoftheconservationofvectorvelocityandscalarkineticenergy,thevectormomentumandthescalartotalenergyarecon-served.Thesemodifiedconservationlawsdefinethekinematics.Therearetwocasesexploredhere.ForthedecayofaparticleofmassMintotwoparticlesofmassm,thecenterofmomentum,CM,quantitiesaresimply:MCM=M,βCM=P/ε,γCM=ε/Mε∗=M/2(7.6)TheCMenergyissimplythemassMparticle,andthedaughtersofmassmsharetheCMenergyequally.ThemassMparticlemovesinthelabframewithmomentumP.Inthesecondcaseofelasticscattering,m+M→m+M,theinitialstatehasatargetofmassMatrestandaprojectile,massm,movingwithmomentumPandenergyε.TheCMinthiscaseis:M2=m2+M2+2Mε,CMβCM=P/(ε+M),γCM=(ε+M)/MCMP∗=PM/M(7.7)CMTheCMquantitiesforfinalstateobjectsareindicatedbya∗superscript.Inbothcases,theyaredefinedbyasingle“scatter-ing/decayangle”,θ∗.MakingaLorentztransformationbacktothelaboratory:P=P∗sinθ∗TP=γ(P∗cosθ∗+βε∗)(7.8)LCMCM

208November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07192OneHundredPhysicsVisualizationsUsingMATLABFigure7.10:Scatteringofequalmassparticles.Theanglebetweenthescatteredprojectileandtherecoilingtargetislessthanninetydegreesforhighmomentumprojectiles.Asanexampleofadifferencefromtheclassicalsituation,forthescatteringofequalmassparticles,(m+M→m+MingeneralwithtargetmassM),theanglebetweentheoutgoingparticlesisnolongerninetydegreesasitwasintheNRcase.AnexampleisshowninFigure7.10.Inthisscript,a“movie”isprovidedillustratingthesituationforseveraldifferentscatteringangles.TheuserchoosesMandthemomentumoftheprojectile,massm.Thereisalsoachoicetoexplorescatteringordecays.Inrelativitymasscanbeconvertedintoenergy.Therefore,aheavyobjectcanconverttotwoormorelighterobjectsandalsoimpartmomentumtothem.Suchdecaysarenotpossibleinclassicalmechanicswheremassisindependentlyconserved.Anexampleofaparentwithmass,M=3,andmomentumP=5,decayingintotwodaughterparticleswithmass,m=1isshowninFigure7.11.Theprintoutgivesthemaximumangles.Themaximumofoneanglecor-respondstonearlytheminimumangleoftheother.Amovieisshownfordifferentdecayanglesinthelabframe.

209November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity193Figure7.11:CorrelationofthedecayangleswithrespecttotheparentdirectionforaparentwithM=3decayingintotwodaughterswithm=1.Theanglesarescaledtotheirmaximumattainedvalues.Figure7.12:Printoutforthespecificcaseofthedecayofaparentofmass,M=3,withlaboratorymomentum=5.TheuserdialogueforthecaseofparticledecayisshowninFigure7.12.WhenthemassMandmomentumofthedecayingpar-ticlearespecified,theonlyremainingvariableisthedecayangleintheCM.TheCMenergy,betaandgammaandthemomentumofthedaughters,m=1,intheCMarealreadyspecifiedbythekine-matics.Thescriptrunsoverallpossibledecayanglesinmakingtheplots.

210November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07194OneHundredPhysicsVisualizationsUsingMATLABItisveryusefulfortheusertovarytheparametersforbothscatteringanddecay.Inthisway,somefacilitywiththerangeofpossibleeffectscanbeattained.7.7.ElectricFieldofaMovingChargePreviously,thefocuswasonkinematicsinrelativity;timedilation,rockets,accelerationandscatteringordecay.Thefocusnowshiftstodynamics—thecollisionsbetweenparticles,theinteractionsbetweenthemandtheradiationarisingfromaccelerationwhenparticlesareinrelativisticmotion.Theelectricfieldofacharge,q,inuniformmotion,velocityv=cβdependsontheanglebetweenthevelocityandtheobservationpointatthepresentpositionofthecharge,θ,notthepositionwhenthelightwasemitted(theretardedposition).E∼[q(1−β2)/(1−β2sin2θ)3/2]r/r3(7.9)Thetransversefieldscalesasgamma,whilethelongitudinalfieldfallsastheinversesquareofgamma.Thenon-relativisticisotropicfieldisrecoveredatlowvelocity.Thefieldsareplottedinthescript“ESR”,wherefirsttheuserchoosesavelocity.Then,asshowninFigure7.13,contoursforarepresentativerangeofvelocitiesarecom-putedandplotted.ThelongitudinalfieldshrinksandthetransversefieldgrowswithvelocityasexpectedfromEquation(7.9).Inthelimitofhighlyrelativisticmotion,theelectricfieldlookslikea“pancake”orientedtransversetothedirectionofmotion.7.8.MinimumIonizingParticleAgainconsiderachargedparticlemovinguniformlyalongthezaxis.Theobservationpointischosentoapointfixedinspaceinthelabframeatfixedxwithyequaltozero.Thelongitudinalelectricfieldattheobservationpointintegratestozerobysymmetry.Thetransversefield,withincreasingvelocity,iscompressedintimebutincreasesinfieldstrength,leadingtoamomentumimpulse,qExdt,whichisconstant,independentofincidentparticlevelocityathighvelocities.Thismeansallfastparticlesimpartthesameenergy,independentof

211November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity195Figure7.13:Contoursoftheelectricfieldofauniformlymovingchargefordifferentβvalues.Figure7.14:Transversefieldsofamovingchargeobservedatthepointx=d,y=0=z.Atleftthechargemoveswithβ=0.1,whileatrightithasvelocity,β=0.95.velocity.ThetransversefieldfortwovelocitiesisshowninFigure7.14ascomputedinthescript“EMoveChargeSR”.Thefieldisplottedinthenaturalunitsofe/d2,whilethetimeisplottedinunitsofd/v.Inthecaseofslowvelocities,thefieldshouldbeofmagnitudeoneandpersistforatimeoforderone.Indeed,asseenintheleftmostplotinFigure7.14,withβ=0.1,thisexpectationisborneout.

212November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07196OneHundredPhysicsVisualizationsUsingMATLABAmovieofthemovingchargeisprovided,wherethevectorfromthechargetotheobservationpointisshowninblue,whiletheelectricfieldvectoratthepointisdisplayedinred.OneframeinthecasecorrespondingtotherightplotofFigure7.14appearsinFigure7.15.Figure7.15:Aframeofthemovieforachargedparticlewithβ=0.95whenthe∗chargeisneartheobservationpoint.Thebluelinegoesfromthecharge,blue,tothatpoint,whiletheredvectorshowsthesizeanddirectionoftheelectricfield.Athighvelocity,thetransversefieldgetsstronger(Section7.7),whilethetimeofactivity∆tshrinksasillustratedintherightplotofFigure7.14.Theresultisthatthemomentumimpulse∆Pimpartedbyfastparticlesisindependentofvelocity.Thetransferofkineticenergytotheobservationpoint∆Tapproachesaconstantasthevelocityapproachesc.Atlowvelocitiestheenergytransferisgreaterthanatlargevelocity,sothatfastparticlesare“minimumionizing”.∆t=b/v→b/γvF=e2/b2→γe2/b2∆P=e2/bv→e2/bc∆T=∆P2/2m=e4/4Tb2→e4/2mcb2(7.10)

213November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity1977.9.RangeandEnergyLossThekineticenergytransfergoesas1/Twhenβ<1,asshowninEquation(7.10).Forexamplea100MeVprotongoes5.35cminwaterbeforegivingupallitsenergyorwhatiscalledcomingtotheendofitsrange.Range,R,goesassquareofinitialkineticenergy,dT/dz∼r/T,whererisproportionaltotheminimumenergylossperunitdistance.T=To2−2rzR=T2/2r(7.11)oRangecalculationsaremadeforprotonsinwaterinthescript“RangeEnergy”.Theusersuppliesaninitialenergy.Resultsfora100MeVprotonareshowninFigures7.16and7.17.Theusercanmakeaseriesofchoices,asusual.Figure7.16:Kineticenergyofa100MeVprotoninwaterasafunctionofthedistancetravelled.Themajorityoftheprotonenergyisdepositedattheendoftherange,sincedT∼1/T.Thisfeatureisveryusefulinsomemed-icalapplications.Inprotontherapy,theinitialenergycanbeset

214November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07198OneHundredPhysicsVisualizationsUsingMATLABFigure7.17:Energydepositedbya100MeVprotoninwaterataspecificlocationasafunctionofthedistancetravelled.byacyclotroninordertotargetthedepositofionizationenergyforradiationtherapyataveryspecificlocation.Thisminimizesthedosegiventohealthyinterveningtissue.7.10.RelativisticRadiationIngeneral,theimportanceofradiationlossbyachargedparticleincreaseswiththevelocityoftheparticle.Energylossfromioniza-tionorotherprocessesdominatesatlowvelocities,butradiationtakesprecedenceathighvelocities,mirroringthegrowthoftheelec-tricandmagneticfieldsandtheeffectofrelativityinthecaseofradiation.Incomparison,ionizationapproachesaminimumasthevelocityincreasesandallparticlesbecomeminimumionizing.Theradiatedpowerdependsonthesquareoftheacceleration.IntheNRlimit,theradiatedpowergoesasa2sin2θ,whereaistheaccelerationandtheangleθisbetweentheobservationpointandtheacceleration.Theradiatedpower,definedtobephere,fortwospecialcases,accelerationparallel,L,tothevelocityandcircularmotionwithaccelerationperpendicular,T,tothevelocityhasthe

215November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity199angulardependence:dp/dΩ∼sin2θ/(1−βcosθ)5Ldp/dΩ∼1/(1−βcosθ)3[1−sin2θ/γ2(1−βcosθ)2](7.12)TInthecasewheretheaccelerationandthevelocityareparallel,theangleisasdefinedintheNRcase.Now,however,thereisanangle,θmax∼1/2γ,wheretheradiatedpowerisatamaximum.Ingeneral,thepowerisdirected“forward”,inthedirectionofthevelocityvector.ThetotalradiatedpowerislargerthanintheNRcasebyafactorofγ6fortheparallelcase.Inthecaseofcircularmotion,thevelocityistakentobealongthezaxis,whiletheaccelerationisalongthexaxis.ThedistributionshowninEquation(7.12)appliestothecasewheretheazimuthalangleφiszerosothatitappliesintheplanedefinedbythevelocityandaccelerationvectors.Thepowerinthiscaseisafactorγ4largerthantheNRpower.IntheNRlimitthedipolepatternisrecovered,but∼cos2θbecausetheangleisdefinedwithrespecttothevelocityandnottheacceleration.Thepowerspectraasafunctionofobservationanglearecomputedinthescript“RelRadiate”.Theuserpicksavelocitytoexamine.Attheendofthescriptafamilyofcurvesisgeneratedfordifferentvelocities.TheradiationpatterncontoursareshownforthetwospecialcasesinFigures7.18and7.19.Intheparallelcase,thelowvelocitylimitisafamiliardipolelikesin2θpattern.Thatpatternisdistortedandtippedforwardinthehighvelocitycase.Intheperpendicularcase,thepatternisalreadyforward—backwardsymmetricinthelowvelocitycase.Theeffectofhighvelocityistostrengthentheforwardradiationandshrinkitsangularextent.Theforwardgoingnatureofthepatternisageneralpropertyanditiscalledthe“searchlighteffect”intheliterature.7.11.ComptonScatteringConsiderfirstthesimplercaseofasourceoflightatrestinthestarredframe,S∗,andmovingwithvelocityβinasecondinertialframe,S.UsingtheLorentztransformationoftheenergyandlongitudinalmomentumofaphoton,thepurelykinematiceffectofSRisshown

216November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07200OneHundredPhysicsVisualizationsUsingMATLABFigure7.18:Parallelaccelerationangularpatternasafunctionofthesourcevelocity.Figure7.19:Perpendicularaccelerationangularpatternasafunctionofthesourcevelocity.

217November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity201inEquation(7.13),assumingthatthelightisisotropicintheS∗frame.P∗cosθ∗=γP(cosθ−β)P∗=γP(1−βcosθ)cosθ∗=(cosθ−β)/(1−βcosθ)dσ/dΩ=1/[γ2(1−βcosθ)2](7.13)ThisfactorwasseenalreadyinEquation(7.12)andispurelyofkinematicorigin.Comptonscatteringisthescatteringofaphotonoffanatomicelectron.Thelowvelocityangulardistributionwasmentionedpre-viouslyandiscalledThompsonscattering.Theangulardistributiongoesas:1+cos2θwhichisforward-backwardsymmetric.Athigherphotonenergies,muchlargerthantheelectronrestmass,thedistri-butionisthrownforward.TheComptoneffectwasoneofthefirstexperimentalindicationsoftheparticlenatureoflight.Sincelightcarriesenergyandmomen-tum,thenwhenitscattersoffanelectron,theelectronrecoilcantakeoffsignificantenergy.Theoutgoingphotonthenhaslostenergy,goingfromEoincidenttoEoutgoing.Theenergyrelationshipcanbedeterminedsolelybyapplyingparticlekinematicstothephotonandsolvingtheequationsexpressingtheconservationofenergyandmomentum.TheangulardistributionwasfirstworkedoutbyKleinandNishina,wheretheangleθistheangleoftheoutgoingphotonwithrespecttotheincidentphoton.y=E/Eo=1/[1+(Eo/m)(1−cosθ)]dσ/dΩ∼y2[y+1/y−(1−cos2θ)]/2(7.14)TheComptonangulardistributionisevaluatedinthescript“ComptonScat”.Theuserchoosesavelocityandthentheangu-lardistributionforasetofvelocitiesisplottedinFigure7.20.At10keV,thedistributionisquiteisotropic,whileat100MeV,roughly200timestheelectronmass,theforwardpeakofthephotonisveryprominent.TheNRlimitwheretheenergyismuchlessthanthe

218November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07202OneHundredPhysicsVisualizationsUsingMATLABFigure7.20:AngulardistributionofthephotonscatteringangleforComptonscatteringasafunctionofthephotonenergy.electronmassgivesy→1anddσ/dΩ→(1+cos2θ)/2whicharetheNRThompsonresults.7.12.PhotoelectricEffectThephotoelectriceffectdescribestheabsorptionofaphotonofenergy,ω,byanelectronboundinamaterialwithaworkfunction,Vo,andthesubsequentemissionoftheelectronwithenergyequaltoω−Vo.ThiseffectwasoneofthefirsttodisplaythequantumaspectsoflightandwascitedintheNobelPrizeofEinstein.Energyconservationimpliesthatω−Vo=P2/2m.Thephotoelectriceffecthasanangulardistributionwhichisalsoquitedependentontheenergyoftheincidentphoton.Thephotonhastransverseelectricfieldswhich,atlowenergies,exertforcesontheelectronsandpreferentiallyejectthematrightanglestothephoton.Withhigherenergyphotons,theangulardistributionfor

219November20,20139:289inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity203lightelements,Zα<<1,andinanunscreenedapproximationis:dσ/dΩ∼sin2θ/[(Zα)2+2E/mc2(1−βcosθ)]4→sin2θ/(1−βcosθ)4(7.15)Theangleθistheangleoftheejectedelectronwithrespecttotheincidentphotondirectionandβreferstotheelectronvelocity.Theangulardistributionisevaluatedinthescript“Photoelec-tric.”Asperusual,theuserchoosesanenergyandthentheangulardistributionforarepresentativesetofphotonenergiesiscomputed.TheresultingplotisshowninFigure7.21.Athighenergies,theejectedelectronsarethrownforward,whileatlowenergies,theelec-tronsareejectedinthedirectionofthetransverseelectricfieldsofthephoton.Figure7.21:Angulardistributionforelectronsemittedinthephotoelectriceffectfordifferentphotonenergies.7.13.ElectronsandMuonsinMaterialsThepassageofelectronsandheavyelectrons,ormuons,throughhighZmaterialshaspointsofinterest.Inthiscase,experimentaldatais

220November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07204OneHundredPhysicsVisualizationsUsingMATLABused.Thescriptis“HFMovieeu”.Thedatacomesfromworkdonewithbeamsofelectronsandmuonsincidentonablockofmaterialwhichisinstrumentedtosampletheenergydepositedasafunctionofthedepthintheblock.Thetotaldepthoftheblockis5inchesoflead.Thereare40sam-plesoftheenergy.Thescriptprovidesamovieofthepassageoftwentyelectronsof156GeV(1GeV=109eV)meanincidentenergy,then10muonsof15GeVenergy,followedby10muonsof240GeVenergy.PrintoutisshowninFigure7.22.Figure7.22:Printoutforthescripttostudyenergydepositsbyelectronsandmuons.TheelectronsinteractstronglybyradiatinganddepositessentiallyalltheirenergyintheblockasseeninFigure7.23.Theyareveryrelativisticwithagammafactorofabout156,000/0.511=305,000.Themuonshavemassesabout205timeslargerthantheelectronsand,therefore,asmallergammafactor.Muonsandelectronshavethesamechargeandthesameelectro-magneticinteractions.Theelectronsloseenergybyradiation.Acascadeofelectronsandphotonsdevelops,whichultimatelydepositsalltheelectronenergyintheblock.Sinceenergylossbyradiationisproportionaltoahighpowerofgamma,themuonsdonotradiateasmuch.Infact,theyserveasasampleofminimumionizingparticles,depositingmuchlessenergyintheblock.Asseenfromtheprintout,theelectronsdeposit150GeV,whilethemuonsof15and240GeVenergydepositalmostthesameenergyoflessthanoneGeV.Clearly,themuonsrepresentminimumionizingparticlesthatdepositthesameamountofenergyindependentoftheirownenergy,asexpected.

221November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity205Figure7.23:Energydepositfora156GeVelectronasafunctionofdepthinablockoflead.Thereare40plates,1/8thick,foratotalof5inches.Parenthetically,mostcosmicraysatthesurfaceoftheeartharemuonsbecausetheysurviveasminimallyionizingpartsofthecos-micrayshowers,whileelectronsareabsorbedintheatmosphereandbecausetheirdecaytimesaretimedilated,asmentionedpreviously.Theenergydepositfora15GeVmuonisshowninFigure7.24.Notethat,althoughtherearelargestatisticalfluctuations,thescaleofenergydepositsissmallcomparedtoFigure7.23.Aroughesti-mateisthatthemuonswilllose0.16GeVbyionizationintraversingtheblock.Themuonsarenottotallyabsorbedintheblock,whiletheelectronsare.Thisobservationshowsthatradiationisindeedparamountforrelativisticparticles.7.14.RadialGeodesicsInspecialrelativity(SR)relativemotionaffectedbothtimeandspace.Therewasaninvariantinterval,thepropertimeofaclockatrestinaframe,withtime,ds.Inaframewheretheclockmoved

222November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07206OneHundredPhysicsVisualizationsUsingMATLABFigure7.24:Energydepositfora15GeVmuonpassingthroughablockoflead.withavelocity,v,therewasatimeinterval,dt(ds)2=(cdt)2−(dx)2=(cdt/γ)2(7.16)InEquation(7.16),thebasictimedilationeffectisveryclear.Ingeneralrelativity(GR)gravityandmassareincorporatedintothemetricofspaceandtime,whereinSRthismetric,Equation(7.16),isEuclidian,or“flat”.Ingeneralrelativity(GR)massesdeterminethegeometryofspace-timeandthenparticlesmoveongeodesicsinthatnon-Euclidianspace-time.ThereareonlyafewsolvablesolutionsofthenonlinearGRfieldequationswhichrelatethemasstothemetric.Inaddition,GRisnonlinearsothatsolutionsarenotadditive.InthecaseofaSchwarzschildsolutionforanon-rotatingpointmass,M,themetricis:ds2=(cdt)2(1−r/r)−dr2/(1−r/r)−r2d2Ωssr=2GM/c2(7.17)s

223November20,20139:289inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity207Thismetricistheintervalbetweentwoeventslabeledbycoordinateclocktime,t,andrulerdistance,r.Themetricisspheri-callysymmetricbutthetemporalintervalandtheradialintervalarenon-Euclidian,withacharacteristiclengthcalledtheSchwarzschildradius,rs,determinedbythegravitationalcoupling,G,ofthepointmass,M.ThissolutionistheGRanalogueoftheclassicalpointparticlesolutionforamass,M,expressedasaGM/rpotential.Particlesmoveongeodesicsofthismetric.Thegeodesicisthepathofmaximalmetric,likeagreatcirclerouteonasphericalsurface.Inaflatspace,withnomasses,thegeodesicisastraightlinewhichisexpectedforafreeparticle.Weconsideronlyasim-plecasehere,radialmotionwithaninitiallocationroandinitialvelocitydr/dtequaltozero.Theintervalatlargerrs,istheSRintervalwithclocksandrulersofobserversatlarger.Inthespacedsreferstoproperclocks.Thesolutionstothegeodesicequa-tionsare:s=ds=ro/rsr/(ro−r)drct=cdt√=(r/r)(1−r/r)(r3/2/[r−r(r−r)])dr(7.18)ossoosThesolutionforthetrajectoryasafunctionofpropertime,s,turnsouttobetheclassicalsolution.Thesolutionintermsofcoor-dinatetime,t,hasadditionalfactors.Solutionsforbothtimemark-ersareconstructedinthescript“grschwarz”.Theuserchoosesaninitialradiusandamass,M,andthetrajectoriesarecom-putedandplotted.TheprintoutisshowninFigure7.25forthespecificchoiceoffoursolarmassesanddroppingfromrestataradiusoffiveSchwarzschildradii.Theequationsareintegratedusingatrivialnumericalapproach,althoughsymbolicsolutionsarepos-sible.Forexample,thetotalpropertimetoreachtheoriginis3/2πro/2rs.Indeed,dr/dsisclearlywellbehavedforallr,whiledr/dctapproacheszeroasr→rs.

224November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07208OneHundredPhysicsVisualizationsUsingMATLABFigure7.25:Printoutforthescript“grschwarz”.Thevelocitiescomputedusingproperandcoordinatetimesareplotted.ThetwovelocitymeasurementsareshowninFigure7.26,whilethetwotimemarkersareshownasfunctionsofrinFigure7.27.Thevelocitydr/ds,smoothlyincreasesastheobjectfallsintotheblackholeattheorigin.Incontrast,thevelocitydr/dctvanishesattheSchwarzschildradius.Thepropertime,orthetimeforanobserveratrestwithrespecttotheparticle,iswellbehavedandfollowstheclassicalsolution.Ontheotherhand,thecoordinatetime,orthetimerecordedbyanobserveratlargeradiusapproachesinfinityastheradiusapproachestheSchwarzschildradius.Thisdifferenceisduetothefactthatagravityfieldinfluencestheflowoftime.Sciencefictionwritersoftenusethisfact.Fromtheviewpointofanobserverfaraway,theobjectneverreachesthe

225November22,201314:259inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity209Figure7.26:dr/dsanddr/dctvelocitiesasafunctionofradius.Figure7.27:TimessandctasafunctionofradiusformotiononaSchwarzschildradialgeodesicforaparticlereleasedatrestat5Schwarzschildradii.

226November20,20139:289inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07210OneHundredPhysicsVisualizationsUsingMATLABSchwarzschildradius;whileforapersonridingtheobject,allseemsfiniteandclassical.Timeappearstorunslowlyinagravityfieldtoanoutsideobserver.However,aswillbeseenlater,tidalforceswilldestroyanyobjectwhichfallsintothe“blackhole”.7.15.InspiralingBinaryStarsAswasthecaseinelectromagnetism,acceleratedgravitationallycou-pledsystemscangenerategravitationalwaves.Inmostcases,thesearebelowthethresholdofpresentdetectionmethodsbecausespace-timeis“stiff”anddifficulttodeform.However,inextremecases,detectionmightbepossible.Onesuchcaseconcernsbinarystarsys-tems.Theseareverynumerousinourgalaxy.Itisimportantthatthestarsbecompactsothattheaccelerationswillbelargebecausethedistancesaresmall.Wewillseelaterthatheavystarswilleitherformablackholeorwillbecomeverycompactneutronstarsand,therefore,theassumptionofacompactstarisnotabsurd.Thetotalluminosityofgravitationalradiationforabinaryis:L∼(32G4/5c5)2M4/R5(7.19)ConsiderabinarystarsystemofstellarmassMorbitingaboutthecommonCMwithradiusR.Thesystemradiatesgravitationalenergyandthiscausesittobemoretightlyboundwhichmeansthattheradiusdecreases.Thisisthe“deathspiral”.Theperiod,T,radius,R,andorbitalfrequency,ω,asafunctionoftime,relativetothecollapsetime,tcare:dT/dt=−96/5(4π2)2/3(GM)5/3/[c521/3T5/3]R(t)=[(32(GM)3/5c5)(t−t)]1/4cω2(t)=GM/4R3(t)(7.20)Theradiationisquadrupolebecausethereisnonegativemassandadipoleis,therefore,impossible.Theradiusgoestozeroandthefrequencyrisesrapidly,hencethename“chirp”asacharacteristicsignatureforabinarysystemcollapseduetogravitationalradiation.ThegravitationalradiationfrequencyincreasesastasR(t)decreases,leadingtoaspace-timedeformationgoingasthe

227November20,20139:289inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity211−1/4poweroft.Thebinarymotionisdemonstratedinascript“GRChirp”.Theuserchoosesabinarymass,M,andaninitialradiusR.A“movie”isthenshownasthebinaryspiralsintowardacollision.Themassesareassumedtohavenoradialextent.ThetypicalfrequenciesareafewkHz,sothatgravitywavedetectorsusingthebinariesas“standardcandles”needtobesensitiveinthisfrequencyrange.Printoutforthescript“GRChirp”isshowninFigure7.28whileR(t)isshowninFigure7.29.Astheradiusapproacheszerothefre-quencyincreasesveryrapidly,asshowninFigure7.30.Figure7.28:Printoutforaspecificchoiceofbinarymassandradius.Themoviewhichisproducedcanbeveryinstructive.Thesystemchangesradiusandangularvelocityinaquitecharacteristicwayasthebinarycollapsesundertheactionofenergylossduetograv-itationalradiation.Indeed,existingdetectorsusethecharacteristicpatternasawaytorejectrandomnoiseandimprovethesensitivityoftheirsearchesusingtheexpected“chirp”signature.Theusershouldtryseveralmassesandinitialradiitoexplorehowthebinarysystemcollapses.7.16.GravityWaveDetectorAssumingthatgravitationalradiationexists,aspredictedinGR,detectorsneedtobedesignedtodiscovertheexistenceandthenloca-tionofthesourcesofthatradiation.Whatexactlydefinesgravity?Itisnotasimpleacceleration,becausethatcanberemovedbygoing

228November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07212OneHundredPhysicsVisualizationsUsingMATLABFigure7.29:Plotoftheradiusofthebinarysystemasafunctionoftime.intoafreelyfallingreferencesystemasinthethoughtexperimentsoftheEquivalencePrinciple.Whataredefinitivearethetidalforces.ForamassMinteractingwithatestmassm,theseforcestendtoelongateanextendedobjectinthedirectionofM,z,andcompressitinadirectionperpendiculartoM,x.ExpandingtheforceFaboutthecenterofanobjectlocatedataradiusrfromthemassM:F=2z(GMm/r3)zF=−x(GMm/r3)(7.21)xThetidalforcesaredivergence-less,sothatatidalpotential,canbedefined:Φ=−(z2−x2/2)/r3/2(7.22)tideAcontourplotofthatpotentialisdisplayedinFigure7.31.Thescript“GravRadTidal”alsoproducesplotsforthexandzforcesandamovieoftheresponseofagravitywave“antenna”toapassingwave,showninFigure7.32.Thecompressionandelongationofthe

229November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity213Figure7.30:Orbitalfrequencyasafunctionoftimeforatypicalbinarysystem.Figure7.31:Tidalpotentialasafunctionofxandzwithcontourssuggestiveofelongationandcompression.

230November20,20139:289inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch07214OneHundredPhysicsVisualizationsUsingMATLABFigure7.32:Twoframesofthe“movie”oftheresponseofan“antenna”toagravitationalwaveshowingthewaveofcompressionandelongation.Figure7.33:Changeinthebinarypulsarorbitalperiodcomparedtothatexpectedduetolossesofenergyfromgravitationalradiation.

231November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch077.SpecialandGeneralRelativity215“antenna”isduetotheintrinsicgravitationaltidalforcescarriedbythewave.The“antenna”consistsoffoursmalltestmasses.Gravitationalradiationisquadrupolenotdipoleasinelectromagnetism,sothatmorecomplexarraysareneeded,whereasadipoleantennacanbeusedforradiowaves.Theeffectofthepassingwaveontheantennaisvastlyexaggerated.Fractionaldimensionalchangesoforderonepartin1024aremorerealisticandmustbecontemplatedforthedesignofasuccessfuldetector.Atpresentgravitationalradiationhasnotbeendirectlydetected.Ifcompactbinarychirpsaretobedetected,withcircularfrequenciesofabout10kHz,thenantennaeofabout200kmareneeded.Thatsizeantennaarrayismoreappropriatetoaspacebasedlocationand,indeed,suchafacility,calledLISA,hasbeenproposed.Gravitationalradiationhasbeenobservedbywatchingthereduc-tionintheperiodofbinarypulsarswiththeexamplegivenshowingtheNobelprizedatashowninFigure7.33.TheobservedreductionswithtimeareconsistentwithEquation(7.19).However,directdetec-tionwouldbemorecompelling.

232November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch08216Chapter8AstrophysicsandCosmology“Inthebeginningtherewasnothing,whichexploded.”—TerryPratchett“Learnfromyesterday,livefortoday,hopefortomorrow.Theimportantthingistonotstopquestioning.”—AlbertEinstein8.1.GravityandClusteringGravityisalwaysattractive,sothatultimatelygravitywins.Ascript“GravClump”illustratesthisfactbysimulatingatwodimensionalsystemofparticlesself-interactingundergravity.Thereisnotem-peratureandtheparticlesstartatrestatrandomlocationsinabox.Iftheyencounteroneanothertheyareclustered,ceasetomoveandbecomeinert.Thisisonlyaverycrudemodel,butitgivessomeideaofhowgravitationalclusteringcomesabout.Obviously,anythermalvelocityslowsdownclustering.Theuserfirstchoosesthenumberofparticlesinthebox.Start-ingwithtwoorthreeisinstructive.Largersystemsalsotendtoclump,andtherootmeansquare(r.m.s.)valueoftheinitialandfinalparticleseparationisprinted.Amovieofthetimeevolutionofthesystemisprovided,andthelastframefortenparticlesisshowninFigure8.1.Eightoftheparticleshaveclumpedtogetherundermutualgravitationalattraction.Gravityalwayswins.Randomthermalmotionresiststheclump-ing,butsystemstypicallycoolastheyevolve.Thetime,tG,foralowtemperaturegravitationalsystemofparticlestoclumptogetherstartingwithamassdensity,ρo,is:tG=3π/32Gρo(8.1)

233November20,20139:349inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch088.AstrophysicsandCosmology217Figure8.1:Finalframeofthemovieforanexampleoftenparticlesinteractinggravitationallyatzerotemperature.Lessdensesystemsremainunclumpedlonger.Thatisareflectionofthefactthatathigherdensity,moreparticlesfeelstrongergrav-itationalforcesduetotheinversesquarenatureoftheforce.Thisfactcanbeapproximatelyobservedusingthemodelwithdifferentnumbersoftotalparticles.Numerically,foradensitynearthepresentaveragedensityoftheUniverse,2×10−26kg/m3,theclustertimeisabout15billionyears.8.2.FermiPressureandStarsStarsstartoutasclustersofprotons,electronsandneutronsathightemperaturesduetothegravitationalbindingenergyrisingasclustersform.ThetemperaturesareneededtoovercometheCoulombbarriersinorderthattheexothermicfusionreactionscanoccur.Thefirstcycleofreactionswiththebasicprotonscreateshelium.p+p→H2+e++ν,1.44MED1eH2+p→He3+γ,5.49MeV12He3+He3→He4+p+p,12.85MeV(8.2)222

234November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch08218OneHundredPhysicsVisualizationsUsingMATLABTheinitialstatenucleiCoulombrepelandthereforewillreactrapidlyonlyathightemperatures.Asthestarevolvesmorecom-plexnucleiarecreatedbecausethenuclearbindingenergyis,veryroughly,8MeVperaddedneutronorproton.However,whenironisreached,heaviernucleiarenolongermoredeeplybound.AddingprotonsreducesbindingbecauseoftheirmutualCoulombrepul-sion.Toalleviatethisrepulsion,higherZnucleihavemoreneutronsthanprotons.Theheaviernucleibeyondironarisefromreactionsinsupernovaexplosionsnotstellarfusionreactions.Asthesayinggoes,“wearestardust”.Atsomepoint,therefore,astarusesupitsfuel,coolsandbeginstocontract.Gravityisalwaysattractiveandthestargainsbindingenergybycontracting.Thestarcompresses,withmassdensityρ,undergravityduetoself-interactionswhichdimensionallygoastheinverseradiusofthestar,Randthesquareofthemass,M,ofthestar.Thegravitationalbidingenergyis:U=−(4π)2Gρ2R5G∼GM2/R(8.3)Thecompressionleadstoanincreaseinpressure,pG,whichdimensionallygoesastheinversefourthpoweroftheradiusofthestar.ThenotationisthatUGisthegravitationalpotential,andVisthevolumeofthestar.Thegravitationalpressurethereforegoesastheinverse4/3powerofthevolumeandasthesquareofthenumberofnuclei,N.p=∂U/∂V∼GM2/R4∼N2/V4/3(8.4)GGAssumingthatthestarisburnedout,theonlyresistancetograv-itationalcontractionarisesfromtheexclusionprinciplepressureofthefermions,eithertheelectronsorthenucleons.TheFermienergyisproportionaltothe2/3powerofthenumberdensity,asexploredinSection5.6above.Therefore,theFermipressurerisesmorerapidlythanthegravitationalpressure,andanequilibriumcanbeachieved.kF∼n1/3=(3π2n)1/3EF∼k2∼n2/3F

235November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch088.AstrophysicsandCosmology219UF∼NEF∼N5/3/V2/3pF=∂UF/∂V∼N5/3/V5/3=2UF/3(8.5)Parenthetically,whydoestheworldappeartobesolidwhenweknowitismostlyemptyspacecomposedofatomsofangstromsize,withalmostallthemasslocalizedinanucleusabout100,000timessmaller?TheansweristhatthestiffnessofmatterexistsasaresultoftheFermiExclusionPrinciple.Indeed,theFermipressureimpliesabulkmodulus,B=5p/3,whereBistheinverseofthefractionalchangeinvolumewithpressure,1/B=−1/V(∂V/∂p)T.Numeri-cally,BcanbeestimatedusingEquation(8.5),tobe1010nt/m2forZ=10,whichiscomparabletothemeasuredvalue.ItistheFermipressurewhichmakesmatterstiffandprovidesuswiththeillusionofsolidity.Thestarsburnbyfusionandtheradiationpressurestabilizestheradius.Whenthefuelisexhaustedthestarcontractsandthecon-tractionisresistedfirstbytheelectrons.Astheybecomerelativisticformassivestars,theyarepushedintotheprotonsandaneutronstarisformed.Forsometotalnumberofnucleons,N,astableradius,Rn,existsinthebalanceofgravity,1/V4/3andtheFermipressureoftheneutrons,1/V5/3.R=(81π2/16)1/32N−1/3/Gm3(8.6)nnThevelocityofparticlesnearthetopoftheFermiseais∼mβc∼kF:β∼(π/mc)(31/6/21/2)n1/3(8.7)UGscalesasN2whileUFhasaweakerdependence.Thusformas-sivestars,undercontractionnrises,theFermimomentumrises,theparticlesbecomerelativistic,andmatterbecomeslessstiffbecausetheenergyisthenproportionaltomomentumasinSRandnotmomentumsquaredasintheNRcase.p=2π3(3n/π)5/3/15mFp=cn4/3(8.8)F

236November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch08220OneHundredPhysicsVisualizationsUsingMATLABFigure8.2:PrintoutforthedemonstrationofFermipressure.Whenβapproachesone,theresistingmatterfailsandgrav-itywins.Inthiscase,whichoccursforstarswithmassesofafewsolarmasses,resistancecrumblesandablackholeisformed.AmoreprecisemassvalueistheChandrasekharlimitwhichis∼1.44solarmasses.Thesunhasaradius7×108km.Anelectronstabilizedstarwillhaveasizeabout10,000km,whileaneutronstabilizedstarhasasizeabout10km.Thesituationisexploredinascript“FermiPressure”.Theusersuppliesamassinunitsofthesolarmass.PrintoutforthatchoiceappearsinFigure8.2.NRandURrefertonon-relativisticandultra-relativistic.ThevelocityfortheelectronsandnucleonsasafunctionofthecontractingstellarradiusisshowninFigure8.3.Thelightelectrons,Equation(8.8),becomerelativisticatlargeradii,about10,000km.Theneutrons,about2000timesheavier,becomerelativisticatradiiaround10km.Thepressureduetogravity,resistedbytheFermipressure,asafunctionofstellarradiusisshowninFigure8.4.Thecontribu-tionsduetoelectronsaresharplyreducedatradiiaround10,000km,whiletheneutronsbecomeineffectiveatabout10km.The∗labelstheSchwarzschildradiuswhichindicatestheformationofablackholewhenFermipressurefailsforstellarmassesofafewsolarmasses.Sincethisfateseemsinevitableformassivestars,andsincethetheoryofgeneralrelativity,GR,predictstheexistenceofgravita-tionalwaves,thereisaworldwideattempttosearchforthesewaveswhichshouldbeemittedintheprocessofstellarcollapse.

237November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch088.AstrophysicsandCosmology221Figure8.3:Velocityofelectronsandneutronsforstarsasafunctionofthestellarradius.Figure8.4:PressureduetogravityandtheopposingFermipressureasafunc-tionofstellarradius.Electronscanstabilizelargeradii,whileneutronsstabilizesmallerradii.

238November20,20139:349inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch08222OneHundredPhysicsVisualizationsUsingMATLAB8.3.UniformDensityStarAreasonablemodelofastarisacomplexundertaking.Thediscus-sionofFermipressureaboveassumedauniformdensitystarasafirstapproximation,whichisacrudestartingpoint.Asimplemodelwithuniformdensityiscalculatedinthescript“StarConstantDensity”.Theusersuppliesthestellarmass.Thegravitationalpressureatthecenterofthestaristhen:p(0)=GM/Rc2(8.9)TheresultingprintoutisgiveninFigure8.5.Thesolardensityinthismodelisaboutthatofwater,whichisassumedforthestarinfindingtheradius.AstarwithtenstellarmasseshasaSchwarzschildradiusofabout30kmandaradius,assumingasolardensity,of1.5billionm.Itisnotrelativisticasexpectedfromthepriordiscus-sionofFermipressure.Assumingacoretemperatureto30milliondegreesconfirmsthefactthatsuchastarisaNRobject.Thedimen-sionlessratioofpressuretodensity,p/ρc2,issmallforNRmattersincetherestmassthenexceedsthekineticmassduetomotion.Figure8.5:Printoutinthecaseofastarofconstantuniformdensityasafirstapproximation.8.4.StellarDifferentialEquationsAmorecomplexmodelofastarcanbeattemptedandcomparedtosolardata.Thenextlevelofapproximationaccountsfortheradialdependenceofthedensity,mass,pressureluminosityandtemperature.

239November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch088.AstrophysicsandCosmology223Thedifferentialequationswhichdescribesuchasimplifiedstarmodelare:dM/dr=4πr2ρ(r)dp/dr=−ρ(r)GM(r)/r2dL/dr=ε(r)dM/drdT/dr=−3κ(r)ρ(r)L(r)/[16πr2acT3(r)],radiativedT/dr=(1−1/γ)T/P(dp/dr),convective(8.10)Theincrementinmass,M(r),inashellofradiusdrisdM/dr.Theincrementinpressure,p(r),duetothemassatthatrisdp/dr.Theluminosity,L(r),changeduetoenergyproduction,ε(r),atthatrisdL/dr.Theenergyproductionscaleswithtemperatureas,ε∼T5,reflectingtheneedforhightemperaturestoovercometheCoulombbarriersinfusionprocesses.Thetemperaturechangewithriscon-trolledbytheopacityκforradiativetemperaturedistribution,butbythepressuregradientforconvectivemixing.Convectionwillbeassumedtodominateinthismodel.Thepressureduetothehydrogengasandthephotongasgivesthestarequationofstate.Themeanatomicnumberofthegasisµ.p=ρkT/µm+aT4/3(8.11)pTheuserisaskedfortheinputmassandradiusofastarwhichareonlyusedasintegrationlimits.Thecentraldensityandtemperaturearethenrequestedasthedefininginputs.TheprintoutcorrespondingtousingvaluesforthesunisshowninFigure8.6.Themassandluminosityatr=0aretakentobezeroasaboundarycondition.Thecoretemperatureanddensityareusedtoderivethecorepressure.Thesolutionstartsatr=0andintegratesouttor=RusingtheMATLABscript“ode45”.Thevariablesaremass,pressure,luminosityandtemperature.Thedensityisadepen-dentvariableandisderivedfromthetemperatureandpressureusingtheequationofstate,Equation(8.11).Themodelyieldsacorepressurewhichisquiteclosetothesolarvalue.Theradialdependenceofallfivequantitiesarecomputedandcomparedtosolardata.Theagreementisnottoobadconsideringthe

240November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch08224OneHundredPhysicsVisualizationsUsingMATLABFigure8.6:Printoutfrom“StarODE3”forastarcorrespondingtothesun.approximationswhichweremade.Muchmoredetailedmodelshavebeenmade,butthissimplemodeldoesreasonablywellatbringingoutthephysicsofahydrogenstarsomewhatlikethesun.Thefivevariablesareplottedbythescript.Thecomputedresultsarecomparedtosolardata,shownaso,inFigures8.7and8.8.Themassdistributionandthetemperaturedistributionareapprox-imatelycorrect.Thepressureanddensityshapesarenotasgood,whiletheluminositydistributionreproducesthesolardistributionquitewell.Althoughnotaccurateinthedetails,nevertheless,itisausefulexercisetoattempttosimplymodelthestarsusingwellunderstoodphysicsconcepts.8.5.RadiationandMatterintheUniverseMovingfromstars,theirstructureandtheirevolution,tostilllargerobjects,weendbyconsideringtheentireUniverse.ItisperhapsastoundingthatthelargescalepropertiesoftheUniversecanbeunderstoodbyapplyingGRtoamodelandusingjustafewexper-imentalfacts.ThestrangestthingabouttheUniverseisthatitisexplicable!

241November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch088.AstrophysicsandCosmology225Figure8.7:Shapeofthestellarmassdistributionascomputed,−,andwithsolardata,o.Figure8.8:Shapeofthestellardensitydistributionascomputed,−,andwithsolardata,o.

242November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch08226OneHundredPhysicsVisualizationsUsingMATLABTheuniverseappearstohavebegunina“BigBang”atenormousenergyandtemperaturebutatzero“size”.Thematterandradiationexpandedandcooled.Atearlytimestheradiationdominated,butitcooledastheinversefourthpowerofthedistancescaleR,threepowersforvolumeexpansionandoneforenergyredshift.Atpresent,ithasatemperatureofabout2.72degreesKelvinandthephotonnumberdensityisabout410microwavephotonspercm3.Thenum-berofphotonsistakentobeaconstantandtheadiabaticexpansionleadstotheredshift.Thematterdensityisnotnowrelativisticandis,therefore,dominatedbytherestmassesoftheparticles.Therefore,italsofallswithexpansion,butonlyastheinversethirdpowerofthedis-tancescaleR,duetothevolumeexpansionofspace-timeastheUniverseexpands.Therefore,atlongtimes,ignoringdarkenergy,theUniversewillbecomematterdominated.TheUniverseappearstobe“flat”withatotalmassdensityequaltothecriticalclosuredensity,ρc.ThethreedimensionalspatialgeometryisassumedtobeflatinahomogeneousandisotropicUniverse.Thefullfourdimensionalgeometryiscurvedbythematter-energyoftheUniverse.UnderthoseassumptionsthemetricoftheUniverseistheflatRobertson–Walkermetric,definedbythescaleparameter,R(t),ords2=(cdt)2−R2(t)[dr2−(rdΩ)2].ThedensityisrelatedtothecurrentHubbleconstant,Ho,whereH=(dR/dt)/Rmeasurestheexpansionofthemetricalscalefactor,R.ThecriticaldensityarisesfromconsiderationsoftheGRdynamicswhichrelatestheenergydensityofamodelUniverse,homogeneousandisotropic,totheexpansionofthemetricalscaleRduetogravi-tationalcouplingG.ρ=3H2/8πG(8.12)coUsinggalacticredshiftstodeterminetheHubbleparameter,thisaveragedensityispresentlyabout5.6GeVpercubicmeteroraboutsixprotons.Thepresentcosmicmicrowavebackgroundofred-shiftedphotons,CMB,isabout41,000timeslessthanthepresentcriticaldensity.

243November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch088.AstrophysicsandCosmology227TheexpansionoftheUniverseistrackedbythechangeofscalefactorRwithtime.Itismeasuredbyobservingtheredshiftoflightemittedatscale,R,andwavelength,λ.Asthespace-timeoftheUniverseexpands,allstarsappeartobeDopplershiftedwithrespecttoanyobservationpoint.Thestarsareembeddedinspace-timeanddonotmovewithrespecttoit.Ratherspace-timeexpands,drivenbytheenergydensityoftheUniverse.1+z=(λo−λ)/λ=Ro/R(8.13)TheGRdynamicsrelatingR(t)totheenergydensityρ,ignor-inganycosmologicalsources,followsfromEquation(8.12)andthedefinitionofH.dR/dt=R8πGρ/3ρ∼1/R3,R∼t2/3,matterρ∼1/R4,R∼t1/2,radiation(8.14)ThetimedependenceofthescalefactorisdifferentdependingonwhethertheUniverseisinaradiationormatterdominatedphase.ThisGRpredictionistheneededdynamicalinput.ThepowerlawsolutionsarisewhentheGRfieldequationsrelatingthespace-timemetrictothematterintheUniverseareused.TheR(t)solutionsfollowfromEquation(8.14).ThebehaviorofthedensitywithRcouldalreadybejustifiedheuristicallyaswasdoneabove.ThetimedependenceofthescalefactorR,themassdensityρ,andthetemperatureTaregiveninTable8.1forthetwosituationswhichareencountered;earlytimeswhenradiationdominatedandlatertimeswhenNRmatterdominated.Thescript“CosmosPowerLaw”producesplotsofthebehaviorofmatterandradiationoverthelifeoftheUniverse.TheuserchoosesacurrentHubbleparameterfromwhichthatbehaviorisderived.PrintoutoftheuserdialogueappearsinFigure8.9.TheusermakesaninputofthepresentHubbleconstant.Thepresentdensityisassumedtobethecriticaldensity(“flat”Universe).Thecosmicmicrowavebackgrounddensityandtemperaturearethe

244November20,20139:349inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch08228OneHundredPhysicsVisualizationsUsingMATLABTable8.1:Powerlawbehaviorintimeofmatterandradiation.PowerLawRadiationEpochMatterEpochnR∼t1/22/3MatterDensity−3/2−2RadiationDensity−2−8/3Temperature−1/2−2/3Figure8.9:PrintoutofthebehaviorofmatterandradiationoverthehistoryoftheUniverse.otherparametersused.ThescalingwithtimedisplayedinTable8.1isthenused.TheHubbletimefortheuserchoiceshownisabout13.7billionyears.Radiationdominateduntilabout35,600yearsatatempera-tureofabout63,000degreesKelvin.AplotofthetemperatureasafunctionoftimeisshowninFigure8.10.ThecosmicmicrowavebackgroundismeasuredtodayanditcanbeextrapolatedbackwardsintimebecausetheUniverseistranspar-enttothesephotonsupuntilthepointwherehydrogencanbeionizedbythephotonsandthentheUniversebecomesopaque.ScalingthepresentCMBkTvalueof0.23meVto13.6eV,thetemperaturewouldbe163,000degreesKelvin.Assumingmatterdominationduringthe

245November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch088.AstrophysicsandCosmology229Figure8.10:Plotofthetemperatureasafunctionoftimeformatterdomination(blue)andradiationdominated(red)epochs.extrapolation,theopacitysetsinatapproximatelythepointwherematterandradiationhaveroughlyequaleffectsontheevolution.AtearliertimestheUniverseisopaquetolight.Thatiswhythecosmicmicrowavebackgroundmapsaremadeforabout380,000yearsafterthe“BigBang”.Attheenergyscalefornuclearbinding,forexample,2.2MeVfordeuteriumbinding,thetemperaturewouldbeabout2×1010degreeswhichwouldberelevantinthefirstfewseconds.However,knowingthenuclearphysicsandthethermody-namics,thebehavioroftheUniversecanbeextrapolatedtotimeswhichcannotbedirectlyobservedbutwhichyieldtestablepredic-tionsabouttheelements.ThebehavioroftheenergydensitycontainedinthematterandradiationasafunctionoftimeisshowninFigure8.11.Asexpected,matterdominatesatpresent,assumingthatthereisno“darkenergy”componenttotheenergydensityfornow.Itisamazingthatamea-surementofthepresentHubbleconstant,thecriticalpresentdensityandthecosmicmicrowavebackgroundenablesanextrapolationoversuchanenormousrangeoftime.

246November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch08230OneHundredPhysicsVisualizationsUsingMATLABFigure8.11:EnergydensityoftheUniverseasafunctionoftimeshowingthematterandradiationcomponentsofthetotalenergydensity.8.6.ElementAbundanceandEntropyAlthoughtheUniverseisopaqueatshorttimes,knowingthephysicsmeansthatpredictionsabouttheabundanceoftheelementswhichwereformedinfusionreactionsathightemperaturescanbemadeandcomparedtomeasurementsoftheprimordialabundanceofthenuclei.Indeed,theagreementisquitegood,indicatingthateventswithquiteshorttimes,afewsecondstominutes,aftertheBigBang,canbeunderstoodandthesubsequentevolutionoftheUniversecanbeexplained.Withanumberdensityofabout400photonspercubiccentime-ter,radiationdominatestheentropyoftheUniversecomparedtothepresentsixprotonspercubicmeter.AstheUniversecools,protonsandneutronsbecomestableparticlesandthey,inturn,bindintonuclei.TheBoltzmanndistributionforthenumberdensityofnon-relativisticnucleiofatomicweightAis:n∼T3/2e(µA−mA)/kT(8.15)A

247November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch088.AstrophysicsandCosmology231ThechemicalpotentialisµA.Theneutrontoprotonratioisthenfixedbythemassdifference,Q=1.29MeV,whereneutronsaremoremassivethanprotonsandthuslessplentiful.Ata“freezeout”temperature,therateofthereactionsp→nandn→pbecomeslessthantheexpansionrate,H,andtheneutronandprotonmixingfallsoutofequilibrium.Thentherelicabundance,n/p,isapproximatelyfixed.n/p=e−Q/kT(8.16)Thisratioisroughly0.17fora0.7MeVfreezouttemperaturewhichdependsonHwhichsetsthescaleforexpansion.Anapprox-imateplotofthen/pratioasafunctionoftemperatureisshowninFigure8.12usingthescript“CosmosElements”.PrintoutmadebythatscriptappearsinFigure8.13.Athightemperatures,then/pratioisclosetoone.Atfreezeoutitisabout0.17.Notethat,atlowerFigure8.12:Ratiooftheabundancesofntopasafunctionoftemperaturefora0.7MeVfreezeouttemperaturewhichisthetemperaturebelowwhichtheHubbleexpansionissuchthattransitionsbetweennandpcannotremaininequilibrium.

248November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch08232OneHundredPhysicsVisualizationsUsingMATLABFigure8.13:Printoutfor“CosmosElements”.TheHeliumabundancedependsonHandtheabundanceofbaryons.temperatures,theratiodoesnotstayat0.17becausetheneutronsquicklygointothecreationofhelium.Notethatthepredictionofdetailedsolarmodelsisthatthesunhasonlyconsumedabout0.3%ofitsmassoverthe4.5billionyearsofitsexistence.Therefore,theextrapolationintimetoprimordialabundanceisnotalargeoneandisnotasourceoflargeerrors.ThelightnucleiallhaveabindingenergyB.Heliumisverydeeplybound,forreasonsinnuclearphysicssimilartothe“noblegas”behaviorinatoms,aclosedshell.Deuterium,incomparison,isveryweaklybound.Sincethenucleiarebound,asthetemper-aturefallswithexpansion,atsomepointthenucleiarenolongerbrokenapartthermallyandtheyalso“freezeout”.Therefore,theabundanceoflightnuclei,X,XA=nAA/Nnrepresentsabalancebetweenthehotphotonbath,ortheratioofphotonstobaryons,η,andthebindingenergy.X∼T3/2ηA−1eB/kTXA−ZXZ(8.17)AnpThefractionalbaryonabundance,ortheXvaluesofanucleusAdependsonthetemperature,theentropyη,thebindingenergy,B,andtheavailabilityoftheconstituents,theZprotonsandthe(A−Z)neutrons.Becauseoftheverydeepbindingof4He,(B=28.3MeV)almostalltheneutronsthatareavailableafterneutronfreezeoutgointomakingthatelement.Veryapproximately,X4∼2(n/p)/[1+(n/p)].Thebehavioroftheabundanceofp,deuterons(B=2.2MeV)

249November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch088.AstrophysicsandCosmology23324Figure8.14:Abundancesofp,deuterons,H,andhelium,He,nucleiasafunc-tionoftemperature.Thenwhichareavailableafterfreezeoutalmostallgointotheformationofheliumnucleibecauseofthelargeheliumbindingenergy.and4HeisshowninFigure8.14.Thedeuteriumabundance,withasmallB,islessthanthatoftheHeliumwithmoreconstituentsbutverydeepbinding.Itappearsthatthefractionsoflightnucleicanbewellunderstoodbycombiningcosmologywithnuclearphysics.Surely,itisagreatachievementtounderstandtheUniverseoverarangeofbillionsofyearsfromfirstprinciples.8.7.DarkMatterAlthoughtheUniverseappearstobe“flat”ortohaveadensityequaltothecriticaldensity,theoriginofthismatterisnotknown.Indeed,theobservedmatterofsunsandothervisiblematterisonlyabout4.2%ofthecriticaldensity.Thephotonsareaverysmallfractionatpresent.Itseemsthatthereismatterwithgravitationalinteractionsthataccountsforabout23%ofthecriticaldensity.Thisiscalled“darkmatter”anditisnotknownwhatitiscomposedof.Theremaining73%iscalled“darkenergy”andnooneknows

250November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch08234OneHundredPhysicsVisualizationsUsingMATLABFigure8.15:Printoutfordarkmatterevidence.whatthatis.Itappearstobea“cosmologicalterm”whichwillbeexploredinthenextsection.Itishumblingtorealizethatwehavesofarexploredandunderstoodonlyabout4%oftheUniverse.Someoftheevidencefordarkmatterisgiveninthescript“DMEvidence”.TheprintoutforthatscriptappearsinFigure8.15.Thereisaplotprovidedthatshowsaschematicoftherotationcurvesofagalaxy.Simplekinematicsindicatesthatthevelocityofastarwithinthegalaxygoeslinearlyasthedistancefromthecenter,whileoutsidethegalaxy,thevelocityshouldfallastheinverseofthesquarerootoftheradius.Thevelocitiesaremeasuredbylook-ingattheDopplershiftsofthespectrallinesofstars.Equatingthegravitationalforcetothecentrifugalforce:F=GMm/r2=mv2/rM∼r3(8.18)Outsidethegalaxy,Misaconstantandthevelocitiesdecrease.Whatisobservedisthatthevelocitiescontinuetoincreaseoutsidethecoreofvisiblestars.Thus,masseswhicharedarkareinferredtoextendwellbeyondthelimitsofthevisiblegalaxy.AsecondpieceofevidenceisthesizeoftheEinsteinringsthatareaconsequenceofthegeneralrelativisticdeflectionoflightbyagravityfield.AschematicofthelightraysisshowninFigure8.16.GravitybendsthelightthroughanangleθG=4GM/bc2whenit

251November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch088.AstrophysicsandCosmology235∗Figure8.16:Schematicofasourcewhichemitslight,bluelines.Amass,green,ispassedwhichdeflectsthelightwhichsubsequentlyisobservedat(0,15).Thelightappearstohaveoriginatedataringsource,reddashedlines.Thebehaviorisexactlylikethatofanopticallens.passesbyamass,M,withimpactparameter,b.Agalaxyatdistanceds−dlawayfromthemasshasanobserveratdistancedlbeyondthatmass.ThesourceemitswithangleθswhichhasimpactparameterbwhenitpassesthemassM.Thegeometryimplies:θs=b/(ds−d)θsds−θGd=0b=θEd=4GM/c2[d(ds−d)/ds(8.19)Theequationfortheringsizeshouldbefamiliarfromtheprevi-ousworkonthefocallengthoflenses,inthiscasewithafiniteobjectandimagedistance.TheangularradiusoftheEinsteinringisθEwhichdependsonthemass,M.Again,dataimpliesthatthevisiblemassiswoefullyinsufficienttoexplaintheobservedringsizes.Giventhisinformation,manyphysicistsarelookingfordarkmatteronEarth.Asseenintheprintout,Figure8.15,ourgalaxy

252November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch08236OneHundredPhysicsVisualizationsUsingMATLABrotateswithavelocityabout283km/sec.AssumingthatthisisthevelocityofdarkmatterwithrespecttoalaboratoryonEarth,andthatdarkmatterconsistsofparticleswith200,000MeVmass,thenthemaximumenergythatcouldbetransferredtoadetectionappara-tuswouldbeabout0.09MeV.Sinceminimumionizingparticleslikecosmicraysdepositabout1.5MeV/cminlightmaterials,itisclearthatthesesearchesarehard.Inaddition,thecollisioncrosssectionisverysmall,sothecollisionsoccuronlyveryrarely.Nevertheless,theimportanceofunderstandingtheUniversemakessuchanobservationoffundamentalimportance.8.8.DarkEnergyThereisthepossibilityintheGRfieldequationsofbothordinarymatterasasourceandavacuumenergybecausetherearetwopossi-bletensorsources—theenergy—momentumtensorwhichcontainsmatterandradiation,andthemetrictensoritself.Infact,Einsteinoriginallyincludeda“cosmologicalterm”inhiscosmologicalmodelbutlaterremovedit.Nevertheless,theexistenceof“darkenergy”,arepulsiveforce,hasbeenobservedwhichisconsistentwithavacuumenergydensity.Apparentlythevacuummaycontaincosmologicalenergydensity.ThematterdensityfallsastheinversecubeofthescaleR,whilethevacuumdensity,proportionaltothemetricitself,isacon-stant.Therefore,ultimatelythevacuumenergywilldominateastheUniversecoolsandexpandsanditwilldrivetheUniversetoanexpo-nentialdecreaseindensity.Inthepresenceofbothmatterandvacuum,ordark,energythescaleRhasatimedependence:(dR/dt)2=8πGρR2/3+ΛR2/3ρ=ρo(R/R)3,Ω=ρ/ρ=1mmocH(t)=H[(R/R)3(1−Ω)+Ω]1/2(8.20)oovvEquation(8.20)istheFriedmannequationforthespecialcaseofaflatUniverse,whereatermkc2wouldappearifthecurvaturekwerenon-zero.Thecontributionofmatter/energytotheexpansion

253November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch088.AstrophysicsandCosmology237rateiscontrolledbyρ.TheUniverseis“flat”,withafractionofthecriticaldensityduetomatterwhichisjust1−Ωv.Thelimitwherethevacuumenergyissmallhastgoingasthe3/2powerofRinamatterdominatedUniverse.Ifthevacuumenergydominates,thescaleRincreasesexponentiallywithanexponentpro-portionalthesquarerootofthevacuumdensity.Inthegeneralcase,thesolutionofEquation(8.20)forthecoor-dinatetimetis:Hot=2/3Ωvlog[1+(R/Ro)3/a+(R/Ro)3/a]a=Ωv/(1−Ωv)=Ωv/Ωm(8.21)Thisresultisevaluatedwiththescript“CosmosVacuum2”.TheusersuppliesapresentHubbleconstantandavalueforthevac-uumenergyratiotothecriticalenergydensity.TheH(t)andR(t)functionsarethencomputedandplotted.TheprintoutisshowninFigure8.17.TheplotofFigure8.18showsthetimedependenceoftheHubble“constant”.IntheabsenceofdarkenergyHwillfallwithRasseen√inEquation(8.20),H=(dR/dt)/R∼8πGρ∼R−3/2.Darkenergy,incontrast,hasaHubbleconstant,H=Λ/3,whichisaconstant.TheplotofFigure8.19showsthescaleRasafunctionoftimeinaninitiallymatterdominatedUniverse.Atshorttimesthescaleevolvesasthe2/3poweroft.Atlatertimes,wherethecrossoverisshownasa∗,thescalebeginstoincreaseexponentiallysincethevac-uumenergydominates.InEquation(8.20),thevacuumdominated√HubbleparameterwouldgoesasdR/R=Λ/3dt,R∼eΛ/3t.IfFigure8.17:Printoutforanexampleoftheevaluationoftheeffectofvacuumenergy.

254November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch08238OneHundredPhysicsVisualizationsUsingMATLABFigure8.18:HubbleparameterasafunctionofthescalefactorRwithdarkenergyandwithout.Figure8.19:ThescaleRasafunctionoftimeinaninitiallymatterdominatedUniverse.Thepowerlawbehavioratshorttimesisduetomatterdomination,whiletheexponentialbehavioratlongtimesisdrivenbythevacuumenergy.

255November20,20139:349inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ch088.AstrophysicsandCosmology239theobserveddarkenergyisindeedacosmologicalconstant,thenthefateoftheUniverseistosuffera“BigStretch”afterstartinginaBigBang.Inarelatedtopic,theUniverseisnowconjecturedtohaveundergonearapideraof“inflation”withanexponentialincreaseinthescaleRwhichsmoothedoutthedistributionsatearlytimes.Thephysicalagentofthatmechanismremainsunknown,incon-trasttoourpresentknowledgeofthenuclearphysicsandparticlephysicswhichexplainssomewhatlatertimes.Nevertheless,thetime“frontier”continuestobepushedbothearlierandlater.

256November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app240Appendix—ScriptforClassicalMechanicsAllthescriptsareavailabletotheuserusingtheenclosedmedia.However,itisusefultobeabletoquicklyjumptoawrittenversioninordertoseewhatMATLABcommandsareused.Tothatend,thescripttextforthesectiononClassicalMechanicsisenclosedbelow.2.1.SimpleHarmonicOscillator%%Programtocomputeoscillations-singlespring,dampedanddriven%clear;helpcmosc;%Clearmemoryandprintheader%%spring(k,m)massandspringconstant%symskmxtyydBw%y=dsolve(D2x=-k*x/m,x(0)=A,Dx(0)=0);%freeoscillation%fprintf(SHM,InitialPosition=A,NoInitialVelocity

257)pretty(y)%%nowadampedoscillation%yd=dsolve(D2x=-k*x/m-b*Dx/m,x(0)=A,Dx(0)=0);%fprintf(SHM-DampedwithAmplitudeb,InitialPosition=A,NoInitialVelocity

258)%pretty(yd);%

259November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics241ydr=dsolve(D2x=-k*x/m-b*Dx/m+B*cos(w*t),x(0)=A,Dx(0)=0);%fprintf(SHM-DampedwithAmplitudeb,DrivenwithAmplitudeB,Frequencyw

260)%pretty(ydr);%%nownumericalevaluations%irun=1;iloop=0;%whileirun>0kk=menu(PickAnotherDriven,DampedSpring?,Yes,No);ifkk==2irun=-1;breakendifkk==1%%kkk=input(EnterSpringConstantk:);%mm=input(EnterMassonSpringm:);%wo=sqrt(kkk./mm);wo=1;fprintf(SpringNaturalFrequency=%g

261,wo);AA=input(EnterInitialDisplacementA:);bb=input(EnterDampingCoefficientb/m:);%gam=bb./2.0;wnatsq=(wo.∧2-gam.∧2);ifwnatsq<0fprintf(Overdamped

262)elsewnat=sqrt(wnatsq);fprintf(UnderdampedOscillationFrequency=%g

263,wnat);end

264November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app242OneHundredPhysicsVisualizationsUsingMATLAB%tt=linspace(0,10,100);k=1;m=1;A=AA;b=bb;fori=1:100t=tt(i);yy(i)=eval(y);yyd(i)=eval(yd);end%iloop=iloop+1;figure(iloop)forj=1:length(tt)plot(tt(j),real(yy(j)),bo,tt(j),real(yyd(j)),r*:)title(SpringMotion,UndampedandDamped)xlabel(t)ylabel(x)legend(undamped,damped)axis([010-11])pause(0.1);endplot(tt,real(yy),b-,tt,real(yyd),r:)title(SpringMotion,UndampedandDamped)xlabel(t)ylabel(x)legend(undamped,damped)%BB=input(EnterDrivingAmplitudeB:);ww=input(EnterDrivingFrequency\omega:);wressq=wo.∧2-(bb.∧2)./2.0;wres=sqrt(wressq);fprintf(DrivenResonantFrequency=%g

265,wres);w=ww;B=BB;

266November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics243fori=1:100t=tt(i);yydr(i)=eval(ydr);end%iloop=iloop+1;figure(iloop)plot(tt,real(yyd),tt,real(yydr),:)title(DampedSpringMotion,UndrivenandDriven)xlabel(t)ylabel(x)legend(undriven,driven)%www=linspace(0,2.*wo,25);%B=BB;forj=1:25w=www(j);fori=1:100t=tt(i);yyydr(i)=eval(ydr);endydrmx(j)=max(yyydr);endiloop=iloop+1;figure(iloop)plot(www,abs(ydrmx))title(DampedSpringMotion,MaxAmplitudevsDrivingFrequency)xlabel(\omega)ylabel(x)holdonplot(wo,AA,ro,abs(wnat),AA,b*,abs(wres),AA,g+,abs(wo-gam),AA+0.5,r+,abs(wo+gam),AA+0.5,r+)ydrvmx=max(abs(ydrmx));ymaxplt=AA+1;

267November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app244OneHundredPhysicsVisualizationsUsingMATLABifydrvmx>AA+1;ymaxplt=ydrvmx;endaxis([min(www),max(www),0.,ymaxplt])%holdofflegend(maxx,\omegao,\omegadamped,\omegares,ResWidth)%endend%2.2.CoupledPendula%%Programtocomputecoupledsimpleharmonicmotion%clear;helpcm2sho;%%Clearmemoryandprintheader%%for2pendulaboth(k,m)coupledbyaspring(k12)%symsxxx1x2kmk12A1A2X1X2%fprintf(2pendulawith(k,m)andCouplingk12,SolutionwithInitialAmplitudeButNoVelocity

268)fprintf(D2x1=(-k*x1-k12*(x1-x2))/m,D2x2=(-k*x2+k12*(x1-x2))/m

269)%[X1,X2]=dsolve(D2x1=(-k*x1-k12*(x1-x2))/m,D2x2=(-k*x2+k12*(x1-x2))/m,x1(0)=A1,Dx1(0)=0,x2(0)=A2,Dx2(0)=0);%%symbolicsolutionforthe2displacements

270November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics245%%pretty(X1)%pretty(X2)%iloop=0;irun=1;whileirun>0%krun=menu(AnotherSetofParameterstoSolve?,Yes,No);ifkrun==2irun=-1;breakend%ifkrun==1iloop=iloop+1mm=input(EnterEqualMasses:);kk=input(EnterEqualSpringConstants:);kk12=input(Enter1-2Springcoupling:);AA=input(EnterInitialDisplacementsofthe2Springs-[A(1),A(2)]:);m=mm;k=kk;k12=kk12;A1=AA(1);A2=AA(2);tt=linspace(0,10,100);fori=1:100t=tt(i);xxx1(i)=real(eval(X1));xxx2(i)=real(eval(X2));end%figure(iloop)plot(tt,xxx1,b-,tt,xxx2,r-)title(SpringCoupledMotionof2Pendula)

271November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app246OneHundredPhysicsVisualizationsUsingMATLABxlabel(t)ylabel(x1,x2)legend(x1,x2)%iloop=iloop+1;figure(iloop)plot(tt,xxx1-xxx2,b-,tt,xxx1+xxx2,r-)title(\omegaforx1+x2=sqrt(k/m),\omegaforx1-x2=sqrt(k+2k12)/m))xlabel(t)ylabel(x1+-x2)legend(x1-x2,x1+x2)%iloop=iloop+1;figure(iloop)x1max=max(xxx1);x2max=max(xxx2);x1min=min(xxx1);x2min=min(xxx2);xmin=x1min;ifx2minx1maxxmax=x2max;endxp1(1)=0;yp1(1)=1;yp1(2)=0;xp2(1)=0;yp2(1)=1;yp2(2)=0;xc=0;yc=1;%

272November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics247fori=1:100xp1(2)=xxx1(i);xp2(2)=xxx2(i);%+5;plot(xxx1(i),0,o,5+xxx2(i),0,o)holdonplot(xp1,yp1,r-,xp2+5,yp2,g-,xc,yc,-)xcou(2)=xxx2(i)+5;ycou(1)=0;xcou(1)=xxx1(i);ycou(2)=0;plot(xcou,ycou,–)title(x1andx2MovieinTime)xlabel(x1x2)axis([xminxmax+5-0.51]);pause(0.1)holdoffend%endend%2.3.TriatomicMolecule%%ProgramtosymbolicallysolveODEforlinearmolecule-3masses,2springs%k/m=1,(m/M)ratio=b,outeratomshavemassm,centralatomhasM%clearall;helpcmtriatomic%Clearthememoryandprintheader%symsx1x2x3btwAwybbxxy%%nowexactlysolvetheeqsofmotion,witharbitraryinitialposi-tions,0initialvelocities%

273November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app248OneHundredPhysicsVisualizationsUsingMATLAB%Initialize-getDifferentialEqtosolve,xarew.r.t.equilibrium%positions%[x1,x2,x3]=dsolve(D2x1=(x2-x1),D2x2=b*(-2*x2+x1+x3),D2x3=(x2-x3),.....x1(0)=x(1),x2(0)=x(2),x3(0)=x(3),....Dx1(0)=0,Dx2(0)=0,Dx3(0)=0);%fprintf(SymbolicSolutionInitialVelocities=0,InitialPositionsx(i)

274)%x1=simple(x1);%pretty(x1)x2=simple(x2);%pretty(x2)x3=simple(x3);%pretty(x3)%%useMATLABtoolstofindeigenvalues,y=w∧2%fprintf(AwistheOscillationMatrixforthe3Atoms,y=w∧2

275)Aw=[1-y,-1,0;-1,2-y/bb,-1;0,-1,1-y]xy=det(Aw);%%useeigentoolsonMATLAB%fprintf(Eigenfrequencies=0,1,andsqrt(1+2b)

276)fprintf(TheDeterminantofAwhasRootsy=w∧2oftheEigen-frequenciesinsqrt(k/m)Units

277)factor(xy)%iloop=0;irun=1;whileirun>0%krun=menu(AnotherMolecule?,Yes,No);

278November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics249ifkrun==2irun=-1;breakend%ifkrun==1;iloop=iloop+1x=input(Enterinitialdisplacements[x(1)x(2)x(3)]:)fprintf(InitialVelocitiesareZero

279)mm=input(EnterRatioofSmallOuterMasses,m,toInnerMass,M:);b=mm;%tt=linspace(0,10);%fori=1:100t=tt(i);X1(i)=eval(x1);X2(i)=eval(x2);X3(i)=eval(x3);end%figure(iloop)plot(tt,real(X1),tt,real(X2),:,tt,real(X3),-.)title(MotionoftheThreeMasses,timein1/\omegaUnitsofOuterMasses)xlabel(time)ylabel(displacement)legend(x1,x2,x3)%iloop=iloop+1;figure(iloop)fori=1:100plot(real(X1(i))-10,0.,o,real(X2(i)),0.,*,real(X3(i))+10,0.,o)axis([-1515-11])

280November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app250OneHundredPhysicsVisualizationsUsingMATLABtitle(MovieofMotionoftheThreeMasses)xlabel(displacement)holdonxcou(1)=real(X1(i))-10;ycou(1)=0;xcou(2)=real(X2(i));ycou(2)=0;xcoup(2)=real(X3(i))+10;ycoup(2)=0;xcoup(1)=real(X2(i));ycoup(2)=0;plot(xcou,ycou,–,xcoup,ycoup,–)holdoffpause(0.1)endendend%2.4.ScatteringAngleandForceLaws%%ProgramtocomputethetrajectoryforscatteringofdiffferentForceLaws%useMATLABode%functionScattForceLaw%clear;helpScattForceLaw;%Clearmemoryandprintheader%globaliforceqq%%menu%fprintf(EnergyandMassDefined=1

281)%irun=1;iloop=0;%

282November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics251whileirun>0kk=menu(PickAnotherForceLaw?,Yes,No);ifkk==2irun=-1;breakendifkk==1%iforce=menu(F(r)=1/r∧n,n=1,n=2,n=3,n=4);qq=menu(Repel/Attract?,Attractive,Repulsive);ifqq==1qq=-1;%attractiveendifqq==2qq=1;%repulsiveend%E=1;m=1;vo=sqrt((2.0.*E)./m);%unitssoinitialvelocity=sqrt(2)b=linspace(0.4,4,10);%impactparameteriloop=iloop+1;jloop=iloop;tspan=linspace(0,20,50);N=length(tspan);xc(1)=0;yc(1)=0;%%protectforattractiveandcentralforcesifqq==-1&&iforce>2b=linspace(1.0,6.6,10);endforii=1:10[t,y]=ode45(@impact,tspan,[vo-100b(ii)]);%initialvx=vo,vy=0,x=-10,y=b%

283November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app252OneHundredPhysicsVisualizationsUsingMATLABxx=y(:,2);yy=y(:,4);forjj=1:Nfigure(jloop)plot(xx(jj),yy(jj),o,xc,yc,*)title(TrajectoryofScatteringforThisForceLaw)xlabel(x)ylabel(y)ifqq==-1axis([-1520-205])endifqq==1axis([-1520020])endpause(0.05)endcostheta=y(N,2)./sqrt(y(N,2).∧2+y(N,4).∧2);%scatteredangletheta(ii)=acos(costheta);figure(jloop+1)plot(xx,yy,-,xc,yc,*)title(TrajectoryofScatteringforThisForceLaw)xlabel(x)ylabel(y)holdonendholdoffiloop=iloop+2;figure(iloop)plot(b,theta,-)title(ScatteringAnglevs.Impactparameter)xlabel(b)ylabel(\theta)%endend

284November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics253%%------------------------------------------functiondy=impact(t,y)globaliforceqq%dy=zeros(4,1);r=sqrt(y(2).∧2+y(4).∧2);ififorce==1fr=qq.*1.0./r.∧1.0;endififorce==2fr=qq.*1.0./r.∧2.0;endififorce==3fr=qq.*1.0./r.∧3.0;endififorce==4fr=qq.*1.0./r.∧4.0;enddy(1)=(y(2)./r).*fr;dy(3)=(y(4)./r).*fr;dy(2)=y(1);dy(4)=y(3);%2.5.ClassicalHard-SphereScattering%%Programtosolve2bodyNRcollsions.Targetatrest.Nodecays%clearall;helpcmNRscatt%Clearthememoryandprintheader%%Initialize-SetupMomentumandEnergyconservation%0+T->1+2butnon-relativisticsomo=1=m1,elasticonly%assumeovelocityisin+x,Tisatrest

285November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app254OneHundredPhysicsVisualizationsUsingMATLAB%fprintf(NonRelativisticElasticScattering,IncidentMass=1,TargetMassVariable

286)%%nowsomenumericalplots%irun=1;iloop=0;whileirun>0kk=menu(PickAnotherTargetMass?,Yes,No);ifkk==2irun=-1;breakendifkk==1%u=input(EnterTargetMass:);%%looponscatteringangleofrecoilingtarget%findrecoilvelocityandscatteredprojectileangleandvelocity%fori=1:100cph(i)=i./101;%recoilanglesph(i)=sin(acos(cph(i)));%%graphicsforinlinecollision%v2(i)=(2.0.*cph(i))./(1.0+u);%recoilvelocityfact1=1.0+v2(i).∧2-2.0.*v2(i).*cph(i);v1(i)=sqrt(fact1);%scatteredprojectilevelocityst(i)=(v2(i).*sin(acos(cph(i))))./v1(i);%scatteredprojec-tileanglect(i)=cos(asin(st(i)));v1y(i)=v1(i).*st(i);v1x(i)=v1(i).*ct(i);v2y(i)=-v2(i).*sph(i);

287November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics255v2x(i)=v2(i).*cph(i);end%iloop=iloop+1;figure(iloop)plot(cph,v2,-);title(VelocityOfOutgoingTargetw.r.t.IncomingVelocityvs.OutgoingAngle)xlabel(cos\phi)ylabel(velocity)%iloop=iloop+1;figure(iloop)plot(ct,v1,-);title(VelocityOfOutgoingProjectilew.r.t.IncomingVelocityvs.ScatteringAngle)xlabel(cos\theta)ylabel(velocity)%iloop=iloop+1;figure(iloop)plot(v1,v2,-)title(VelocityofProjectilevs.VelocityofTarget)xlabel(vprojectile)ylabel(vtarget)%iloop=iloop+1;fori=1:10figure(iloop);%%incidentprojectile%xp(1)=-1;yp(1)=0;xp(2)=0;yp(2)=0;

288November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app256OneHundredPhysicsVisualizationsUsingMATLABxsp(1)=xp(2);ysp(1)=yp(2);j=i.*10;xsp(2)=v1x(j);ysp(2)=v1y(j);plot(xsp,ysp,r:)xst(1)=xp(2);yst(1)=yp(2);xst(2)=v2x(j);yst(2)=v2y(j);plot(xp,yp,b-,xsp,ysp,r:,xst,yst,g-.)title(Scatteringfor10RepresentativeAngles)axis([-1.21.2-11]);xlabel(xComponentofVelocity)ylabel(yComponentofVelocity)legend(projectile,scattproj,recoiltar)pause(1);endend%end%2.6.BallisticsandAirResistance%%Programtocomputethetrajectoryofaprojectilewithairresistance%clear;helpcmballissym;%Clearmemoryandprintheader%symsgkxytvoalfaxaypqppqqttt%%eqsofmotionofprojectilefallingundergravity%

289November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics257fprintf(ProjectileMotion,AirResistance-Acceleration=k*dy/dt

290);fprintf(Airresistancek(sec∧-1),InitialAngle/Velocityalf,vo-x(t)andy(t)

291);%p=dsolve(D2x+k*Dx=0,Dx(0)=vo*cos(alf),x(0)=0);pp=dsolve(D2x=0,Dx(0)=vo*cos(alf),x(0)=0);pretty(p)fprintf(x(t)WithNoResistance

292)pretty(pp)%q=dsolve(D2y+k*Dy+g=0,Dy(0)=vo*sin(alf),y(0)=0);qq=dsolve(D2y+g=0,Dy(0)=vo*sin(alf),y(0)=0);pretty(q)fprintf(y(t)WithNoResistance

293)pretty(qq)%%terminalvelocity%fprintf(yVelocityWithAirResistance

294);%ttt=diff(q,t);pretty(ttt)%gg=9.8;%MKSunitsm/sec∧2kkk=0.1;%has1/Tunits%irun=1;iloop=0;%whileirun>0kk=menu(PickAnotherInitialVelocityandAngle?,Yes,No);ifkk==2irun=-1;breakendifkk==1

295November20,20139:349inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app258OneHundredPhysicsVisualizationsUsingMATLAB%symsgkxytvoalfaxaypqppqqtttfprintf(ProjectileMotion,AirResistance-InitialVelocityvo

296);%voo=input(EnterInitialProjectileVelocity(m/sec):);%aa=input(EnterInitialProjectileAngle(deg):);%aa=(aa.*2.*pi)./360.0;%%pickmaxtimefromnoresistancecase%tt=linspace(0,(2.0.*voo.*sin(aa))./gg);%p=dsolve(D2x+k*Dx=0,Dx(0)=vo*cos(alf),x(0)=0);pp=dsolve(D2x=0,Dx(0)=vo*cos(alf),x(0)=0);q=dsolve(D2y+k*Dy+g=0,Dy(0)=vo*sin(alf),y(0)=0);qq=dsolve(D2y+g=0,Dy(0)=vo*sin(alf),y(0)=0);alf=aa;%g=gg;k=kkk;vo=voo;%fori=1:100t=tt(i);xxx(i)=eval(p);%resistancedxdtyyy(i)=eval(q);%resistancedydtifyyy(i)<0;yyy(i)=0;endend%fori=1:100t=tt(i);

297November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics259Xxx(i)=eval(pp);%freefallYyy(i)=eval(qq);ifYyy(i)<0Yyy(i)=0;endend%iloop=iloop+1;%figure(iloop)plot(tt,xxx,tt,Xxx,:)title(xasafunctionoft,withandwithoutairresistance)xlabel(t(sec))ylabel(x(m))%iloop=iloop+1;figure(iloop)plot(tt,yyy,tt,Yyy,:)title(yasafunctionoft,withandwithoutairresistance)xlabel(t(sec))ylabel(y(m))%iloop=iloop+1;figure(iloop)jj=length(xxx);xmax=max(Xxx);ymax=max(Yyy);fori=1:jjplot(xxx(i),yyy(i),o,Xxx(i),Yyy(i),*)title(xasafunctionofy,withandwithoutairresistance)xlabel(x(m))ylabel(y(m))pause(0.1)axis([0,xmax,0,ymax])holdonend

298November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app260OneHundredPhysicsVisualizationsUsingMATLABholdoffplot(xxx,yyy,-,Xxx,Yyy,:)title(xasafunctionofy,withandwithoutairresistance)xlabel(x(m))ylabel(y(m))legend(AirResist,NoResist)%endend2.7.RocketMotion—Symbolic%%Solvenon-relativisticrocket,symbolically-nofrictionorforces%clearall;helpcmrocketsym%Clearthememoryandprintheader%%solvetherocketequation-freeofforces%fprintf(Solved2y/dt2=vo/(T-t),vo=exhaustvelocityw.r.t.rocket,TisBurnTime=mo/dmdt

299)%vs=dsolve(Dy-vo/(T-t),y(0)=0);ys=dsolve(D2y-vo/(T-t),y(0)=0,Dy(0)=0);v=simple(vs);vy=simple(ys);y%fprintf(FinalVelocity=vo*ln(mo/mp),mp=PayloadMass-WorkswithMulti-StageAnalysis

300)%fprintf(SolveWithRocketinaUniformGravityField-g

301)%vg=dsolve(Dy-vo/(T-t)+g,y(0)=0);

302November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics261yg=dsolve(D2y-vo/(T-t)+g,y(0)=0,Dy(0)=0);v=simple(vg);vy=simple(yg);y%%gobacktothesimplerocketwithnoforcesandmakeplots%totalpossibleburntimeTismo/(dm/dt)=10000%payloadratiomp/mo=1-tp/T,tp=burntimeforthispayload%fprintf(NumericalResults:totalpossibleburntime=T

303)fprintf(Payloadratiomp/mo=>Payloadburntimetp=T(1-mp/mo)

304)fprintf(vo=exhaustvelocity,accelerationinvo/Tunits,velocityinvounits

305)fprintf(DistanceattheendofpayloadburninvoTunits

306)%%irun=1;iloop=0;%whileirun>0kk=menu(PickAnotherPayloadRatio?,Yes,No);ifkk==2irun=-1;breakendifkk==1%mpmo=input(InputthePayloadRatio:);tpT=1.0-mpmo;%burntimeforthispayloadtt=linspace(0,tpT);acel=1.0./(1.0-tt);%accelerationinvo/Tunitsvel=log(1.0./(1.0-tt));%velocityinvounitsdis=(1.0-tt).*(1.0./(1.0-tt)-1.0-log(1.0./(1.0-tt)));%distanceinvoTunits

307November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app262OneHundredPhysicsVisualizationsUsingMATLAB%iloop=iloop+1;figure(iloop)semilogy(tt,acel,-)title(Rocket-Accelerationinvo/Tunits)xlabel(TimeinTotalPossibleBurnTimeUnitsfrom0toPayloadBurnTime)ylabel(Accelerationinvo/Tunits)%iloop=iloop+1;figure(iloop)plot(tt,vel,-)title(Rocket-Velocityinvounits)xlabel(TimeinTotalPossibleBurnTimeUnitsfrom0toPayloadBurnTime)ylabel(Velocityinvounits)%iloop=iloop+1;figure(iloop)forj=1:length(tt)plot(tt(j),dis(j),*)title(Rocket-Distanceinvo*Tunits)xlabel(TimeinTotalPossibleBurnTimeUnitsfrom0toPayloadBurnTime)ylabel(Distnaceinvo*Tunits)axis([0,max(tt),0,1])pause(0.1)endplot(tt,dis,-)title(Rocket-Distanceinvo*Tunits)xlabel(TimeinTotalPossibleBurnTimeUnitsfrom0toPayloadBurnTime)ylabel(Distnaceinvo*Tunits)%endend%

308November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics2632.8.RocketMotion—Numerical%%Solvenon-relativisticrocket,numericallyusingSaturnVasanexample%clearall;helpcmrocketnum2%Clearthememoryandprintheader%%solvetherocketequation-doneincmrocketsym%nowdosomenumericalevaluations%gg=9.8;%accelatearthsurfacem/sec∧2re=6.378.*10.∧6;%earthradius-mveq=(2.0.*pi.*re)./(24.*3.6.*10∧3);%equatoriallaunchvelocitykm/secrs=1.5.*10.∧11;%distancetosun-mme=6.0.*10.∧24;%earthmass-kgms=2.0.*10.∧30;%sunmass,-kg%vorb=sqrt(gg.*re);%orbitalvelocity-circular,loworbitve=sqrt(2.0.*gg.*re);%escapevelocityforEarth∼11.2km/secvs=ve.*sqrt(ms.*re./(me.*rs));%escapevelocitytoleavesolarsystem∼42km/sec%fprintf(Velocity,SatelliteLowCircularOrbit(m/sec)=%g

309,vorb);fprintf(EscapeVelocity-Earth(m/sec)=%g

310,ve);fprintf(EscapeVelocity-SolarSystem(m/sec)=%g

311,vs);fprintf(EquatorialLaunchVelocity(m/sec)=%g

312,veq);%irun=1;iloop=0;%whileirun>0kk=menu(PickAnotherRocket?,Yes,No);ifkk==2

313November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app264OneHundredPhysicsVisualizationsUsingMATLABirun=-1;breakendifkk==1%%totalpossibleburntimeTismo/(dm/dt)%payloadratiomp/mo=1-tp/T,tp=burntimeforthispayload%mo=input(InputtheRocketMass(in10∧6kgunits)-Saturn=4x10∧6kg:);mo=mo.*10.∧6;mp=input(InputthePayloadMass(inkg)-SaturnEscapeModule=24610kg:);vo=input(InputtheExhaustVelocity(inm/sec)-Saturn=2200m/sec:);dmdt=input(InputBurnRate(inkg/sec)-Saturn=15000kg/sec:);%T=mo./dmdt;%maxpossibleburnrate,withnopayloadtp=T.*(1-mp./mo);%burntimeforthispayloadmpf=mo.*exp(-ve./vo);%estimatedpayloadforfreerockettoattainescapevelocitymps=mo.*exp(-vs./vo);%escapevelocityfromthesolarsystem%fprintf(MaximumBurnTime(sec)=%g

314,T);fprintf(BurnTimeforThisPayload(sec)=%g

315,tp);fprintf(PayloadMassforFreeRockettoAttainEarthEscapeVelocity=%g

316,mpf);fprintf(PayloadMassforFreeRockettoAttainSolarEscapeVelocity=%g

317,mps);%tt=linspace(0,tp);tt=tt./T;%

318November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics265%thefreerocket%fori=1:length(tt)x=1.0./(1.0-tt(i));AF(i)=(vo./T).*x;VF(i)=vo.*log(x);YF(i)=vo.*T.*(1.0-1./x-log(x)./x);endtt=tt.*T;%%therocketinauniformfield=g%tl=-vo./gg+T;%t=0isignition,t=tlislifttime,whenacceleration>0ul=T-tl;fprintf(TimeAfterIgnitionforAccelerationtobe>0,Liftoff=%g

319,tl);%fori=1:length(tt)iftt(i)

320November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app266OneHundredPhysicsVisualizationsUsingMATLABxlabel(BurnTime-sec)ylabel(Acceleration)legend(Freerocket,Rocketing)%iloop=iloop+1;figure(iloop)semilogy(tt,VF,-,tt,VG)holdonsemilogy(tt,vorb,r-,tt,ve,r:,tt,vs,r–)title(Rocket-Velocityinm/sec)xlabel(BurnTime-sec)ylabel(Velocity)legend(Freerocket,Rocketing,OrbitalVelocity,EarthEscapeVelocity,SunEscapeVelocity)holdoff%iloop=iloop+1;figure(iloop)%jj=length(YF);xmax=max(tt);ymax=max(YF);fori=1:jjsemilogy(tt(i),YF(i),o,tt(i),YG(i),*)title(Rocket-Distancem)xlabel(BurnTime-sec)ylabel(Distance-m)pause(0.1)axis([0,xmax,0,ymax])holdonendholdoffsemilogy(tt,YF,-,tt,YG)holdonsemilogy(tt,re,r-)title(Rocket-Distancem)

321November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics267xlabel(BurnTime-sec)ylabel(Distance-m)legend(Freerocket,Rocketing,EarthRadius)holdoff%endend%2.9.TakingtheFreeSubway%%earthsubway-computefreefallthroughchordofearth%clearall;%Clearmemoryhelpcmsubway2;%Printheader%%Initializevariables,subwayisdefinedbychord%g=9.81;%Gravitationalacceleration(m/s∧2)re=6.38.*10.∧6;%Earthradius(m)%fprintf(“Free”Subway-EarthRadius=%g(m)

322,re);%irun=1;iloop=0;%whileirun>0kk=menu(PickAnotherSubwayDistance?,Yes,No);ifkk==2irun=-1;breakendifkk==1%%pickchordfor“free”subway

323November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app268OneHundredPhysicsVisualizationsUsingMATLAB%dist=input(EnterSubwayDistanceinkm:);dist=dist.*1000;theta=asin(dist./(2.0.*re));depth=re.*(1-cos(theta));sdist=(re.*2.0.*theta);%fprintf(FreeSubwayMaxDepth=%g(m)

324,depth);fprintf(FreeSubwayDistanceAlongEarth=%g(m)

325,sdist);%%Gausslaw-uniformEarthdensity==>forceduetodistancetoearth%center,massinsidescalesatr∧3%eqofmotionis;accel=gx/re,dueto|a|=GM/r∧2∼randdir%cosine=x/r%startwithnovelocity,supplynoenergy=”freesubway”-”drop”todestination%simpleharmonicmotion%omega=sqrt(g./re);%SHMfrequencyT=(2.0.*pi)./omega;%periodT=T./2.0;%tripisoneway=1/2periodfprintf(CircularFrequency=%gTripTime=%g(sec)

326,omega,T)%t=linspace(0,T);x=-re.*sin(theta).*cos(omega.*t);%N=length(t);forjj=1:Nplot(t(jj),real(x(jj)-x(1)),o)title(MovieofSubwayTrip)xlabel(time(sec))ylabel(DistanceTraversedbySubway(m))axis([0t(N)0max(x-x(1))])

327November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics269pause(0.1)endiloop=iloop+1;figure(iloop)plot(t,real(x-x(1)))title(x(m)asafunctionoftalongthesubway)xlabel(t(sec))ylabel(x(m))%endend%2.10.Large-AngleOscillations—Pendulum%%Programtocomputethemotionofasimplependulum%usingMATLABtools%functioncmpendul%clearall;helpcmpendul%Clearthememoryandprintheader%globalgLvotho%fprintf(Pendulum-LargeOscillations

328);%irun=1;iloop=0;%whileirun>0kk=menu(PickAnotherPendulum?,Yes,No);ifkk==2irun=-1;break

329November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app270OneHundredPhysicsVisualizationsUsingMATLABendifkk==1%%Setinitialpositionandvelocityofpendulum%tho=input(EnterInitialAngle(degrees):);tho=(tho.*pi)./180.0;%Convertangletoradiansvo=input(EnterInitialAngularVelocity(degrees/sec):);vo=(vo.*pi)./180.0;gL=input(Enterg/LinMKSunits:);%%smallangleperiod,omeg=sqrt(gL);%omega=sqrt(gL);T=(2.0.*pi)./omega;tt=linspace(0,2.0.*T);%fprintf(SmallAngleCircularFrequency=%g1/sec

330,omega);fprintf(SmallAnglePeriod(sec)=%g

331,T);fprintf(Period=2*pi*sqrt(L/g)IncreasedbyFactor1+thetao∧2/16

332);%%numericalsolutionusingODEtools%[t,y]=ode45(@pend,tt,[votho]);%%smallangleSHMforcomparison%yyy=tho.*cos(omega.*tt)+(vo.*sin(omega.*tt))./omega;yyyy=-tho.*omega.*sin(omega.*tt)+vo.*cos(omega.*tt);%iloop=iloop+1;figure(iloop)yy=y(:,1);plot(t,yy,-,tt,yyyy,:)title(AngularVelocity)

333November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics271xlabel(t(sec))ylabel(d\theta/dt)legend(FullSolution,SmallOscillation)%iloop=iloop+1;figure(iloop)zz=y(:,2);N=length(t);forj=1:N%plot(t(j),zz(j),o,tt(j),yyy(j),*)title(AngularPosition)xlabel(t(sec))ylabel(\theta(rad))legend(FullSolution,SmallOscillation)axis([0max(t),min(zz),max(zz)])pause(0.1)endplot(t,zz,b-,tt,yyy,r:)title(AngularPosition)xlabel(t(sec))ylabel(\theta(rad))legend(FullSolution,SmallOscillation)endend%functiondy=pend(t,y)%globalgLvotho%dy=zeros(2,1);dy(1)=-gL.*sin(y(2));dy(2)=y(1);%

334November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app272OneHundredPhysicsVisualizationsUsingMATLAB2.11.DoublePendulum%%Programtocomputethemotionof2coupledpendula%usingMATLABtools,chaoticlargeanglemotion%functioncmchaotic%clearall;helpcmchaotic%Clearthememoryandprintheader%globalLvotho%fprintf(TwoCoupledPendulum-LargeOscillations

335);%irun=1;iloop=0;%whileirun>0kk=menu(PickAnotherTwoInitialAngles?,Yes,No);ifkk==2irun=-1;breakendifkk==1%%Setinitialpositionofpendula%tho=input(EnterInitialAngles(degrees),Velocities=0,[th1,th2]:);tho=(tho.*pi)./180.0;%Convertangletoradians%L=input(EnterLinMKSunits,m=1andg/L=1:);L=1;vo=[00];%

336November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics273%numericalsolutionusingODEtools%tspan=linspace(0,50,100);[t2,y2]=ode45(@pend2,tspan,[vo(1)vo(2)tho(1)tho(2)]);%iloop=iloop+1;figure(iloop)yy1=y2(:,1);yy2=y2(:,2);plot(t2,yy1,-b,t2,yy2,r:)title(AngularVelocityofPendula)xlabel(t(sec))ylabel(d\theta/dt)legend(FirstPendulum,SecondPendulum)%iloop=iloop+1;figure(iloop)yy3=y2(:,3);yy4=y2(:,4);plot(t2,yy3,-b,t2,yy4,r:)title(AngularPositionofPendula)xlabel(t(sec))ylabel(\theta(t)-rad)legend(FirstPendulum,SecondPendulum)%iloop=iloop+1;figure(iloop)zz1=y2(:,3);zz2=y2(:,4);N=length(t2);forj=1:N%xxx1(1)=0;yyy1(1)=0;xxx1(2)=L.*sin(zz1(j));yyy1(2)=-L.*cos(zz1(j));

337November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app274OneHundredPhysicsVisualizationsUsingMATLABxxx2(1)=xxx1(2);yyy2(1)=yyy1(2);xxx2(2)=xxx1(2)+L.*sin(zz2(j));yyy2(2)=yyy1(2)-L.*cos(zz2(j));plot(xxx1,yyy1,-b,xxx2,yyy2,-r,xxx1(1),yyy1(1),*g,xxx1(2),yyy1(2),bo,xxx2(2),yyy2(2),ro)title(TwoPendula)xlabel(x)ylabel(y)axis([-1.51.5-2.50.5])pause(0.1)endendend%functiondy=pend2(t,y)%globalLvotho%dy=zeros(4,1);fact=dy(3).*dy(4).*sin(y(3)-y(4))+3.*sin(y(3));dy(1)=-(L.∧2.*fact)./2.0;fact=-dy(3).*dy(4).*sin(y(3)-y(4))+sin(y(4));dy(2)=-(L.∧2.*fact)./2.0;fact=16.0-9.0.*(cos(y(3)-y(4)).∧2);dy(3)=6.0./(L.*L.*fact);dy(3)=dy(3).*(2.0.*y(1)-3.0.*cos(y(3)-y(4)).*y(2));dy(4)=6.0./(L.*L.*fact);dy(4)=dy(4).*(8.0.*y(2)-3.0.*cos(y(3)-y(4)).*y(1));%2.12.CoriolisForce%%ProgramtolookatCoriolisforce,symbolicsolutionplusnumerical%FreefallonSurfaceoftheEarth

338November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics275%clearall;helpcmcoriolis;%Clearmemoryandprintheader%fprintf(CoriolisForce,NothernHemisphere,wisw*cos,Latitude

339);%%lookatsymbolicODEsolution,zvertical,xsouth,yeast%symsyzwgyyzz%[yy,zz]=dsolve(D2y=-2*Dz*w,Dy(0)=0,y(0)=0,D2z=g,Dz(0)=0,z(0)=0);%fprintf(zisVertical,xisSouthandyisEast

340)%zzyy%w=(2.0.*pi)./(24.*60.*60);%Earthrotation,rad/secg=9.8;%accelerationinm/sec∧2%%nownumericalevaluations%irun=1;iloop=0;%whileirun>0kk=menu(PickAnotherFreeFallHeightandLatitude?,Yes,No);ifkk==2irun=-1;breakendifkk==1%

341November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app276OneHundredPhysicsVisualizationsUsingMATLABzh=input(EnterInitialFreeFallHeight(m):);th=input(EnterLatitude(deg):);th=(2.0.*pi.*th)./360.0;%z=linspace(0,zh);zz=z(100)-z;%%z=gt∧2/2-removettofindy(z)%y=-((g.*w.*cos(th)).*(((2.0.*z)./g).∧1.5))./3.0;yy=y(1)-y;%fprintf(TotalEastwardDeflection(m)=%g

342,yy(100));%iloop=iloop+1;figure(iloop)plot(yy,zz)xlabel(y(m))ylabel(z(m))title(FreeFallCoriolisDeflection)%end%end%2.13.KeplerOrbits—Numerical%%Kepler—Programtocomputesolarsystemorbits-simplenumericalintegration%functioncmkepl3%clearall;%Clearmemoryhelpcmkepl3;%Printheader

343November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics277%globalGMo%%Initializevariables%G=6.67.*10.∧-11;%MKSunitsMo=2.0.*10.∧30;%solarmassau=1.49.*10.∧11;%AU=earth-Sundistance,myr=60.0.*60.0.*24.0.*365.0;%sec%irun=1;iloop=0;%whileirun>0kk=menu(PickAnotherSolarOrbit?,Yes,No);ifkk==2irun=-1;breakendifkk==1%ro=input(EnterInitialDistancero(AU):);roa=ro.*au;%ve=sqrt((2.0.*G.*Mo)./roa);%escapevelocityfprintf(EscapeVelocity,v=%gm/sec

344,ve);%vc=sqrt(G.*Mo./roa);fprintf(Velocityofcircularorbit,v=%gm/sec

345,vc);T=(2.0.*pi.*roa)./vc;fprintf(Forcircularorbit,period=%gsec

346,T);fprintf(ForEarthOrbit,1au=%gm,period=%gsec

347,au,yr);%voy=input(Enterinitialtangentialvelocity(AU/yr),2\piforCircle:);

348November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app278OneHundredPhysicsVisualizationsUsingMATLABvox=input(Enterinitialradialvelocity(AU/yr):);%%Setupforplottingtheorbit%%converttom,sec%vox=(vox.*au)./yr;voy=(voy.*au)./yr;%tspan=linspace(0,5.0.*T,200);[t,y]=ode45(@kepler,tspan,[voxroavoy0]);%iloop=iloop+1;figure(iloop)%N=length(tspan);Nloop=0;forj=1:Nxx(j)=y(j,2)./roa;yy(j)=y(j,4)./roa;endforj=1:N-1if(yy(j+1).*yy(j)+0.001>0)||(yy(j+1)<0)Nloop=Nloop+1;xxl(Nloop)=xx(j);yyl(Nloop)=yy(j);elsebreakendendxmax=max(xxl);xmin=min(xxl);ymax=max(yyl);ymin=min(yyl);%%themoviefirst,tounderstandorbitalvelocity

349November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics279%fori=1:Nloopplot(xxl(i),yyl(i),o)holdontitle(TrajectoryofOrbit,5CircularPeriodsorStoponRepeat)xlabel(x/ro)ylabel(y/ro)plot(0.0,0.0,r*)axis([xminxmaxyminymax])pause(0.1)endholdoff%plot(xxl,yyl,-,0.0,0.0,r*)title(TrajectoryofOrbit,5CircularPeriodsorStoponRepeat)xlabel(x/ro)ylabel(y/ro)axis([xminxmaxyminymax])end%end%%------------------------------------------%functiondy=kepler(t,y)globalGMo%dy=zeros(4,1);r=sqrt(y(2).∧2+y(4).∧2);fr=-(G.*Mo)./(r.∧2.0);dy(1)=(y(2).*fr)./r;dy(3)=(y(4).*fr)./r;dy(2)=y(1);dy(4)=y(3);%

350November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app280OneHundredPhysicsVisualizationsUsingMATLAB2.14.AnalyticKeplerOrbits—EnergyConsiderations%%Programtocomputesolarsystemorbits,closedandopen%clearall;%Clearmemoryhelpcmkepl;%Printheader%G=6.67.*10.∧-11;%MKSunitsMo=2.0.*10.∧30;%solarmass,kgau=1.49.*10.∧11;%AU=earth-Sundistance,myr=60.0.*60.0.*24.0.*365.0;%yearinsec%irun=1;iloop=0;%whileirun>0kk=menu(PickAnotherSolarOrbit?,Yes,No);ifkk==2irun=-1;breakendifkk==1%ro=input(EnterInitialDistancero(AU):);%fprintf(L∧2isGMro/m∧2foraCircularOrbitatRadiusro

351);%%FindEffective1-dPotential-UsecentrifugalPotential,V∼1/r∧2%xxx=linspace(0.25,10.0);%rvariationinrounitsVeff=1./(2.0.*xxx.*xxx)-1.0./xxx;xmin=1;%minofVeffVeffmin=-1.0./2.0;%Veffatmin%

352November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics281iloop=iloop+1;figure(iloop)plot(xxx,Veff,xmin,Veffmin,*)title(EffectivePotentialforL∧2,Ec=-1/2,0>Eellipse>Ecircle)xlabel(r/ro)ylabel(Veff/(GMm/ro))axis([010-0.60.5])%%circularradiusforthisLisro,controllingvariableisenergy%E%ac=ro.*au;%inm%ve=sqrt((2.0.*G.*Mo)./ac);%escapevelocity,circularorbitvee=ve./1000.;vo=sqrt((G.*Mo)./ac);%circularvelocityvoo=vo./1000.;To=(2.0.*pi.*ac)./vo;%circularorbitperiodToo=To./yr;%fprintf(EscapeVelocity(km/sec)=%gatac(au)=%g

353,vee,ac./au);fprintf(Forcircularorbit,v(km/sec)=%g,Period(yr)=%g

354,voo,Too);%q=input(EnterTotalEnergyinUnitsofCircularEnergy-G*M*m/2*ro,=q>-1:);ecc=sqrt(1.0+q);%eccentricity%ifq<-1fprintf(NoSolution

355);endifq>0fprintf(HyperbolicOrbits

356);%turningpointsofpotentialintermsofro-i.e.ellipticalaxes

357November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app282OneHundredPhysicsVisualizationsUsingMATLABx1=(1.0./q).*(-1.0+sqrt(1.0+q));x2=(1.0./q).*(-1.0-sqrt(1.0+q));%eccentricityise=sqrt(1+q)fprintf(ForHyperbolicOrbit,TurningPointinrounits=%g

358,x1);holdonplot(x1,-q.*Veffmin,o)holdoff%endifq==0fprintf(ParabolicOrbits

359);endifq<0&q>=-1fprintf(EllipticalOrbits

360);%%findtheturningpoints,axesandperiod%ac=ac./au;%circularorbitradiusinrounitsofauae=ac./abs(q);%majoraxisbe=ae.*sqrt(1.0-ecc.∧2);%minoraxis%periodTT=(2.0.*pi.*(ae.*au).∧1.5)./sqrt(G.*Mo);TT=TT./yr;%turningpointsofpotentialintermsofro-i.e.ellipticalaxesx1=(1.0./q).*(-1.0+sqrt(1.0+q));x2=(1.0./q).*(-1.0-sqrt(1.0+q));%eccentricityise=sqrt(1+q)%fprintf(ForEllipticalOrbit,Major/MinorAxes(au)=%g,%g

361,ae,be);fprintf(ForEllipticalOrbit,TurningPointsinrounits=%g,%g

362,x1,x2);fprintf(ForEllipticalOrbit,OrbitalPeriod(yr)=%g

363,TT);fprintf(ForEllipticalOrbit,Eccentricity=%g

364,ecc);%

365November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics283holdonplot(x1,-q.*Veffmin,o,x2,-q.*Veffmin,o)holdoff%end%%populatecosthetaandfindtheradiusr,inrounits-xasabove%iloop=iloop+1;figure(iloop)theta=linspace(0,2.*pi);ct=cos(theta);st=sin(theta);Xr=1.0./(1.0+ct.*ecc);dth=theta(2)-theta(1);%%numericalintegrationtogetelapsedtimeonorbitpoints,tinunitsofTo%t(1)=0;fori=2:100t(i)=t(i-1)+dth./(2.0.*pi.*((1.0+ct(i).*ecc).∧2));end;%%velocityinunitsofcircularvelocityatradiusac%vel=sqrt(q+2.0.*(1.0+ct.*ecc));%xx=ct.*Xr;yy=st.*Xr;%plot(xx,yy,b-,0,0,r*);ifq<0.0&q>=-1holdon

366November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app284OneHundredPhysicsVisualizationsUsingMATLABminx(1)=(x1-x2)./2;minx(2)=(x1-x2)./2;miny(1)=-be;miny(2)=be;majx(1)=x1;majx(2)=-x2;majy(1)=0;majy(2)=0;plot(minx,miny,-r,majx,majy,g-)axissquareaxisequalholdoffendtitle(OrbitforthisChoiceofroandE)xlabel(x/ro)ylabel(y/ro)%iloop=iloop+1;figure(iloop)plot(theta./(2.0.*pi),t.*To./yr)xlabel(orbitangle/2\pi)ylabel(TimeElapsed(yr))title(OrbitalTimeasaFunctionofOrbitalAngle)%iloop=iloop+1;figure(iloop)plot(theta./(2.0.*pi),vel)xlabel(orbitangle/2\pi)ylabel(OrbitalVelocity)title(OrbitalVelocityinUnitsofCircularVelocityatRadius=ro)end%end%

367November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics2852.15.StableOrbitsandPerihelionAdvance%%ProgramtolookatPerturbedCircularOrbits-Stability,andPerihelionAdvance%functioncmcirclorbit%clearall;helpcmcirclorbit;%Clearmemoryandprintheader%globalItypenb%fprintf(CircularOrbits-Perturbed

368);%%nownumericalevaluations%irun=1;iloop=0;%whileirun>0kk=menu(PickAnotherPowerLaw?,Yes,No);ifkk==2irun=-1;breakendifkk==1%n=input(EnterPowerLawForcenforf(r)∼1/r∧n:);fprintf(CircularOrbits-Perturbed,Stableonlyforn<3

369);%ifn<3fprintf(StablePerturbations:)elsefprintf(UnstablePerturbations:)end%

370November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-app286OneHundredPhysicsVisualizationsUsingMATLABfprintf(ForaGivenn,PeriodT∧2∼radius∧(n+1),KeplerisT∧2=r∧3

371)%%nowtimeintervalfor3circularorbits%picka=radius=1,f(a)=c/a∧nandc=1%pickm=1==>v=1%Itype=1;tspan=linspace(0,2.0.*pi);[t,y]=ode45(@Perihel,tspan,[0.00.1]);%fprintf(Initialpositionisdisplacedbyx(0)=0.10

372)fprintf(Initialvelocityisv(o)=1,DimensionlessUnits

373)%iloop=iloop+1;figure(iloop)plot(t./(2.0.*pi),y(:,2))xlabel(t(periods))ylabel(x/a)title(DeviationfromCircularOrbitOverOneUnperturbedPeriod)%end%end%nowtheperihelionadvance%fprintf(PerihelionAdvance-InverseSquareLawPlusSmallInverseFourthPower

374)Itype=2;b=input(InputtheCoefficientoftheFourthPower:);tspan=linspace(0,6.0.*pi);[t,y]=ode45(@Perihel,tspan,[0.00.1]);fprintf(Initialpositionisdisplacedbyx(0)=0.10

375)fprintf(Initialvelocityisv(o)=1,DimensionlessUnits

376)%

377November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appAppendix—ScriptforClassicalMechanics287iloop=iloop+1;figure(iloop)plot(t./(2.0.*pi),y(:,2))xlabel(t(periods))ylabel(x/a)title(DeviationfromClosedOrbitOverThreePeriods)%iloop=iloop+1;figure(iloop)plot(cos(t)+y(:,2),sin(t))xlabel(t(periods))ylabel(x/a)title(OrbitOverThreePeriods)%%------------------------------------------%functiondy=Perihel(t,y)%globalItypenb%dy=zeros(2,1);ifItype==1;%perturbedcircorbits-differentforcelaws-ndy(1)=-1.0./(1+y(2)).∧n+1.0./(1.0+y(2)).∧3;dy(2)=y(1);%y(1)=vx,y(2)=xend%ifItype==2;%centralinversesqlawwithsmall(b)inversefourthpowerdy(1)=-1.0./(1+y(2)).∧2-b./(1+y(2)).∧4+(1.0+b)./(1.0+y(2)).∧3;dy(2)=y(1);%y(1)=vx,y(2)=xend

378November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-appThispageintentionallyleftblank

379November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ref289References1.NumericalMethodsforPhysics,2ndEd.,AlejandroL.Garcia,PrenticeHall,2000,ISBN:0-13-906744-2.Thistexthascompan-ionscriptwhichIhavefoundveryusefulasastartingpointforsomeexercises.2.NumericalRecipesinFortran77:TheArtofScientificComput-ing,2ndEd.,W.H.Press,S.A.Teukolsky,W.T.Vetterling,andB.P.Flannery,CambridgeUniversityPress,1992,ISBN9780521430647.Thisbookisaveritableencyclopediaofnumericalmethods.Therearemanyexcellenttextbooksavailableforuseasreferences.However,astechnologyhasevolved,theincreasinguseofonlineresourcesisathand.Therefore,acompletesetofpapertextbooksisnotquotedhere.Ratherthesearchenginesandcompiledonlineknowledgebasesareinvoked.3.Googleisanenormouslyusefulsearchengineandmanyspecificsearcheswillyieldagreatvarietyofinformation.4.WikipediahasalargestoreofinterestingPhysicstopics,andasearchthroughthemwillveryoftenstarttheuseronagoodpath.Indeed,aparticulararticleoftenhasmanylinksthatcanbefolloweddeeperintothetopic.Anexampleofthefirstpageofasearchfor“ComptonScattering”isshownbelow.Thereareadditionallinksandreferencesprovidedthatgivetheuseraverygoodreferenceexperience.Indeed,whilelookingattheMAT-LABscriptsforthistext,theusercaneasilydipintotheonlineresourcesandgainfurtherknowledge.

380November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-ref290OneHundredPhysicsVisualizationsUsingMATLAB

381November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-index291Indexaberration,107centrifugalpotential,55,150,176,280acceleratedcharge,87Cerenkov,103addingwaves,90,91chaotic,48,272airfoil,133–135chemicalpotential,123,125–128,airresistance,39–41,256–260130–132,145,146,231angstrom,90,130,140,147–149,154,fermions,127157–161,163,171,219chirp,210,211,215angularmomentum,54,149–152,chisquared,18,19174–177circularaperture,98,99antenna,215clumping,216atmosphere,116,117,119,181,205complexvariables,72,132,133,135atomicnumber,152,223Comptonscattering,199,201,202atomicradius,151–153Comptonwavelength,201atomicshell,232conductivity,137,139,142,143contour,64,66,68–70,74,88,131,beatfrequency,91132,175,189,194,195,199,212,Bessel,96,97,176213beta,193convectivemixing,223bigbang,226,229,230,239coredensity,223binarystars,210corepressure,223bindingenergy,148,154,217,218,coretemperature,222,223232,233Coriolis,50,274–276Biot-Savert,68blackbody,145cosmicrays,205,236blackhole,208,210,220cosmologicalconstant,239Bohrradius,154Coulomb,36,149,156,167,172,173,Bornapproximation,171217,218,223Bose-Einstein,123,129barrier,167,217,223boundstate,59,147,150,154–156,coupledpendula,244,272158–160,162–164,168criticaldensity,226,227,233,237bulkmodulus,219criticalenergy,237criticaltemperature,125,126,capacitor,79,80128–130cascade,204criticalwavenumber,127

382November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-index292OneHundredPhysicsVisualizationsUsingMATLABcrosssection,35,38,138,139,173,farzone,87236fastFouriertransform,78cyclotron,85,86,198Fermienergy,127,131,218Fermipressure,217–222darkenergy,226,229,233,236,237Fermi-Dirac,123darkmatter,233,234,236flatuniverse,227,236,237datafitting,16flowsource,135,136deBrogliewavelength,125,130,156fluidflow,116,132,135,140decay,178–180,191–194,205forcelaws,31,33,54,156,171,174,angles,192,193250,287densityofstates,124Fourierseries,12–14,16,94deuterium,168,229,232,233freeparticle,162,163,176,177,207differentiation,2,4freezeout,231–233diffraction,90,97–102Fresneldiffraction,100diffusion,142–144,147Friedmannequation,236dipole,63,64,67–69,87,89,113,199,functions,1–5,9,10,13,14,16,18,210,21530,31,76,96,97,100,112,123,125,126,146,150,154,155,157,Doppler,103,227,234158,160,165,175,176,208,237doubleslit,98fusion,167,168,217–219,223,230driftvelocity,138,139drivenoscillator,94Gcoupling,207,226drum,96–98gamma,187,193,194,204dsolve,10,12,21,24,28,31,39,41,Gaussian,18,20,21,15550,92,176,186,240,241,244,248,Gauss-Seidel,76,78257,258,260,261,275generalrelativity,181,206,220geodesic,205–207,209eccentricity,54,55,57,281,282gradient,21,63,72,74,76,79,111,edgediffraction,100112,132,223effectivepotential,55,56,281gravitationalradiation,210,211,214,eigenvalues,10,11,31,248215Einsteinring,234,235harmonicoscillator,13,23,24,electricpotential,63154–156,162,163,240elementalabundance,230heat,46,137,142–144,147,162ellipse,51–53,55–57helium,116,118,126,127,130,153,energyforcelaw,54154,217,232,233energylevel,123,150,152,156,157,abundance,232160Helmholtz,69,86energyloss,197,198,204,211Hubbleconstant,226,227,229,237energyproduction,223Hubbletime,228entropy,230hydrogenatom,148,151–153,156escapevelocity,43,45,51,55,83,hydrogenstar,224116,118,263,264,266,277,281hyperbola,36,53,55,57,59exhaustvelocity,39,41,43,44,186,187,260,261,264idealgaslaw,116,119exothermicfusion,217imagecharge,65,66

383November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-indexIndex293impactparameter,33,35,235,251,metrictensor,236252microwavebackground,226–229indexofrefraction,103,106,107,minimumionizing,194,196,198,204,109,110,164236inflation,239molecule,30,31,116,117,119,121,integration,3,5,12,22,39,52,53,137–140,247,24862,127,131,172,174,223,276,283moments,145ionization,151,152,154,181,198,momentumimpulse,36,119,194,196205momentumtransfer,119,137,138,172–174Joukowskiprofiles,133movie,23,25,28,30–33,37,39,41,43,44,46–49,51,53,65,83,85,86,Kepler,23,51,53,59,148,150,176,91,94–98,107,121,137,138,143,276,278–280,286161–164,170,182,183,192,196,kinematics,36,37,191,193,194,201,204,211,212,214,216,217,247,234250,268,278Klein–Nishina,201movingcharge,194–196muon,181,203–206Laplaceequation,72,74,77leadblock,206nearzone,87lifetime,178–181neutron,38,217–221,230–232lift,44,135,265star,210,219lightdeflection,234noblegas,153,232lightpolarization,105non-linear,48,112,113lightpressure,79,81,185Lorentzforce,83occupationnumber,123,125,127Lorentztransformation,182,191,199ode45,22,33,47,51,61,81,83,189,luminosity,81,146,210,222–224223,251,270,273,278,286opacity,223,229magneticcurrentloop,67opaqueuniverse,228–230magneticraytracing,107–111,115orbitalvelocity,43,51,55,57,58,magneticshield,71263,266,278,284massdifference,231oscillator,13,23,24,26,31,93,94,MATLAB,1–5,7,9,10,13,16–18,143,154–156,162,163,24021,23,28,30,31,33,39,41,47,48,overdamped,24150,51,61,63,64,67,72,74,78,83,92,97,98,100,112,119,125–127,packetscattering,169,171,172131,142,149,154,159,161,162,packetspreading,161,163170,172,174–176,178–180,189,pancake,194223,240,248,250,269,272parabola,55,57,58,282matrix,10,11,18–21,30,111,112,payload,40–45,81,186,260–262,264248pdepe,21,142,162,170matterdominated,226,227,237perihelionadvance,59,285,286Maxwell–Boltzmann,116,117,120,period,13,14,23,47,55,59,62,165,122,123,139210,214,215,268,270,277,279,mesh,70,71281,282,286,287

384November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-index294OneHundredPhysicsVisualizationsUsingMATLABperiodictable,151,153resonance,23permeability,71–73Riemannzetafunction,125,146photoelectric,202,203rocketmotion,39,181,260,263photon,79,88,89,145,146,199,rotationcurve,234201–204,223,226,228,230,232,Rutherford,33,35,36,173233pipe,140–142scalefactorR,227,238Planck,145,147scattering,31,33–38,89,147,152,pluckedstring,94,95,97,157162,164,167,169–174,176,191,pointcharge,63,65,69192,194,199,201,202,250,Poissonequation,77,80,141252–256potentialbarrier,167,169Schr¨odinger,143,176powerlawsolution,227Schwarzchild,209probability,116,118,144,147,151,radius,209162,165,167,177searchlight,199properacceleration,182–184,187series,5,7,12–16,47,91,94,125,propertime,182,205,207,208126,188,197proton,33,38,85,86,154,197,singleslit,99,100217–219,226,230–232Snell’slaw,105,109therapy,197solarsail,79,81,82,185solve,7,8,10,11,21,30,36,37,65,quad,22,131,17476,92,126,142,170,189,247,253,quadrupolelens,110,112260,263quadrupolesdoublet,111,112sphericalBessel,176quantumnumber,148,150,151,153,sphericalharmonic,149,174–176155,174sphericallens,109–111quiver,72,74,76,79sphericalmirror,107–110squarewell,156,158,159,163,172,radiatedpower,88,198,199173radiation,87,89,103,145,181,194,stellarradius,220,221198,199,204,205,210,211,214,stepscattering,164215,219,224,226–230,236streamlines,132–136dominated,226–230radiusofcurvature,108–110,190,191subway,45,46,267–269Ramsauer,168–170superfluid,126,127randomnumber,119,178symbolicmath,1,2,94range,39,61,169,194,197,211,229,233Taylor,5,6,11,12,24,60,154,188redshift,226,227Thompsonscattering,89,201reflection,81,96,105–108,119,127,tidalforce,210,212,215164–168,217tidalpotential,212,213relativisticdecay,191timedilation,181–183,185–187,194,relativisticradiation,198206relativisticrocket,185,186,260,263transmission,105–107,165–169relativisticscattering,191triatomic,30,31,247relicabundance,231tunneling,167

385November13,201314:269inx6inOneHundredPhysicsVisualizationsUsingMATLABb1610-indexIndex295undamped,24,242wavefunction,147–151,154–156,underdamped,241158–160,163,165,167,176uniformdensitystar,222wavelength,90,97–102,104–106,125,universe,1,23,145,217,224,130,156,227226–230,233,234,236–239wavenumber,87,90,98,99,124,127,utilities,2,10,21,22147,148,158,161,165,167,168,170,176vacuumdensity,236,237wavepacket,143,159,161–164,viscosity,132,137,139–141169–172volumeflow,141

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。
关闭