{"id":74,"date":"2020-06-03T19:18:44","date_gmt":"2020-06-03T17:18:44","guid":{"rendered":"https:\/\/logbooks.ifosim.org\/finesse\/?p=74"},"modified":"2020-06-03T19:18:44","modified_gmt":"2020-06-03T17:18:44","slug":"parameter-references-equations","status":"publish","type":"post","link":"https:\/\/logbooks.ifosim.org\/finesse\/2020\/06\/03\/parameter-references-equations\/","title":{"rendered":"Parameter References &amp; Equations"},"content":{"rendered":"\n<p>Finesse 3 has the ability to use both references to component parameters, and equations involving those parameters, as parameters themselves. This can lead to shorter, more intuitive files. To see what I mean, consider the following Finesse 2 example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>l L0 1 0 nlaser\ns s1 0 nlaser nm\nm1 m1 1 0 0 nm ncav1\ns scav 5 ncav1 ncav2\nm1 m2 0.5 0 0 ncav2 nout\n\nset T1 m1 T\nfunc T2 = $T1 * 0.5\nput m2 T $T2\nnoplot T2\n\nad adTrans 0 nout\n\nxaxis m1 T lin 0 1 100<\/code><\/pre>\n\n\n\n<p>Here a combination of <code>set<\/code>, <code>func<\/code> &amp; <code>put<\/code> are used to make <code>m2<\/code>&#8216;s transmissivity track that of <code>m1<\/code>, with <code>noplot<\/code> hiding the intermediate function from the plot. In Finesse 3, the equivalent would be:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>l L0 P=1\ns s1 L0.p1 m1.p1 L=0\nm m1 T=1 L=0\ns scav m1.p2 m2.p1 L=5\nm m2 T=&amp;m1.T*0.5 L=0\n\nad adTrans m2.p2.o f=0\n\nxaxis m1.T lin 0 1 100\n<\/code><\/pre>\n\n\n\n<p>The whole <code>set<\/code>, <code>func<\/code>, <code>put<\/code>, <code>noplot<\/code> pattern from before has been replaced with the equivalent <code>&amp;m1.T*0.5<\/code>. Here, <code>&amp;m1.T<\/code> takes a reference to <code>m1<\/code>&#8216;s transmissivity, and will be re-evaluated whenever <code>m1.T<\/code> changes.<\/p>\n\n\n\n<p>These new features, along with many other changes, mean the Finesse 3 scripting language allow us to spend less time looking at a syntax reference (more time making interesting simulations!)<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Finesse 3 has the ability to use both references to component parameters, and equations involving those parameters, as parameters themselves. This can lead to shorter, more intuitive files. To see what I mean, consider the following Finesse 2 example: Here a combination of set, func &amp; put are used to make m2&#8216;s transmissivity track that [&hellip;]<\/p>\n","protected":false},"author":51,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ssl_alp_hide_revisions":false,"footnotes":"","ssl_alp_hide_crossreferences_to":false},"categories":[1],"tags":[],"ssl-alp-coauthor":[16],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/logbooks.ifosim.org\/finesse\/wp-json\/wp\/v2\/posts\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/logbooks.ifosim.org\/finesse\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/logbooks.ifosim.org\/finesse\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/finesse\/wp-json\/wp\/v2\/users\/51"}],"replies":[{"embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/finesse\/wp-json\/wp\/v2\/comments?post=74"}],"version-history":[{"count":1,"href":"https:\/\/logbooks.ifosim.org\/finesse\/wp-json\/wp\/v2\/posts\/74\/revisions"}],"predecessor-version":[{"id":80,"href":"https:\/\/logbooks.ifosim.org\/finesse\/wp-json\/wp\/v2\/posts\/74\/revisions\/80"}],"wp:attachment":[{"href":"https:\/\/logbooks.ifosim.org\/finesse\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/finesse\/wp-json\/wp\/v2\/categories?post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/finesse\/wp-json\/wp\/v2\/tags?post=74"},{"taxonomy":"ssl-alp-coauthor","embeddable":true,"href":"https:\/\/logbooks.ifosim.org\/finesse\/wp-json\/wp\/v2\/ssl-alp-coauthor?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}