Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Montecarlo flowchart #150

Merged
merged 3 commits into from
Jun 3, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.graphviz',
'numpydoc',
]

Expand Down
25 changes: 25 additions & 0 deletions docs/physics/montecarlo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,28 @@ dilution factor
W = \frac{\pi J}{\sigma_{SB} T_{R}^4} = \frac{1}{4\sigma_{SB} T_{R}^4\, \Delta t\, V} J_\textrm{estimator}.

There endeth the lesson.

Algorithm Flowchart
^^^^^^^^^^^^^^^^^^^

.. graphviz::

digraph g{
a -> b -> c
c -> d [label="d_inner or \nd_outer"]
c -> e [label="d_line"]
d -> f [label="yes"]
d -> g [label="no"]
g -> a
e -> a [label="no"]
e -> h [label="yes"]
h -> a
a [label="We have a packet.",shape=box,fillcolor="white",style="filled,rounded"];
b [label="Calculate\nd_line, d_electron,\nd_inner and d_outer.",shape=box,fillcolor="white",style="filled,rounded"];
c [label="Which distance\nis smallest?", shape="diamond", fillcolor="white", style="filled"]
d [label="Are we leaving\nsimulation area?", shape="diamond", fillcolor="white", style="filled"]
e [label="Does the\npacket interact?", shape="diamond", fillcolor="white", style="filled"]
f [label="Packet is re-absorbed\nor emitted.\nThis ends the loop.", shape="box", fillcolor="white", style="filled,rounded"]
g [label="Update line\nprobabilities.", shape="box", fillcolor="white", style="filled,rounded"]
h [label="New random direction,\nupdated energy,\nmoving packet to current position,\nupdating event random number.", shape="box", fillcolor="white", style="filled,rounded"]
}