• R/O
  • SSH

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision548001fc24e9a87ce5d7497b3576575a37595639 (tree)
Zeit2007-06-13 17:48:31
Autoriselllo
Commiteriselllo

Log Message

I fixed some bug in lognormal_binning.R. Now I correctly generate a set
of diameters in [D_min,D_max] which are log spaced.

Ändern Zusammenfassung

Diff

diff -r 001a27c28856 -r 548001fc24e9 R-codes/lognormal_binning.R
--- a/R-codes/lognormal_binning.R Tue Jun 12 16:48:44 2007 +0000
+++ b/R-codes/lognormal_binning.R Wed Jun 13 08:48:31 2007 +0000
@@ -2,11 +2,11 @@
22 #first I fix a grid in the volume which will then become a diamter grid
33 #the maximum diameter can be 1000nm and careful about the units we use!
44 #1000nm=1e-6m
5-D_max<-600 #in nm
5+D_max<-1200 #in nm
66 #Now I am going to create a sequence of 100 volumes
7-N_vol<-100
7+N_vol<-250
88 # Now I introduce the value of the fractal dimension D_f
9-D_f<-2.9
9+D_f<-2.25
1010 print ("the chosen fractal dimension is")
1111 print (D_f)
1212 write.table(D_f,"fractal_dimension",col.names=FALSE,row.names=FALSE)
@@ -16,7 +16,9 @@
1616 print("the diameter of the basic monomer is [nm]")
1717 print(D_0)
1818 print ("and consequently the volume is [nm^3]")
19-V_0<-pi/6*D_0^3
19+V_0<-pi/6*D_0^3 # NB: the fundamental particle does not have a fractal structure
20+# so its solid volume is simply the one of a sphere (or equivalently the effective density
21+# is equal to the physical density of the material it is made up of).
2022 print(V_0)
2123 # I now save the volume of the fundamental monomer in m
2224 write.table(D_0/1e9/2,"monomer_radius",col.names=FALSE,row.names=FALSE)
@@ -26,7 +28,8 @@
2628 print("D_min is [nm]")
2729 print (D_min)
2830
29-
31+#In the end, the lowest bin must correspond to a D_min which has to be at least as large as
32+# the one of the primary particles
3033
3134 linear_bin<-0
3235
@@ -68,21 +71,23 @@
6871 }
6972 if (linear_bin !=1)
7073 {# then I want to introduce some log-binning
74+# first I work on the diameter grid, then I will translate it into the
75+# grid on the volume of solid
7176 print ("chosen a log binning")
72-D_seq<-seq(len=(N_vol+1))
77+D_seq<-seq(0,len=(N_vol+1))
7378 # klog<-log(D_max)
7479
7580
7681 klog<-log(D_max)-log(D_min)
7782 delta_log<-klog/(length(D_seq)-1)
7883
79-# D_seq[1]<-1
80-D_seq[1]<-D_min
81-# delta_log_seq<-exp(seq(1:(length(D_seq)-1))*delta_log)
82-delta_log_seq<-exp(seq(1:(length(D_seq)-1))*delta_log)*D_min
83-D_seq[2:length(D_seq)]<-delta_log_seq # this way I created a log-spaced diameter binning
84+
85+# this way I create a log-spaced diameter binning
86+D_seq<-exp(D_seq*delta_log)*D_min
8487 d_temp<-D_seq
8588 print("OK D_seq_log")
89+# now that I have my diameter grid, I can create a corresponding grid of solid volumes
90+# which turns out to be a function of the fractal dimension
8691 V_seq<-pi/6*D_seq^3*(D_seq/D_0)^(D_f-3) #New sequence of volumes
8792 }
8893 #now I have a list of diameters corresponding to a constant shape of the vectors
@@ -106,7 +111,7 @@
106111 N_meas<-1.061e8*1e6 #I multiplied by 1e6 in order to go from cm^-3
107112 # to m^-3
108113
109-correction<-0.67 # correction factor to account for the conservation of the total volume
114+correction<-0.640 # correction factor to account for the conservation of the total volume
110115
111116 bin_pop<-bin_pop*N_meas*correction
112117
@@ -394,16 +399,20 @@
394399
395400 #Now I work out the diameter sequence
396401 # D_seq[1]<-2*D_seq[2]-D_seq[3] #or maybe I set the first value by hand
397-D_seq[1]<-10 #now I have the problem I mentioned above. Since I cannot take the
402+# D_seq[1]<-10 #now I have the problem I mentioned above. Since I cannot take the
398403 # log(0), I need to re-set the first value of the diameter sequence
399404
400405
401406
407+#probably I do not need this bit any more, now I am setting D_seq[1]=D_min
408+
402409 #carefuk with this bit!!!!!!!!
403-if (linear_bin != 1)
404-{
405-D_seq[1]<-1
406-}
410+# if (linear_bin != 1)
411+# {
412+# D_seq[1]<-1
413+# }
414+
415+
407416
408417 write.table(D_seq,"diameter_sequence",col.names=FALSE,row.names=FALSE)
409418