monte-carlo modeling used to simulate propagation of...
TRANSCRIPT
Monte-Carlomodelingusedtosimulatepropagationof
photonsinamediumNilsHaëntjens– OceanOpticsClass2017
basedonlecturesfromEmmanuelBoss andEdouardLeymarie
WhatisMonteCarloModeling?
• MonteCarlomodelingconsistinrepeatedrandomsamplingtoobtainnumericalresults.• Usedtobuildasolutiontotheradiativetransferequationbysimulatingpropagationofphotonsinamedium.• Increasingcomplexitycanbeaddedasthemodelisdeveloped.
ImplementingStepbyStepStepsandconceptsneededtoimplementaMonte-Carlomodelusedtosimulatethepropagationofphotonsinamedium:• Randomnumbergenerator• Absorption• Scattering• VariableWeightofPhotons• Indexofrefraction
RandomNumberGeneration• FirststeprequiredforaMonteCarlomodelistohaveamethodtogeneraterandomnumbers• Randomnumbergeneratorsproduce”pseudo”randomnumbers• Essentialpropertiesofarandomnumbergenerator:• repeatability:usingseeds• randomness:produceindependentuniformlydistributedrandomnumbers• longperiod:sequenceusedtoproducetherandomnumberuseafiniteperiod• insensitivetoseeds:periodandrandomnesspropertiesarenotaffectedbytheinitialseeds
Exercise1:RandomNumberGenerator
• Generate10000randomnumbersX in[0 1]• Matlab:rand.m
• CheckthattheX areuniformlydistributed• dividethe[0 1] axisinto20equalintervals• frequencyoccurrenceofX is500ideally• standarddeviation< 36
• Howsensitiveistherandomnumbergeneratortochangeinseeds?
Exercise1:ResultsMatlab2017a:rand.m; seed=1;n=10000;
Attenuationofacollimatedbeam
• Howphotonsareabsorbedinthemedium?• AbsorptionobeysBeer’sLaw:
𝐸 = 𝐸#𝑒%&'withz thedepthwithinthemedium(m)
a Absorptioncoefficient(m-1)
ØTheprobabilityofabsorptioninthemediumwithin[z z+δz] isa δz with δz << 1/a
Exercise2:Attenuationofacollimatedbeam
• Assumephotoncanbe:• absorbed• transmitted• NOTscatteredØc = a = 1 m-1
• Noboundaries• norefraction
• FixedstepΔz = 20 cm• absorptioncanonlyoccurattheendofastep
New photon
Move photon Dz
New Position z=z+ Dz
Absorb?Increase
absorptionevents
Yes
n=10,000Yes
No
Stop
Exercise2:Results
Exercice 2b:Improvedalgorithm
• Asinglecalculationperphoton(faster)
• Removeassumptionoffixedstep
• Assumehomogeneouswater
New photon
Random number
Increase absorptionevents
N=10,000 ? Yes Stop
Absorption depth
𝑧 = 𝑙𝑐 =
−ln(𝑋)𝑎
𝑝 𝑙 = 𝑒%4, 𝑙 ≥ 0
P 𝑙 = 9𝑒%4:
#
𝑑𝑙 = 1 − 𝑒%4
𝑙 = − ln 1 − 𝑋 = − ln 𝑋 , 0 ≤ 𝑋 ≤ 1
Fromthedefinitionoftheopticaldistanceltheprobabilitydensityfunctionforattenuationoflightis
Thecumulativedistributionfunctionis
Todeterminel inMCSimulations,𝑃 𝑙 = 𝑋
Thegeometricpathlengthz (inmeters)canbecomputedwith
assumenoscattering
Absorption
Reflection
AddingScattering
• Keeptrackofeachphoton:• position,direction,andterminationpoint
Ørequiredforscattering
• Terminationofphoton:• absorbedbymedium• reflected(z <0)
• Assumeboundarieshavesameindexofrefraction• Variablesteplength
𝑧 =−ln(𝑋)𝑐
ScatteringProbabilities
Theprobabilitythataphoton,whenscattered,willscatteratpolarangle𝜓andazimuthalangleΦ awayfromtheincidentdirectionisgivenbythescatteringphasefunction𝛽B(𝜓,Φ) ofthemedium
𝑝(Ψ)and𝑝(Φ) areindependentofoneanotherForseawaterandforair,theazimuthalangleΦ withrespecttotheincidentdirectionisuniformlydistributedover[0 2π].
The polarangle𝜓 cumulativedistributionfunctionisΦ = 2πX
2𝜋9 𝛽B 𝜓 sin 𝜓 𝑑𝜓J
#
= 𝑋
Exercise3:AddingScattering
initialize array
new photon
move photonincrement reflected count
absorbed? calculate new direction
yes
yes
no
noIn medium
VariableWeightPhotons
• Increasecomputationalspeed• Biasingthedistributionfunction• tracemorephotonsthatarelikelytofindtheirwaytotheareaofinterestwithoutchangingthefinalcomputedresult
• Decreasephotons’weightalongtheirpath• Athresholdissettodeterminewhenthephoton’sweightisnotsignificantanymore.
SpecularReflection
Fromtheairsidewhenaphotonreachesanair-waterinterfaceIncident,reflectedandtransmittedangles
Fractionofreflectedlight
Air
Water
1n
2n
θi
θt
θr
DiffuseReflection
Onthewaterside,travelingfromwatertoair,thereisacriticalincidentangle𝜃𝑐 abovewhichthereisa100%reflection
Fractionofreflectedlight
),,( zyx
),,( zyx µµµ
),,( zyx -
),,( zyx µµµ -1n
2n
iq
Exercise4:SurfaceinteractionsStart
Initializing Photon
Update Reflectance and Photon Weight
Move Photon at a Variable Step
Update Photon Weight Due to Absorption
Photon in Water?
Weight Too Small?
Change Photon Direction
Last Photon?
No
Yes
Yes
Yes
No
No
NoYes
Internally Reflected?
Get Photon Position and Direction
Update Reflection
Keepaddingfeatures
• Keeptrackofphotons• Adddetectors• Addsourcesoflight• Seafloorinteractions• Non-homogenousmedium• Polarization• ....
SimulO – “SimulationOptique”• “Userfriendly”3DMonteCarlo
• photonsarefollowedfromthesourcetothepointwheretheyareabsorbed• Buildanydeviceassemblingandsizingelementaryobjects• SetOpticalproperties
• HomogenousVolumesproperties• refractiveindexofthematerial• absorptionandscatteringcoefficients• scatteringphasefunction
• uploadyours• built-in:purewater,isotropic,Henvey-Greenstein,Fournier-Forand
• HomogenousSurfaceproperties• transparent,specularorLambertian reflection
• Photonemissionlightsource• Photoncountingtools
• numberofcollisionsontheelementaryobjects• averageofphotonpathlength,averagenumberofscatteringeventsper
photons,numberofphotonsabsorbed
byEdouardLeymarie (Laboratoire d’Océanographie deVillefranche)
SimulO Applications• Self-ShadingsimulationsforBoussole
• 1billionphotons/wavelength/IOP• Doxaran D.,Leymarie E.,Nechad B.Dogliotti A.,RuddickK.,Gernez P.andE.Knaeps (2016).Improvedcorrectionmethodsforfieldmeasurementsofparticulatelightbackscatteringinturbidwaters.OpticsExpress,24(4),3615-3637.
• Song,G.,Xie,H.,Bélanger,S.,Leymarie,E.andM.Babin (2013).Spectrallyresolvedefficienciesofcarbonmonoxide(CO)photoproduction inthewesternCanadianArctic:particlesversussolutes.Biogeosciences,10,3731–3748
• Babin,M.,D.Stramski,R.A.Reynolds,V.M.Wright,andE.Leymarie (2012)Inpress.Determinationofthevolumescatteringfunctionofnaturalwatersamples.AppliedOptics,51,17,3853-3873
• Leymarie,E.,D.Doxaran,andM.Babin (2010).Uncertaintiesassociatedtomeasurementsofinherentopticalpropertiesinnaturalwaters,AppliedOptics,49,5415-5436
Surface
LimitationsofSimulO
• Ramanscatteringisnotimplemented• Nopolarization• Assumeperfectlyflatsurface(nowind)• Assumeblacksky(correctionwillbesubmitted)
ReflectiveTubeAbsorptionMeter(RTAM)Ratiobetweenmeasuredandthetrueabsorptioncoefficientsasafunctionofthereflectivityofthetube.
Kirk1992
Self-ShadingestimatedbybackwardMC
Sea surface
Lu Sensor
Forward representation
Sea surface
Lu Sensor
Self-ShadingestimatedbybackwardMC
Simulation1:Luinfinitely
smallNotshaded
LutrueNij
Simulation2:Lusensor+structureShaded
LumeasuredMij
30*120 hemisphere matrixAtm : a=0, b=0, n=1
water : a, b, bb/b, λ, n=1.34
Lu Sensor
Shading =𝑀𝑖𝑗
𝑁𝑖𝑗
LuShadingMatrix
notshaded→1shaded→0
• Assumptions• homogeneouswater• atmosphereisnotsimulated• flatseasurface(nowaves)• blacksky
Self-shadingwithablackskyHyperNav onfloat