📄 montecarlomaplet.mw
字号:
PP:= pointplot({seq([RTd[n],temp[n]],n=1..Nr-1)}, labels=["radius (cm)", Transmittance], axes=boxed,colour=black):#PPa:= pointplot({seq([RTd[n],tempa[n]],n=1..Nr-1)}, labels=["radius (cm)", Transmittance], axes=boxed,colour=red):pprT:=[seq([RTd[n],temp[n]],n=1..Nr-1)];#pprTa:=[seq([RTd[n],tempa[n]],n=1..Nr-1)];save pprT,`Tra_rad_graph_points.m`:RETURN(display[plots](PP));<Font foreground="[153,0,153]">end:</Font><Font foreground="[0,0,0]"></Font></Font></Text-field></Input></Group></Section></Section><Section collapsed="false" MultipleChoiceAnswerIndex="-1" MultipleChoiceRandomizeChoices="false" TrueFalseAnswerIndex="-1" EssayAnswerRows="5" EssayAnswerColumns="60"><Title><Text-field style="Heading 1" layout="Heading 1"><Font foreground="[51,51,255]">II - The Maplet</Font></Text-field></Title><Section collapsed="false" MultipleChoiceAnswerIndex="-1" MultipleChoiceRandomizeChoices="false" TrueFalseAnswerIndex="-1" EssayAnswerRows="5" EssayAnswerColumns="60"><Title><Text-field style="Heading 2" layout="Heading 2"><Font size="18">1. Construction of the Maplet</Font> </Text-field></Title><Group labelreference="L11" drawlabel="true"><Input><Text-field prompt="> " style="Maple Input" layout="Normal"><Equation executable="true" style="2D Input" input-equation="Typesetting:-mrow(Typesetting:-mi(""))">LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2OVEhRicvJSdmYW1pbHlHUTBUaW1lc35OZXd+Um9tYW5GJy8lJXNpemVHUSMxMEYnLyUlYm9sZEdRJmZhbHNlRicvJSdpdGFsaWNHUSV0cnVlRicvJSp1bmRlcmxpbmVHRjcvJSpzdWJzY3JpcHRHRjcvJSxzdXBlcnNjcmlwdEdGNy8lK2ZvcmVncm91bmRHUShbMCwwLDBdRicvJStiYWNrZ3JvdW5kR1EuWzI1NSwyNTUsMjU1XUYnLyUnb3BhcXVlR0Y3LyUrZXhlY3V0YWJsZUdGOi8lKXJlYWRvbmx5R0Y3LyUpY29tcG9zZWRHRjcvJSpjb252ZXJ0ZWRHRjcvJStpbXNlbGVjdGVkR0Y3LyUscGxhY2Vob2xkZXJHRjcvJTBmb250X3N0eWxlX25hbWVHUSkyRH5JbnB1dEYnLyUqbWF0aGNvbG9yR0ZDLyUvbWF0aGJhY2tncm91bmRHRkYvJStmb250ZmFtaWx5R0YxLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy8lKW1hdGhzaXplR0Y0</Equation><Font size="10" foreground="[0,0,255]">use Maplets[Elements] inwith(Maplets[Elements]):</Font><Font size="10"></Font><Font size="9"> MonteCarloMaplet:= Maplet('onstartup' = RunWindow( 'W0' ), Font['F00']( 'family' = "times",bold,'size'=12 ), Font['F0']( 'family' = "arial",bold,'size'=12 ), Font['F1']( 'family' = "arial",bold,'size'=14 ), Font['F2']( 'family' = "times",bold, 'size'=20 ), Font['F3']( 'family' = "times",bold, 'size'=14 ),</Font><Font background="[255,255,153]" opaque="true" size="14">Window['W0']('title'= "MAIN WINDOW",</Font><Font size="9">BoxRow(BoxColumn( #### BoxColumn 1 starts'hscroll'='always','vscroll'='always','inset'=0,'spacing'=15,'valign'='top', Label("<Font background="[153,255,102]" opaque="true">INPUT PANEL</Font> ",'font'=Font(Arial,bold,16)),[Button("Explanation of INPUT ",'foreground'=black,'background'=white, 'font'='F1', RunWindow('Win'))],[BoxRow(GridLayout('border'='true', 'inset'=0, 'caption'="<Font background="[255,255,102]" opaque="true">Number of photons </Font> " ,'font'='F1', GridRow('halign'='left', GridCell('halign'='left',"Enter a number >500 "), GridCell('halign'='left', TextField['TF_2']('width'=6,'background'=grey, 'editable'='true', 'font'='F1')), GridCell('halign'='left'," ")))) <Font foreground="[0,0,0]"># end gridrow ; gridlayout ; BoxRow</Font></Font>,<Font size="9">BoxRow(GridLayout('border'='true', 'inset'=0, 'caption'="<Font background="[255,255,102]" opaque="true">Entry Angle </Font> " ,'font'='F1', GridRow('halign'='left', GridCell('halign'='left',"Enter a number between 0 and 90 "), GridCell('halign'='left', TextField['TF_0']('width'=6,'background'=grey, 'editable'='true', 'font'='F1')), GridCell('halign'='left'," "))))] <Font foreground="[0,0,0]"># end gridrow ; gridlayout ; BoxRow</Font></Font>,<Font size="9">[BoxRow(GridLayout('border'='true', 'inset'=0, 'caption'="<Font background="[255,255,102]" opaque="true">Number of tissue layers</Font> " ,'font'='F1', GridRow('halign'='left', GridCell('halign'='left',"Enter an integer value "), GridCell('halign'='left', TextField[TF_1]('width'=3,'background'=grey, 'editable'='true', 'font'='F1')), GridCell('halign'='left'," ")))) <Font foreground="[0,0,0]"># end gridrow ; gridlayout ; boxrow</Font>,BoxRow(GridLayout('border'='true', 'inset'=0, 'caption'="<Font background="[255,255,102]" opaque="true">Layers' refraction indices</Font>" ,'font'='F1', GridRow('halign'='left', GridCell('halign'='left'," [n1, n2, ...] "), GridCell('halign'='left', TextField['TF_3']('width'=5,'background'=grey, 'editable'='true', 'font'='F1')), GridCell('halign'='left'," "))))] <Font foreground="[0,0,0]"># end gridrow ; gridlayout ; boxrow</Font>,[BoxRow(GridLayout('border'='true', 'inset'=0, 'caption'="<Font background="[255,255,102]" opaque="true">Layers' scattering coefficients</Font>" ,'font'='F1', GridRow('halign'='left', GridCell('halign'='left'," [cs1, cs2, ...] "), GridCell('halign'='left', TextField['TF_4']('width'=5,'background'=grey, 'editable'='true', 'font'='F1')), GridCell('halign'='left'," 1/cm ")))) <Font foreground="[0,0,0]"># end gridrow ; gridlayout ; BoxRow</Font>,BoxRow(GridLayout('border'='true', 'inset'=0, 'caption'="<Font background="[255,255,102]" opaque="true">Layers' absorption coefficients </Font>" ,'font'='F1', GridRow('halign'='left', GridCell('halign'='left'," [ca1, ca2, ...] "), GridCell('halign'='left', TextField['TF_5']('width'=5,'background'=grey, 'editable'='true', 'font'='F1')), GridCell('halign'='left'," 1/cm "))))] <Font foreground="[0,0,0]"># end gridrow ; gridlayout ; BoxRow</Font>,[BoxRow(GridLayout('border'='true', 'inset'=0, 'caption'="<Font background="[255,255,102]" opaque="true">Layers' anisotropy coefficients</Font>" ,'font'='F1', GridRow('halign'='left', GridCell('halign'='left',"[g1, g2, ...] "), GridCell('halign'='left', TextField['TF_6']('width'=5,'background'=grey, 'editable'='true', 'font'='F1')), GridCell('halign'='left'," ")))) <Font foreground="[0,0,0]"># end gridrow ; gridlayout ; BoxRow</Font>,BoxRow(GridLayout('border'='true', 'inset'=0, 'caption'="<Font background="[255,255,102]" opaque="true">Layers' depths</Font>" ,'font'='F1', GridRow('halign'='left', GridCell('halign'='left'," [d1, d2, ...] "), GridCell('halign'='left', TextField['TF_7']('width'=5,'background'=grey, 'editable'='true', 'font'='F1')), GridCell('halign'='left'," cm "))))] <Font foreground="[0,0,0]"># end gridrow ; gridlayout ; BoxRow</Font>),[BoxColumn('hscroll'='always','vscroll'='always','inset'=0,'spacing'=15,'valign'='top', Label(" SELECT GEOMETRY TYPE</Font> <Font size="9"> ",'font'=Font(Arial,bold,16)),BoxRow(GridLayout('border'='true', 'inset'=0, 'caption'="<Font background="[255,255,102]" opaque="true">Cylindrical Layers</Font>" ,'font'='F1', GridRow('halign'='left', GridCell('halign'='left',"Input maximum radius "), GridCell('halign'='left', TextField['TF_r']('width'=3,'background'=grey, 'editable'='true', 'font'='F1')), GridCell('halign'='left'," cm ")</Font>))), <Font size="9" foreground="[0,0,0]"># end gridrow ; gridlayout ; BoxRow</Font><Font size="9">CheckBox['ChB1']('caption'="For cylindrical layers check here", 'value' = 'false' ), #[Button("Proceed ",'background'=white,'foreground'=black, 'font'='F1', RunWindow('W1'))],BoxRow(GridLayout('border'='true', 'inset'=0, 'caption'="<Font background="[255,255,102]" opaque="true">Prismatic Layers</Font>" ,'font'='F1', GridRow('halign'='left', GridCell('halign'='left',"Input maximum x,y dimensions [x,y] "), GridCell('halign'='left', TextField['TF_xy']('width'=6,'background'=grey, 'editable'='true', 'font'='F1')), GridCell('halign'='left'," cm ")</Font>)))<Font size="9">, <Font foreground="[0,0,0]"># end gridrow ; gridlayout ; BoxRow</Font>CheckBox['ChB2']('caption'="For prismatic layers check here", 'value' = 'false' ), BoxRow(GridLayout('border'='true', 'inset'=0, 'caption'="<Font background="[255,255,102]" opaque="true">Infinitely Long Layers</Font>" ,'font'='F1', GridRow('halign'='left', GridCell('halign'='left'," Infinite radius assumed ")#, </Font>)))<Font size="9"> , <Font foreground="[0,0,0]"># end gridrow ; gridlayout ; BoxRow</Font>CheckBox['ChB3']('caption'="For inifnite layers check here", 'value' = 'false' ), MathMLViewer['ML']('foreground'=black,'background'=grey,'height'=2,</Font> 'width'=1),<Font size="9"> Button("CLEAR Run Status BOX", Action(</Font>SetOption('ML' = "")))<Font size="9">,CheckBox['ChB4']('caption'="If only numerical results are required, check here", 'value' = 'false' ), Button("Start Simulation",'foreground'=black, 'background'=white,'font'='F00',Evaluate('ML' = 'SimulationMC()')) </Font> ,<Font size="9"> [Button("Explanation of OUTPUT",'background'=white, 'foreground'=black,'font'='F1',RunWindow('Wout'))],[Button("Proceed to numerical results",'background'=white,'foreground'=black, 'font'='F1', RunWindow('W1')),Button("Proceed to graphical results",'background'=white,'foreground'=black, 'font'='F1', RunWindow('W2'))]),Button['B3']( "Close Window", Shutdown() )])), <Font foreground="[0,0,0]"># end of boxcolumn,boxrow,window</Font></Font><Font background="[255,255,153]" opaque="true" size="14">Window['Win']('title'= "Explanation of Input",</Font><Font size="9">BoxRow( BoxColumn( TextBox['TF_I']('editable' = 'false',16..60, " The INPUT WINDOW consists of two columns where data must be entered in order for the Monte Carlo simulation to proceed. On the left column the entries are: number of photons (integer - >500 recommended) entry angle (angle in degrees with respect to layer's surface) number of tissue layers (integer) layers indices of refraction (list) layers absorption coefficients (list) layers scattering coefficients (list) layers anisotropy coefficient (list) layers depths (list) Note that the lists have as many entries as the number of layers; the list format requires that entries be separated by commas and enclosed in square brackets. Ranges of acceptable input values are given in the literature (eg., </Font><Font size="10">L.Wang, S.L.Jacques and L.Zheng, Computer Methods and Programs in Biomedicine, vol 47, (1995), 131-146)</Font></Text-field><Text-field prompt="> " style="Maple Input" layout="Normal"><Font size="9"> On the right column, three options, for the layers geometry type, are presented: cylindrical, prismatic and infinite layers.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -