]> gitweb.factorcode.org Git - factor.git/commitdiff
bubble-chamber: Add small, medium, and large configurations like those on the complex...
authorEduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Tue, 16 Dec 2008 01:50:25 +0000 (19:50 -0600)
committerEduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Tue, 16 Dec 2008 01:50:25 +0000 (19:50 -0600)
extra/bubble-chamber/bubble-chamber.factor

index d88c53c99f07995f3e128b5469320dba05402317..7fe80ba1389a8474853397c7f8e1337f20ae4aaf 100644 (file)
@@ -504,6 +504,16 @@ M:: <bubble-chamber> update-frame-buffer ( BUBBLE-CHAMBER -- )
 : big-bang ( bubble-chamber -- bubble-chamber )
   dup particles>> [ collide ] each ;
 
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+: collide-one-of-each ( bubble-chamber -- bubble-chamber )
+  dup
+  particles>>
+  [ [ <muon>?   ] filter random collide ]
+  [ [ <quark>?  ] filter random collide ]
+  [ [ <hadron>? ] filter random collide ]
+  tri ;
+
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 ! Some initial configurations
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -538,6 +548,60 @@ M:: <bubble-chamber> update-frame-buffer ( BUBBLE-CHAMBER -- )
   big-bang
   drop ;
 
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+: small ( -- )
+  <bubble-chamber> new-gadget
+    { 200 200 } >>size
+    randomize-collision-theta
+    dup start-bubble-chamber-thread
+    dup "Bubble Chamber" open-window
+
+    42 [ muon   add-particle ] times
+    30 [ quark  add-particle ] times
+    21 [ hadron add-particle ] times
+     7 [ axion  add-particle ] times
+
+    collide-one-of-each
+
+  drop ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+: medium ( -- )
+  <bubble-chamber> new-gadget
+    { 400 400 } >>size
+    randomize-collision-theta
+    dup start-bubble-chamber-thread
+    dup "Bubble Chamber" open-window
+
+    100 [ muon   add-particle ] times
+     81 [ quark  add-particle ] times
+     60 [ hadron add-particle ] times
+      9 [ axion  add-particle ] times
+
+    collide-one-of-each
+
+  drop ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+: large ( -- )
+  <bubble-chamber> new-gadget
+    { 600 600 } >>size
+    randomize-collision-theta
+    dup start-bubble-chamber-thread
+    dup "Bubble Chamber" open-window
+
+    550 [ muon   add-particle ] times
+    339 [ quark  add-particle ] times
+    100 [ hadron add-particle ] times
+     11 [ axion  add-particle ] times
+
+    collide-one-of-each
+
+  drop ;
+
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 ! Experimental
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -575,3 +639,6 @@ M:: <bubble-chamber> update-frame-buffer ( BUBBLE-CHAMBER -- )
    111 [ axion  add-particle ] times
   dup particles>> [ collide randomize-collision-theta ] each
   drop ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+