• R/O
  • SSH

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

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

Commit MetaInfo

Révision119ee7fcf277214ee87261ad2a0aec6f113f32d7 (tree)
l'heure2009-07-08 01:46:51
Auteurisella
Commiterisella

Message de Log

I added a function which implements the ideas by Radicchi (consider three
clusters each time and connect the two smaller ones; I do this with a
probability distribution). The code is under development...be really careful!

Change Summary

Modification

diff -r 57193ab023b4 -r 119ee7fcf277 Python-codes/kernel_time-dependent.py
--- a/Python-codes/kernel_time-dependent.py Tue Jul 07 16:09:39 2009 +0000
+++ b/Python-codes/kernel_time-dependent.py Tue Jul 07 16:46:51 2009 +0000
@@ -5,6 +5,16 @@
55 import scipy.integrate as si
66
77
8+
9+
10+def calculate_probability(x):
11+ i = s.arange(len(x))[:,s.newaxis]
12+ j = s.arange(len(x))
13+ max_ij = s.maximum(i,j)
14+ P = x[::-1].cumsum()[::-1][max_ij]/x.sum()
15+
16+ return P
17+
818 #optimized version of the previous function
919 # I tested that this bit does the same as the previous function but it is much faster.
1020 #I modified it by removing a couple of arguments which are indeed global variables
@@ -14,7 +24,9 @@
1424
1525 #kernel=y[:,s.newaxis]*y[s.newaxis,:]/100. #this is k_ij=ij
1626
17- kernel=y[:,s.newaxis]*y[s.newaxis,:]/100. #this is k_ij=ij
27+ prob_mat=calculate_probability(y)
28+
29+ kernel=y[:,s.newaxis]*y[s.newaxis,:]/100.*prob_mat #this is k_ij=ij
1830
1931
2032 creation=s.zeros(lensum)
@@ -33,6 +45,15 @@
3345 return out
3446
3547
48+# test_arr=s.array([12.,15.,123.,24.,1,19.])
49+
50+# print "test_arr is, ", test_arr
51+
52+# matrix_prob=calculate_probability(test_arr)
53+
54+# print "matrix_prob is, ", matrix_prob
55+
56+
3657 y0=s.zeros(300)
3758
3859 x=s.arange(len(y0))+1. #grid in cluster size
@@ -71,12 +92,9 @@
7192 fig = p.figure()
7293 axes = fig.gca()
7394
74-#axes.plot(s.log10(n_comp_large),s.log10(r_gyr_ari_large), "bo")
95+
7596 axes.plot(t,concentration, "ro",label="mean number of monomers in a cluster")
76-#axes.plot(t,number_mono,label="monodisperse approx",linewidth=2.)
77-# axes.loglog(time_clu,n_clus_large, "rx",label="$N_>$")
78-# axes.loglog(time_clu[choice_time_clu],(10.**my_conc),"k",\
79-# label=r"Fit of $N_\infty $",linewidth=2.)
97+
8098 p.xlabel('Time')
8199 p.ylabel('Concentration')
82100 p.title("Evolution of number of clusters")