RIFT(name=&quot;D5&quot;, len=1.0)
Q1 = KQUAD(name=&quot;Q1&quot;, len=1.0, k1=-0.9) 
Q2 = KQUAD(name=&quot;Q2&quot;, len=1.0, k1=0.3)
B1 = SBEND(name=&quot;B1&quot;, len=0.6, angle=pi/15.0)
B2 = SBEND(name=&quot;B2&quot;, len=0.6, angle=-pi/15.0)</code></pre><p>Create the lattice as a Julia vector</p><pre><code class="nohighlight hljs">LINE = [D1, Q1, D2, B1, D3, Q2, D4, B2, D5, B2, D4, Q2, D3, B1, D2, Q1, D1]</code></pre><h2 id="Particle-tracking"><a class="docs-heading-anchor" href="#Particle-tracking">P