<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Malgun Gothic";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
        {font-family:"\@Malgun Gothic";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:699205388;
        mso-list-template-ids:809773932;}
@list l1
        {mso-list-id:1880043723;
        mso-list-type:hybrid;
        mso-list-template-ids:1355461586 1231355214 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks Scott!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I’ll start with the last point first: the magnet values are calculated through the geometry, essentially. In the spreadsheet, you set the heights, energy, etc (everything in yellow), and then the blue parts
 are calculated based on the geometry and the beam/field interactions. Then, in the next tab (3<sup>rd</sup> pass), the calculated values like B field must remain the same (in grey). And the calculations continue from there.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">As far as getting these into BMAD, it may require me to manually write it in the end. Or at least translate, then adjust by hand heavily. However, once I do so, I will do so using your patch method and the
 multipass feature.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I got some good feedback from Jay regarding some magnet lengths and strengths, and I’ll be iterating with that feedback. While I’m doing it, I’ll keep this information in mind as well, so I can better translate
 it. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks again!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Ryan<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Berg, J Scott <jsberg@bnl.gov><br>
<b>Date: </b>Monday, July 18, 2022 at 4:27 PM<br>
<b>To: </b>Ryan Bodenstein <ryanmb@jlab.org>, ffa_cebaf_collab@jlab.org <ffa_cebaf_collab@jlab.org><br>
<b>Subject: </b>[EXTERNAL] RE: EM Spreader Layout<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt">The ideal way you would handle this in Bmad would be using its multipass feature, which means there would be only one definition of any magnet. So how would that work? For a rectangular magnet like MAQ1S01,
 you would declare the line up through MAQS01 to be multipass, and make MAQS01 have no bend angle but a nonzero field. Then the first pass orbit comes out at some nonzero coordinate and angle, and you introduce a patch element (which is not multipass) to reset
 the phase space coordinates.  Alternatively make the angle match its field and use an edge angle, and avoid the patch for the first pass (but you won’t avoid one for later passes, and you’ll have to calculate the arc length). When you come through on the second
 pass, you go through the same multipass line (up through MAQS01), and now you have a coordinate patch for the second pass (a different one than for the first pass) that resets the phase space coordinates for the second pass. The advantage of this is you have
 only one definition for each element, and you can even get things right with the gradient, for instance (which is ignored in the spreadsheet). Tao will do the geometry fitting that the spreadsheet does. Unfortunately that doesn’t translate back into other
 codes very well.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Are the magnet gradients measured values of some sort? They look somewhat random. Is there a known gradient-to-field ratio for each magnet?</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-Scott</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt">From:</span></b><span style="font-size:11.0pt"> Ryan Bodenstein <ryanmb@jlab.org>
<br>
<b>Sent:</b> Monday, July 18, 2022 2:55 PM<br>
<b>To:</b> Berg, J Scott <jsberg@bnl.gov>; ffa_cebaf_collab@jlab.org<br>
<b>Subject:</b> Re: EM Spreader Layout</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Hi Scott,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Many thanks! Yes, the calculations take place on “the spreadsheet” of much fame. An older version is on the site, but I’ll attach the one used here. Please note: you have to allow for iterative calculations
 on the spreadsheet, or it won’t work. It’s also easy to mistype something and have everything go “wonky,” so back up frequently!</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Regarding the magnet lengths, OptiM uses path length rather than steel length. So each pass through the same magnet will have a slightly different path length. It’s all calculated in the spreadsheet.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">That said, I’ll also write everything up to better explain things. Regarding the translation to BMAD, you can export from OptiM to MAD8 or MADX, but it doesn’t quite do it right. So I’m trying to find the
 errors in that, then convert from MADX to BMAD. Right now, I’m close-ish, but the optics aren’t behaving at all like in OptiM, and I can’t quite figure out why.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks again, Scott!</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Cheers!</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Ryan</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Berg, J Scott <<a href="mailto:jsberg@bnl.gov">jsberg@bnl.gov</a>><br>
<b>Date: </b>Monday, July 18, 2022 at 2:48 PM<br>
<b>To: </b>Ryan Bodenstein <<a href="mailto:ryanmb@jlab.org">ryanmb@jlab.org</a>>,
<a href="mailto:ffa_cebaf_collab@jlab.org">ffa_cebaf_collab@jlab.org</a> <<a href="mailto:ffa_cebaf_collab@jlab.org">ffa_cebaf_collab@jlab.org</a>><br>
<b>Subject: </b>[EXTERNAL] RE: EM Spreader Layout</span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt">Hi Ryan,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Since you mentioned my name, I thought I would have a look through the files at least. My first observation there is that there are some auxiliary calculations that happened elsewhere that lead to some parameters
 in that file. A good example are lengths in MAQ1S01; each pass has a different length, and it’s not clear where those come from (analytic, fitting, field map calculation, etc.). So it would be good to have a writeup of where those numbers come from, or a procedure
 to get them, etc. That might also make it easier to know how to construct a Bmad version, where one uses a common magnet for MAQ1S01, for instance.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-Scott</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt">From:</span></b><span style="font-size:11.0pt"> FFA_CEBAF_Collab <<a href="mailto:ffa_cebaf_collab-bounces@jlab.org">ffa_cebaf_collab-bounces@jlab.org</a>>
<b>On Behalf Of </b>Ryan Bodenstein via FFA_CEBAF_Collab<br>
<b>Sent:</b> Monday, July 18, 2022 8:12 AM<br>
<b>To:</b> <a href="mailto:ffa_cebaf_collab@jlab.org">ffa_cebaf_collab@jlab.org</a><br>
<b>Subject:</b> [FFA_CEBAF_Collab] EM Spreader Layout</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">G’morning Colleagues, and Happy Monday!</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I have just uploaded some files for the NE Spreader to the file repository. They are in the Optics folder, in a new folder titles “Spreader.” This link should work as well:
<a href="https://urldefense.com/v3/__https:/jeffersonlab-my.sharepoint.com/:f:/r/personal/tristan_jlab_org/Documents/Grad*20Student*202019/Graduate*20Student*20Steering/CEBAF*20FFA*20Working*20Group/Optics/Spreader?csf=1&web=1&e=wAZhqJ__;JSUlJSUlJQ!!P4SdNyxKAPE!Fe2zlrICc2B8roIaArE9OxSJHUAjik53rwsj79En3YMzQM6Li5HCO-YGCOiRhopGsZiZRgF2ZPMSeogIcH68J1IGgQ$">
Spreader</a>. But if the link doesn’t work, please just check the repository.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">A few notes:</span><o:p></o:p></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l1 level1 lfo3"><span style="font-size:11.0pt">These are all 4 of the EM spreaders for the NE corner. I haven’t done the FFA part yet (and will likely bother Scott a bit to do that part, since I have
 to know a bit of what requirements the splitter(s) will have).</span><o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l1 level1 lfo3"><span style="font-size:11.0pt">These were performed in OptiM, and the conversion to MadX seems to have some odd hiccup (and therefore the conversion to BMAD as well). I’m working on
 that. For now, I’ve also uploaded the OptiMX installer for Windows (or Wine/Windows environment that you use). That way, you can run them as you wish, if you wish. But, I also put some .dat files in a subfolder that have some of the info you may need. If you
 need other info, let me know.</span><o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l1 level1 lfo3"><span style="font-size:11.0pt">I’m still working on some other options as well. I’d like to drop the height of the first step in the first pass if possible, but I have to check clearances
 first. I also need to make sure the setup still fits in the z direction, but I think it does. For now, let’s call this Option 1, tentatively. There will be more, but this should give us a good enough place to work from.</span><o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l1 level1 lfo3"><span style="font-size:11.0pt">The optics will end up different, depending on what comes out of our linac choice(s). But for now, this is a good approximation. I focused mainly on
 closing the dispersion and dispersion’, and just got the betas to be reasonable, but not matched to any specific value. None of the magnets are maxed out (Jay – feel free to correct me if I’m wrong there!), so there should still be some flexibility built in.</span><o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l1 level1 lfo3"><span style="font-size:11.0pt">For now (relevant to the JLab folks who know our system), don’t assume the names of the magnets are correct. I iterated magnet names in my own way, and
 some of them don’t reflect the names of a real magnet. It was for my own book keeping.</span><o:p></o:p></li></ol>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Any and all advice and feedback welcome! Have a great week!</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Cheers!</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Ryan</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Dr. Ryan Bodenstein (he/him)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Staff Scientist II – Center for Advanced Study of Accelerators (CASA)</span><o:p></o:p></p>
<p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:11.0pt"><img border="0" width="403" height="88" style="width:4.1979in;height:.9166in" id="Picture_x0020_1" src="cid:image001.jpg@01D89ABB.48454250" alt="signature_3177692690"></span><o:p></o:p></p>
<p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:11.0pt">12000 Jefferson Avenue</span><o:p></o:p></p>
<p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:11.0pt">Newport News, VA 23606</span><o:p></o:p></p>
<p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:11.0pt">United States of America</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>