PowderPython: Fusion Reaction Simulation

  • heretik
    6th Jul 2012 Member 3 Permalink

    Alright, i have been coding this Python simulation of the powdertoy submatomic chain-raction with this information https://powdertoy.co.uk/Discussions/Thread/View.html?Thread=14196 and i have finally got to a useful result. The 200 lines of code pretty much resume the basic atomic particles (neutrons, electrons, hydrogen, ect) and their fusion processes. With this i can do a simulation to see what kind of energy is produced. I have to say it's pretty impressive.

    The only dissimilar thing with powdertoy is temperature and pressure; i have coded it so every fusion increases pressure by 0.1; and that temperature increases by 100 every step so that we can see the next step in fusion. It gets REALLY computationally intensive; it will be instant until the 15th; then get exponentially longer.

    If you guys are interested; i can post the code and the plots that i made with python to illustrate those things; i will also tweak it further so we can get fancy CERN-like plots.

    EDIT: Pastebinning this; ayaye! Go to this link to see the whole print-out. The plots are hidden in the 8th post of the thread.
    http://pastebin.com/HrywNn3x
    Basically the most interesting part is these 3 iterations. This is where the threshold for noble gas fusion is crossed and you see a big number of fusions who multiply exponentially.

     

    1. ### - ITERATION 8
    2.  
    3. TEMP 4900.0
    4. PRES 100.8
    5. NEUTRONS 1
    6. ELECTRONS 4
    7. PHOTONS 8
    8. HYDROGEN 0
    9. NOBLE 8
    10. CO2 0
    11. OXYGEN 0
    12. ZOO SIZE 24
    13.  
    14. PRE-FUSION
    15. NEUTRONS 0
    16. ELECTRONS 3
    17. PHOTONS 8
    18. HYDROGEN 1
    19. NOBLE 8
    20. CO2 0
    21. OXYGEN 0
    22. INTERACTIONS 1
    23. ZOO SIZE 21
    24.  
    25. FINAL
    26. NEUTRONS 1
    27. ELECTRONS 4
    28. PHOTONS 9
    29. HYDROGEN 0
    30. NOBLE 9
    31. CO2 0
    32. OXYGEN 0
    33. FUSIONS 1
    34. ZOO SIZE 25
    35.  
    36.  
    37. ### - ITERATION 9
    38.  
    39. TEMP 5000.0
    40. PRES 100.9
    41. NEUTRONS 1
    42. ELECTRONS 4
    43. PHOTONS 9
    44. HYDROGEN 0
    45. NOBLE 9
    46. CO2 0
    47. OXYGEN 0
    48. ZOO SIZE 25
    49.  
    50. PRE-FUSION
    51. NEUTRONS 0
    52. ELECTRONS 3
    53. PHOTONS 9
    54. HYDROGEN 1
    55. NOBLE 9
    56. CO2 0
    57. OXYGEN 0
    58. INTERACTIONS 1
    59. ZOO SIZE 23
    60.  
    61. FINAL
    62. NEUTRONS 10
    63. ELECTRONS 13
    64. PHOTONS 19
    65. HYDROGEN 0
    66. NOBLE 1
    67. CO2 9
    68. OXYGEN 0
    69. FUSIONS 10
    70. ZOO SIZE 63
    71.  
    72.  
    73. ### - ITERATION 10
    74.  
    75. TEMP 5100.0
    76. PRES 101.9
    77. NEUTRONS 10
    78. ELECTRONS 13
    79. PHOTONS 19
    80. HYDROGEN 0
    81. NOBLE 1
    82. CO2 9
    83. OXYGEN 0
    84. ZOO SIZE 63
    85.  
    86. PRE-FUSION
    87. NEUTRONS 0
    88. ELECTRONS 8
    89. PHOTONS 19
    90. HYDROGEN 10
    91. NOBLE 1
    92. CO2 9
    93. OXYGEN 0
    94. INTERACTIONS 10
    95. ZOO SIZE 57
    96.  
    97. FINAL
    98. NEUTRONS 11
    99. ELECTRONS 19
    100. PHOTONS 30
    101. HYDROGEN 0
    102. NOBLE 10
    103. CO2 10
    104. OXYGEN 0
    105. FUSIONS 11
    106. ZOO SIZE 101

     And on the following steps the curve shoots straight up; lagging up the computer. The last, 25th iteration takes maybe 1 minute to complete.

  • mniip
    6th Jul 2012 Developer 0 Permalink
    the fuck is that?
  • Dawgie
    6th Jul 2012 Member 3 Permalink
    Who else scrolled straight to the bottom?
  • Poorsoft
    6th Jul 2012 Member 0 Permalink

    @Dawgie (View Post)

    Me, trololo. Umm, that is a lot of coding you have there..

  • boxmein
    6th Jul 2012 Former Staff 0 Permalink
    @mniip (View Post)
    It's an effing output copy/paste.
  • heretik
    6th Jul 2012 Member 0 Permalink
    This post has been removed by jacob1: Spoiler: Large images. Click show to see
  • jacob1
    6th Jul 2012 Developer 0 Permalink
    Still pretty large, but a lot better. Now you posted a huge image spam though. Maybe make it smaller? Images can take a while to load for some people. The forums should get spoiler tags (actually, my hide post is the spoiler tag)
  • heretik
    6th Jul 2012 Member 0 Permalink

    Thats done. Re-sized. Sorry; your forum code is weird; i'm not used to it..

  • jacob1
    6th Jul 2012 Developer 0 Permalink
    @heretik (View Post)
    Okay, I'll keep them hidden as a spoiler though, the file size didn't change. You can make the pictures slightly bigger if you want, so they're all the same size.
  • heretik
    6th Jul 2012 Member 0 Permalink

    Done. Here is the code for all interested http://pastebin.com/0LAe0gsN