RSRC LVINLBVW % D@<&0KV ُ B~MG췵RvJLVIN Decay_SIM.viLVINWrite To Spreadsheet File.vi  @0delimiter (Tab)@!transpose? (no:F)0@2'new file path (Not A Path if cancelled)@0 format (%.3f)"@!append to file? (new file:F)@@ 1D data@@ 2D data$@2file path (dialog if empty)PTH0:Utilityfile.llbWrite To Spreadsheet File.viLVINGeneral Histogram.vi  @@ X@@ HistogramT@@DP @ lower @ upper*@lowerupperbothneithers inclusionBins@@ Axis@ max.@P @total @below @above # outside@ min @error @# bins@lowerupper inclusionPTH04Analysis 5stat.llbGeneral Histogram.viP c$ c P   c^P"@P@flg@oRt@eofudfP Decay Rate, sec-1p dfdP txdP oldP ext c hP"@P@flg@oRt@eofudf P Counts in the First Channelp dfdP txdP oldP ext P   cbP"@P@flg@oRt@eofudfP Number of Time Pointsp dfdP txdP oldP ext P   c`P"@P@flg@oRt@eofudfP Time Increment, Secp dfdP txdP oldP ext P    P   cP"@P@flg@oRt@eofudf:PP@@ t@Simlated Decay Curve&pP@ @dfd&PP@ @txd&PP@ @old&PP@ @ext c jP"@P@flg@oRt@eofudf"P Background Counts per Channelp dfdP txdP oldP ext cdP"@P@flg@oRt@eofudfP!Press to Save as a Filex!dfdP!txdP!oldP!ext P @vP0@PP@P!!!!l@bP0   !!!    $@P0!!!B@8PPJ P@@@P0!!!b P         @P b P         @P  cbP"@P@flg@oRt@eofudfP Number of Time Pointsx dfdP txdP oldP ext c `P"@P@flg@oRt@eofudfP Time Increment, Secx dfdP txdP oldP ext c jP"@P@flg@oRt@eofudf"P Background Counts per Channelx dfdP txdP oldP extV P$@P@0P c c$ c c @ Decay Rate, sec-1 c@ y@@ y c @@ Histogram c@ min.@P @total @below @above # outside c@ max @error @# bins cT@@DP @ lower @ upper*@lowerupperbothneithers inclusionBins c@@ 2D data c@@ Axis c.@P @total @below @above # outside c@!transpose? (no:F) c@0delimiter (Tab)0@2'new file path (Not A Path if cancelled)@0 format (%.3f)($P@@ t@@@ 1D data"@!append to file? (new file:F) c@@@ t c @# bins @error@ min@lowerupper inclusion c @@ Axis c@lowerupper inclusion@@ Histogram c@ Decay Rate, sec-1 cT@@DP @ lower @ upper*@lowerupperbothneithers inclusionBins c @ Counts in the First Channel c@ Number of Time Points c! c"@ Background Counts per Channel$ @ Counts in the First Channel@ Number of Time Points@ Time Increment, Sec&"@ Background Counts per Channel @!Press to Save as a File@@ t$@2file path (dialog if empty) c@@ b c@ b c@ t cd c c c c c c c cd      c c c c c c c c c c c c c $    Z)r?zG{@^@Y@@e@@$@.@4@9@>@A@D@F@I@K@N@P@@Q@R@T@U@@V@W@Y@Z@@[@\@^@_@@`@@`@a@b @b@c`@d@d@e@@e@f@g @g@h`@i@i@j@@j@k@l @l@m`@n@n@o@@o@p@@p@p@q0@q@q@r @rp@r@s@s`@s@t@tP@t@t@u@@u@u@v0@v@v@w @wp@w@x@x`@x@y@yP@y@y@z@@z@z@{0@{@{@| @|p@|@}@}`@}@~@~P@~@~@@evwv~_YUWMK=LHL/A;;+C<2;9(1#!-"*"!         @$Activityee  !$&)+.0368;=@BEGJMORTWY\_a df iknpsv x{}&2##*#*#*-2-&2& J&2*2##B #* B@y Time, secCounts per Time Interval~@@@Y@4??@@?@$??|?6 0 t"  T.`p 2  @r @  @$  @B  @^ @    v $ H d . @   @B ` P @r. VIDS Decay_SIM.viVIDSWrite To Spreadsheet File.viPTH0VIDSGeneral Histogram.viPTH0"p i386! code"/d"E{DE`ETPUEd$=t1=Ð9 Ӏ}#t} uE(E!E"ɍ, HHH HHHHH H$H(H,H0H4ƅ( thhUEPt?9t$QRRVhht?D 9t$QRRVhh葬id$ZY= 6t 6 D ɍp ƅl ƅl fxJƅp ݅P QRP $ d$ZY݅ ݝP ƅp fxNPxB VW P _^ D @ 9} @ ?ƅD fx"ƅH tsD tsL tsT ts\0 tsd tsl ts| x <D8.UR@␐^t^tƅH fx&QRP8$hhP$d$ZY=tÐSƅL x'Džy Dž>t?9t$QRRVhhid$ZY=u 6t 6l ɍx ƅt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@ D DžH DžP Dž Dž Dž PTAB Džl t@l Dž @Dž Dž Dž @Dž @Dž @ Dž Dž Džt Džx Dž| PTABp h QRu sd$ZY(Ul$SQRVW}'uQRU蹿ed$ZY/_^ZY[]ÐUl$SQRVWt$$|$(SQRVWPEEXPE EXQRhhuhPED$Xhhd$ZY=tMEEQRhhuhPED$Xh՝hd$ZY=t_^ZY[ÐuP$P$Fd$ _^ZY[]ÐUl$SQRVWuۺF FsF@ǾFDQRhUoed$ZY_^ZY[]ÐTd$ZY_^ZY[]Ð DžT{Plqlz^  l2 ^  # g *#C<" g   =@?y+WUa'5oIM %G v,C]w+H$`CODE"/d"(6.0rc5Oldest compatible LabVIEW./!///!/:pPPP@ Decay Rate, sec-1 @ Counts in the First Channel@ Number of Time Points@ Time Increment, Sec:@P@@ t@Simlated Decay Curve"@ Background Counts per Channel@!Press to Save as a FileThis vi simulates a nuclear decay curve of the following form: A(t) = Ao*exp(-k*t) + B Where A(t) is the observed counts in a counting interval, Ao is the counts in the first channel, k is the decay time in units of inverse time, and B is the background in counts in a counting interval. An unique feature of this simulation is that it rigorously simulates the Poisson noise in any counting experiment. This is accomplished by simulating the decay of each nucleus as a random event that follows an exponential decay law. Thus, for each nucleus one takes a decay time from a random number generator which follows an exponentially declining probability function. This function is obtained by logarithmically transforming the uniform random number number according to the formula: td = (1/k)*rand() where td is the decay time of a single nucleus, k is the decay rate and rand() is one number from the uniform random number generator. The n random numbers generated in this manner can be formed into a histogram, which provides the representation of the data with noise. The number n is equal to the area under the decay curve. This is Ao/k if the experiment extends to long times. Experimental data is often observed to exhibit a constant background. This phenomenon also has Poisson noise. A similar technique based upon random numbers can also be used to obtain a background plus accompanying noise. In this case, starting with the desired average background count, B, one can calculate B*nc random numbers, where nc is the number of measurement channels. In this case, the random numbers are taken from a uniformly distributed random number generator. This set of numbers is then classified into nc bins uniformly distributed along the time axis. The overall decay curve is just the sum of the two histograms, one for the exponential decay and one for the background. The resulting simulated decay curve is plotted on a XY graph and stored to a spreadsheet file. q% (qǑa`PPXLvFICIAI@I@qI@ DTHPDL!/88 ~ J:@P@@ t@Simlated Decay Curve&@ Decay Rate, sec-1, @ Counts in the First Channel $@ Time Increment, Sec @error@ min>.@P @total @below @above # outside@ max @@ Axis`T@@DP @ lower @ upper*@lowerupperbothneithers inclusionBins(@lowerupper inclusion @# bins2"@ Background Counts per Channel*@ Number of Time Points!0*P0!!!0$@P0!!!$@@ Histogram(@!Press to Save as a File@ y@@ XL@  @@ X@@ HistogramT@@DP @ lower @ upper*@lowerupperbothneithers inclusionBins@@ Axis@ max.@P @total @below @above # outside@ min @error @# bins@lowerupper inclusion@@ y@ b@@ b@  @0delimiter (Tab)@!transpose? (no:F)0@2'new file path (Not A Path if cancelled)@0 format (%.3f)"@!append to file? (new file:F)@@ 1D data@@ 2D data$@2file path (dialog if empty)$@0delimiter (Tab)&@!transpose? (no:F)<0@2'new file path (Not A Path if cancelled)&@0 format (%.3f)2"@!append to file? (new file:F)&@@ 1D data*@@ 2D data0$@2file path (dialog if empty)@@ t@ t0$P@@ t@ @@ tq$H$X 4T 4T4X$\\\l4$$4$$Hd4$$44$,Pt(P$X$$$\\\dH H9/!M"MH=/ !M "MgCounts in the First Channel_zzTime Increment, SeccVVPress to Save as a FiledD?0\]?1\]Nuclear Decay Simulation`kx7kx7 Simlated Decay CurveUD$]^ Time, secHD$t:/HD9/d D$:Counts per Time IntervalN;;0.H=/HD9/## ]spspDecay Rate, sec-1H +/ L!LaNumber of Time PointsH`K/ L!Li"/"/Background Counts per ChannelH,/8!EM8"EMHD0+/h#u}h$u} HD6/>"K>#KHD0/HD<,/+8~+8~HD K/:G:GjD,9K,9KData for the Exponential DecaycD11Data for the BackgroundaDS-Sm-y =-(1/k)*ln(rand());MD|06|16yMDXeXekHD-/WD '' b = rand();MD*1+1bZDAssemble ArrayMDihD/</<Write To Spreadsheet File.vibD3@3@Data for the Time AxisRDYfYfBundleTDMw7MZ7t= i*dt;MDkxkxiMD]:j>];j>tNDXeXedtHD$6/SE , , False `DmbzmczGeneral Histogram.vi`DjkGeneral Histogram.vi  ..  FPHP Decay_SIM.vi2FPHPĸ"/8=2XL<8 $07,    X"/=/X!/L!/#YVE<7/DAB$!K0 x5B  !0o00X 6|AX"/,1/X!/L!/#YVE<7/D5B    /80AB$  J0 x52  7 FN00X |4  2 Nh04  2  N0p0YX"/ 0/X!/L!/#YVE<7/Dh5WT )-h(5ChW00X& t"|hY\h5B o052  KTp01  MP2  @ _p_pclA2  `o`odk0X( |,X\ $ LX"/+/X!/L!/#YVE<7/D@PBrq h#( ()))(%& &@&' %@PBX @4 4 B  Pp0@PB\ lH( .D. /$(+ +p+,,+@@PB{ Dh%4 B  {/]^o0 `0 k!  f>=$0!0$0$<x$ \X4 B jy800 K f{ > `0 2L( 0 2L-./ 4 3L^\0@ :J!DXfifi]r@ :L!.vYvYo`@ :K!/Cnanagh@ O`408 0 2 ( 0 2 - 4 6Lo0@O@4~D~4 6  o00  ~0  { >4 3 ^;,p04 $<o04 v 0@P~0B4Ap 2 4bmbmbm<Sp$0l"!""`p 2 8@clclcl0 w dk0 _0 0 w0 l0 W0 x>< t0 L 4Q@(!4 6, $00 , (dk0 7@ j0 @ l@ 6 V#CR\SXR\  (>*(>.(>*(>.(>*4O@(>!0  $ dp 2"DV@Elcdd@EKKlc@Eddlc4O@Tj|,, "D!,!"D ,4O@>T"x!H#( !Tj.Tj.Tj*Tj.Tj* "D>T*>T.>T*>T.>T*|fThis is the observed decay rate in inverse seconds. It is related to the half time by k = 0.693/t(1/2)m'`X"/uP:/X!/L!/#YVE<7/D5B  o01 4#KYkdq`'2  03?$lc3?$lc3?$lc4 B  rq|00  Qdk4  2 M0p 2  0clclclp 2  bmbmbmL :  %0vu0v/w.x-y=)2   ?K$mb?K$mb?K$mb] `0,118%D2l'2 <0%q2  02>lc2>lc2>lcp 2  0clclclp 2  bmbmbmL :   &0vu0v/w.x-y0  Rdk ,2   >Jmb>Jmb>Jmb h"""""4 B  8p00   Qdk4  2  Mt0p 2  0clclclp 2  bmbmbmL :  %0vu0v/w.x-yu/HX&$t* l +p++,,@+\,Dx\X"/&*/X!/L!/#YVE<7/Dp 2  0clclclp 2  bmbmbm0  Rdku1TX(T$- D D.. $/T/xHX"/&|E/X!/L!/#YVE<7/D4 B  !0p00  3JRdk4  2 7 FNp0u2B  0ABD h%p 2  02>cl2>cl2>clp 2  >Jbm>Jbm>JbmL :  7 F&0vu0v/w.x-y BDHP Decay_SIM.viLVINWrite To Spreadsheet File.viPTH0LVINGeneral Histogram.vi,3PTH0j BDHP|p!/8j j,^_b0D@(0@p^w;[K4 Bg"v~x00@pXM6]VUF44 B=!L00@p\h9YI4 BhLp00@p@;0KPC@4 B*9@o00@p HXP`4 B09Hdo0T D@ \:Dc;?AlX,=0A0$+ @(,l0&@,:JB ( @H  4 B+:L 04 B 2$0L J|K8d0S0!(4!K `-z.83,0"t "@,t4"K /Vg^00# #@=XA#@4#D|O 4#/DDdjX#,D*XLC%PF='d(T(p'(#-4#D<Q .4#"`7};D? #"((\#@ # @%(#\,##@6( l p#\4#PN .#t\8#4D PgxG< # # <0#5l bgok#  #@l!"l0#5l lGows# #@l$ <.0#5lcgxo #@l #@l ,#  4#D3pX.0#@p$ p(H 8 4# B po0T$ D-Cf0(> ( < 8 $$ P,$ \ @ |$0$ P $0$$ 9#$  $@ 0$& : $ 8 h$  h $@  8 $ h L$J P ,3In0 + %l% % 4%/D Z@i%x4%0 x ;i% % x x4%0 xd[i%x % x0x4%0 x<i% % xh%d44%0Plg%d %$.4%DX0 .% px4%DW .% 4%K  X=(3-<0&l &@ $l4&"` E:C>8 &"  & @ @&& ,&#@dD  && 4& PP .&l4&0 Fg&4 &7 4&08g& & <T.4&/DCg4&D;V,.4&DXUl.&d 4& Bd@0'4'KHD0( (@,4(`K.( ,(t P(>4,K L ^izqHp0-! -@ LD@ 4-K  L!`_[8l@c<4p0.!t .@ L#(!,!t.! !t#5=|(T8&j =4.D# Bh . 4."`"a^AgJbE" ."#(""L . @!""l."L"l. "l$,.#@"`"  ."L"l."l 4.#\g ..!t"L4.K L#gVg^n0/# /@ L##x$4/%4h .4/" $eW`[$ /"#$,/"L$H / @@$/$H$/"$,/#%f$/$H$/$H#/mThis case structure allows the operator to chose to store the simulated data as a file on pressing a button. 4/DE 0/@p(&&84/ B&ho0 0B'(p+0&l&& 0B($(p+0 0@@+(p+,0'('x<0$1P 4 -h0 1)@1) 101&),1('&1($101'*1&'01.&h0<61'41D(V!.1&+41&*tLp .01-*i41D*T . 1B') )@x1&l) 1B($)@x1))*81&) 1@@)p)@x1&*81)1x*841/D*&F(1+@+410*+,j.?61+@ 1*+*+410*+k.?61+ 1*(+`+1+@&41D+I(!.@11D,,{aim Д@/141-1-41 K,la{l0P2---.<../t/0d0141|12L23< 2,%-L2-423,,ln{ah~d 2,-- 2,.\-423,,o{hnk423,.(q{tzw2.< 2,-.<423,-8p{ntq 2, </,.423,.ahd2. 2,..2/t423,/`'{z~}2. 2,00/t423,/ahd2/ 2,?8/<$423,1Tz}423,/z} 2,/0d423,0ahd 20 2,@00423,1 z} 214 2,01420d21| 2,21|423,1hnk 21 2,11423,28ntq 22L 2,22L423,3\tzw423,1hahd 2,2l2423,3(z}23< 2,23<222.L28This For loop calculates the array of experiment times. @21D4l48i 5 x@/ 23@442 K3ip0P3456057 667t7989(:9:,:433353pvs4333,X4ipl43335X2v|y3603535 3345 336P543336037 36 335$6043335l1| 337@643336 36 336637t 3357 43336ipl 338D7t43337 37 3377433380 ipl 3943337 ipl43338  38 338x843339Wi p l 39( 3389(43339|Vp vs 3: 337939 33:94333:?| 3:, 339:,4333:>  3: 33:L: 339H:43339@v |y 37 43;3;43/D;i3;;<$ 3;L?8;<$ 3;L@|(T!3AdA3=X,3;/-@D"/ &,/P9/p!/(gN#<1/5Bg"v~$o05Bp n0-|@\ >43D=M  3The data are assembled for storing as spreadsheet file. In this 2 D array, the first row is the time points and the second row the counts. 3 A<3h0 p&3443D@dE8  -A|dH[43Db` 3(A043" =.V_ZB< 3"(=XA0,3\Ad 3 @^A03AdA5DhBp 03Ad,3#AUA03!kkbEbb3PNNoo3lThe counts in each channel from the decaying nuclei and the background are summed to give the total counts. 43DgH-D|M4G3D@##(3! aG|[$=5GBp \p03@lIl>I3%?~d~?3=X^ZZ\3EThe decay curve and the time data are bundled together for plotting. MB=!Ln01MD"/ &87/P9/p!/(gN#<1/ND"/ &-/P9/p!/(gN#<1/-|\ A3+663The baseline is calculated. This is done by taking a random number from a random number generator which generates numbers uniformly distributed from 0-1. This calculation is repeated n times, where n is the product of the average counts in a channel desired times the number of channels, m. The array of numbers, when combined into a histogram of m bins uniformly spaced will generate a simulated baseline which has random noise which follows the Poisson distribution law. 3,3) ND"/ &8C/P9/p!/(gN#<1/p3?8MMdTD"/ &6/P9/p!/(gN#<1/-|$N E3?3773OOtUFUt3HBDDTT3>-3   UI d UU l  I F  Fd3To get the total number of counts we have to calculate the product of k and dt. This is divided into the number of counts in the first channel. [D"/ &h:/P9/p!/(gN#<1/3)p3$ s33(6633 8 3 <~}~43/DYeSi3Z3Z 3ZZ ]p 3YZ]]p 3Y@^|3pThe total number of counts in the background is the background counts per channel times the number of channels. 43DZcD  3Z]]B*905B*9o0-|GH[D"/ &(//P9/p!/(gN#<1/D"/ &D-/P9/p!/(gN#<1/D"/ &B/P9/p!/(gN#<1/ 3Y^^H]p=j!jj430YYuzi3]p43D_h_  430Y^kupi430YYkupil3YL;L3,*&d x pl0hL3p x*;LYL 3,dl3A]pL3^ ZZ K  p  ^^3@  [[wC@Cw [d  r   [[  r [   o oBB@p,3$;0Z \3Z@^H?8@%+()p!$ <3ZYzZZ3The calculation of the decay time for an individual nucleus is repeated N times. From a large number of decays a histogram of decay times may be estimated. N is the estimated total number of counts expected in the experiment. H33The time for a nucleus to decay is calculated. This is obtained by converting the uniform random number generator to an exponentially decaying random number generator by means of the transformation: ln(RAND). The decay constant is scaled by the calculation: y =(1/k)*ln(RAND), where k is the decay rate. 3The calculation of the time of appearance for an individual background count is repeated N times. From a large number of observed count times a histogram of background counts may be estimated. This represents the background of the nuclear decay measurement. 3D@qrr}}3#(bEc<b1c13#^[[3 L3 LH31The histogram of individual nuclear decay times is calculated. The histogram has a number of bins equal to the number of time points. The first bin is at the first time interval and the last bin at the last time interval. Note that the more flexible general histogram is used rather than the histogram.vi. ( @UUAn >>\B>>@     MS Sans Serif MS Sans Serif MS Sans Serif010RSRC LVINLBVW % 4* 4RSID0LVSRDBDPWXLIvilCPTMDSTMDFDSLIdsVICDversDLDRFPTD CPMp STRG4ICONHDTHP\TRec-pPICCLIfpXFPHPlLIbdBDHPHISTPRT FTABK/P:/P81/t`#/Ā=/l#/*/0/@*/BD-/B<0/B\+/C`-/Ch$+/K,,1/K:/V-/V)/W$;/W*/WB/X\9/X(/ Y(*/Y1/Y89/Z,./Z+/Zب9/[$p*/[p./[()/\ 4)/\l,/\T,/]D*/] /]ܐ*/^(4:/^tB/^