• R/O
  • SSH

提交

标签
No Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

修订版1bffebdee900c9341a13c692f061cc4c8352b92f (tree)
时间2008-12-03 10:06:44
作者iselllo
Commiteriselllo

Log Message

I updated the code and written a fortran module to import. Now I am able to calculate the shielding
factors for circles in 2D.

更改概述

差异

diff -r ec473d412e47 -r 1bffebdee900 Python-codes/calc_exposed_2D.py
--- a/Python-codes/calc_exposed_2D.py Tue Dec 02 19:06:52 2008 +0000
+++ b/Python-codes/calc_exposed_2D.py Wed Dec 03 01:06:44 2008 +0000
@@ -4,12 +4,8 @@
44 import numpy as n
55 import pylab as p
66
7-
8-# Give 2D coordinates of the centres of two monomers in 2D
7+import ray_count as rc
98
10-r_1=s.zeros(2) #coordinates of the first monomer
11-r_2=s.zeros(2)
12-r_2[1]=1. #now the two monomers are in touch
139
1410
1511 class particle_2D:
@@ -103,23 +99,55 @@
10399
104100
105101
106-x_0=0.
107-y_0=0.
108-
109-part1=particle_2D(x_0,y_0)
110-print "part1 position is, ", part1.position()
111102
112103
113104
114-x_1=1.
105+#Coordinates of the centre of the monomer I want to study
106+
107+x_0=0.
108+y_0=0.
109+
110+r1=1. #sphere radius
111+
112+
113+
114+part0=particle_2D(x_0,y_0)
115+print "part0 position is, ", part0.position()
116+
117+
118+#Coordinates of the centres of neighboring spheres
119+
120+x_1=2.
115121 y_1=0.
116122
117-part2=particle_2D(x_1,y_1)
118-print "part2 position is, ", part1.position()
123+
124+x_2=-2.
125+y_2=0.
119126
120127
121-R=3. #radius of the circle
122-N=20 #number of pts along the circle
128+x_3=0.
129+y_3=2.
130+
131+
132+x_4=2.
133+y_4=0.
134+
135+
136+R=3.5 #radius of the circle
137+N=100 #number of pts along the circle (which is also the number or rays!!!)
138+
139+N_on_ray=50 # number of pts on each ray
140+
141+#arrays with the x and y coordinates of the centres of the neighboring spheres
142+
143+# x_arr=s.array([x_1,x_2,x_3,x_4])
144+# y_arr=s.array([y_1,y_2,y_3,y_4])
145+
146+
147+x_arr=s.array([x_1,x_2,x_3])
148+y_arr=s.array([y_1,y_2,y_3])
149+
150+
123151
124152 my_circle=circle_2D(x_0,y_0,R,N)
125153
@@ -127,13 +155,20 @@
127155
128156 print "the points on circle are, ", points
129157
130-N_on_ray=20
158+
159+
131160
132161 my_rays=ray_trace(x_0, y_0, R, N, N_on_ray, points)
133162
134163 ray_arr=my_rays.rays()
135164
136165
166+
167+my_ratio=rc.ray_count(ray_arr, x_arr, y_arr, r1)
168+
169+print "the shielding factor is, ", my_ratio
170+
171+
137172 #See that I am really covering a circle
138173
139174 fig = p.figure()