{"id":1665,"date":"2016-08-30T10:32:55","date_gmt":"2016-08-30T17:32:55","guid":{"rendered":"https:\/\/live-optics-wp.pantheonsite.io\/milster\/?page_id=1665"},"modified":"2016-09-19T10:15:25","modified_gmt":"2016-09-19T17:15:25","slug":"delta-function-m-files","status":"publish","type":"page","link":"https:\/\/wp.optics.arizona.edu\/milster\/resources\/optiscan-simulation-program\/optiscan-help-desk\/index\/delta-function-m-files\/","title":{"rendered":"Delta Function M-Files"},"content":{"rendered":"<p>Delta files are used to modify the parameters of the models objects during a simulation.<\/p>\n<hr \/>\n<h3>Functional Interface:<\/h3>\n<p>The following is the function interface for delta functions:<\/p>\n<pre><span style=\"color: #0000ff;\">function<\/span> [del, curlink, simdata, errmsg] = delfunc(action, del, curlink, simdata)<\/pre>\n<hr \/>\n<h3>Delta Function Parameters:<\/h3>\n<p><span style=\"color: #0000ff;\">del<\/span> the &#8220;<em>del<\/em>&#8221; variable is the instance of the Delta object that is invoking the delta function.<\/p>\n<ul>\n<li>currently, no uses for this object within the handler are employed.<\/li>\n<\/ul>\n<p><span style=\"color: #0000ff;\">curlink<\/span> the &#8220;<em>curlink<\/em>&#8221; variable is the instance of the link that points to the object:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1422\" src=\"http:\/\/wp.optics.arizona.edu\/milster\/wp-content\/uploads\/sites\/48\/2016\/08\/project_workarea.purple_links.gif\" alt=\"project_workarea.purple_links\" width=\"248\" height=\"130\" data-id=\"1422\" \/><br \/>\nThe link labeled<span style=\"color: #0000ff;\"><strong> T:1<\/strong><\/span> is the curlink for the reflected target. The link labeled <span style=\"color: #0000ff;\"><strong>R:2<\/strong><\/span> is the next link for the reflected target. The next object after the target object is the look object.<\/p>\n<p>The <em>Delta<\/em> object has no current link since no link points to it. The link labeled <span style=\"color: #0000ff;\"><strong>O:3<\/strong><\/span> is the next link for the the Delta. The next object after the delta object is the target object.<\/p>\n<p>The <em>curlink<\/em> can be used to test what kind of link it is (<a href=\"http:\/\/wp.optics.arizona.edu\/milster\/resources\/optiscan-simulation-program\/optiscan-help-desk\/index\/link-parameters-panel\/\">more<\/a>)<\/p>\n<ul>\n<li>\u00a0<em>istransmitted<\/em>(curlink) &#8211; input are transmitted fields.<\/li>\n<li><em>isreflected<\/em>(curlink) &#8211; input are reflected fields<\/li>\n<li><em>isoperational<\/em>(curlink) &#8211; input is an operational link.<\/li>\n<li><em>issimulated<\/em>(curlink) &#8211; this link was generated by the simulator.<\/li>\n<\/ul>\n<hr \/>\n<p><span style=\"color: #0000ff;\">simdata<\/span> &#8211; simdata is a MATLAB structure, and it contains a lot of useful information:<\/p>\n<table border=\"1\" cellpadding=\"4\">\n<tbody>\n<tr>\n<td valign=\"top\">simdata.Ext<\/td>\n<td valign=\"top\">Current value for Transmitted Field X<\/td>\n<td valign=\"top\">(read\/write)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">simdata.Eyt<\/td>\n<td valign=\"top\">Current value for Transmitted Field Y<\/td>\n<td valign=\"top\">(read\/write)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">simdata.Ezt<\/td>\n<td valign=\"top\">Current value for Transmitted Field Z<\/td>\n<td valign=\"top\">(read\/write)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">simdata.Exr<\/td>\n<td valign=\"top\">Current value for Reflected Field X<\/td>\n<td valign=\"top\">(read\/write)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">simdata.Eyr<\/td>\n<td valign=\"top\">Current value for Reflected Field Y<\/td>\n<td valign=\"top\">(read\/write)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">simdata.Ezr<\/td>\n<td valign=\"top\">Current value for Reflected Field Z<\/td>\n<td valign=\"top\">(read\/write)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">simdata.sysxvec<\/td>\n<td valign=\"top\">abcissa vector for the fields.<\/td>\n<td valign=\"top\">(read\/write)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">simdata.sysyvec<\/td>\n<td valign=\"top\">ordinate vector for the fields.<\/td>\n<td valign=\"top\">(read\/write)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">simdata.LAMBDA<\/td>\n<td valign=\"top\">the value for LAMBDA<\/td>\n<td valign=\"top\">(read\/write)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">simdata.SourceType<\/td>\n<td valign=\"top\">the source&#8217;s type.<\/p>\n<ul>\n<li>1 = coherent<\/li>\n<li>2 = incoherent<\/li>\n<\/ul>\n<\/td>\n<td valign=\"top\">(read\/write)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">simdata.SourceTypePoints<\/td>\n<td valign=\"top\">number of source points if SourceType equals 2.<\/td>\n<td valign=\"top\">(read\/write)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">simdata.NextObject<\/td>\n<td valign=\"top\">the instance of the next object. (see: <a href=\"http:\/\/wp.optics.arizona.edu\/milster\/resources\/optiscan-simulation-program\/optiscan-help-desk\/index\/delta-function-m-files\/\">curlink<\/a>)this<br \/>\nis typically the most important simdata variable that a delta function uses.look at the scripttool&#8217;s predefined scripts (<a href=\"http:\/\/wp.optics.arizona.edu\/milster\/resources\/optiscan-simulation-program\/optiscan-help-desk\/index\/script-tool-properties\/\">more<\/a>)<br \/>\nwhich show how NextObject can be used.<\/td>\n<td valign=\"top\">(read\/write)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">simdata.VisitCount<\/td>\n<td valign=\"top\">Number of times that this object has been calculated.<\/td>\n<td valign=\"top\">(read only)<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">simdata.ChainIndex<\/td>\n<td valign=\"top\">When objects are added to a chain, an array of objects is created.simdata.ChainIndex<br \/>\nis the location of the Delta Object in this array.<\/td>\n<td valign=\"top\">(read only)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>err<span style=\"color: #0000ff;\">m<\/span>sg &#8211; If <strong>delfunc<\/strong> wishes to report an error, it would execute something similar to the following code fragment:<\/p>\n<pre>errmsg = 'Invalid Parameter Value for Stop Diameter';<\/pre>\n<p>This causes the simulator to stop simulating.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Delta files are used to modify the parameters of the models objects during a simulation. Functional Interface: The following is the function interface for delta functions: function [del, curlink, simdata, errmsg] = delfunc(action, del, curlink, simdata) Delta Function Parameters: del the &#8220;del&#8221; variable is the instance of the Delta object that is invoking the delta function. currently, no uses for<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":894,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1665","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/pages\/1665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/comments?post=1665"}],"version-history":[{"count":4,"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/pages\/1665\/revisions"}],"predecessor-version":[{"id":1913,"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/pages\/1665\/revisions\/1913"}],"up":[{"embeddable":true,"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/pages\/894"}],"wp:attachment":[{"href":"https:\/\/wp.optics.arizona.edu\/milster\/wp-json\/wp\/v2\/media?parent=1665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}