Learn R Programming

MCBackscattering (version 0.1.1)

Simulation: Runs the Monte Carlo Simulation

Description

This function performs all actions to run the simulation. It calls other functions that prepare computation and calculate photon trajectory. Please keep in mind, that this technique can be slow depending on the number of photons and computational power of your hardware.

Usage

Simulation(myObject,iAngle=0)

Arguments

myObject

The mandatory parameter of this function is the MCBS class created by MCBS constructor function.

iAngle

The optional parameter iAngle defines the incident angle of light beam. It is measured from normal position, perpendicular to the surface. The default value is zero (iAngle=0). This parameter is passed to Launch function.

Value

The Simulation function returns an MCBS object as class. Typically the same object is used in argument and result. The main objective of the simulation is to calculate spatial photon flux. The flux is computed with radial averaging relative to the incident point. Each value represent the average flux of the ring with the width of resolution (1 pixel).

heat

calculated photon flux, 1/cm^2

Details

The function Simulation, alias Simulation.MCBS, was designed to take every steps such as Setup initial conditions and compute each photon trajectory individually. It was written keeping clarity in mind. In case you want to make your own procedure, this function can be used as a template.

The result of simulation is photon flux, which is expressed as relative fluence rate (F/P, 1/cm^2) where F is the fluence rate and P is the power of light source. The fluence rate (F) is computed in concentric rings around the incident point.

References

Farrell, T.J., Patterson, M.S., Wilson, B. (1992) A diffusion theory model of spatially resolved, steady-state diffuse reflectance for the noninvasive determination of tissue optical properties in vivo. Medical Physics, 19(4): 879--888. 10.1118/1.596777.

Jacques, S.L. (1998) Light Distributions from Point, Line and Plane Sources for Photochemical Reactions and Fluorescence in Turbid Biological Tissues. Photochemistry and Photobiology, 67(1): 23-<U+2013>32. 10.1111/j.1751-1097.1998.tb05161.x.

Wang, L., Jacques, S.L., Zheng, L. (1995) MCML <U+2013> Monte Carlo modeling of light transport in multi-layered tissues. Computer Methods and Programs in Biomedicine, 47: 131-<U+2013>146. 10.1016/0169-2607(95)01640-F.

Wang, L., Jacques, S.L., Zheng, L. (1997) CONV-convolution for responses to a finite diameter photon beam incident on multi-layered tissues. Computer Methods and Programs in Biomedicine, 54: 141<U+2013>-150. 10.1016/S0169-2607(97)00021-7.

Zo<U+0142>ek, N.S., Liebert, A., Maniewski, R. (2006) Optimization of the Monte Carlo code for modeling of photon migration in tissue. Computer Methods and Programs in Biomedicine, 84: 50<U+2013>-57. 10.1016/j.cmpb.2006.07.007.

Baranyai, L., Zude, M. (2009) Analysis of laser light propagation in kiwifruit using backscattering imaging and Monte Carlo simulation. Computers and Electronics in Agriculture, 69: 33-<U+2013>39. 10.1016/j.compag.2009.06.011.

Baranyai, L. (2020) Laser induced diffuse reflectance imaging <U+2013> Monte Carlo simulation of backscattering measured on the surface. MethodsX, 7: 100958. 10.1016/j.mex.2020.100958.

See Also

MCBS for construction of object with initial input parameters. Setup for initial computation of specular reflection and transport albedo. Randomize for adjustment of random trajectory vectors. print show adjusted parameters and total backscattered reflection. Chart for plot of calculated photon flux profile. Export for export of photon flux with corresponding radii.

Examples

Run this code
# NOT RUN {
## Apple simulation data according to Qin and Lu (2006).
## DOI: 10.13031/2013.20862

# create object
cfgMedia <- c(0.63,30,0,1.4)
# the 100 low number of photons is only for demonstration
cfgSimulation <- c(100,0.05,1e-9,3,0.1)
apple <- MCBS(cfgMedia,cfgSimulation)

# run simulation with default incident angle
apple <- Simulation(apple)
print(apple)

# run simulation with 10 deg incident angle
apple <- Simulation(apple,10)
Chart(apple)
# }

Run the code above in your browser using DataLab