﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?application progid="SMath Studio Desktop" version="0.97.5346.24640"?>
<regions>
  <settings>
    <identity>
      <id>6e98cd67-3922-400b-b4c9-c7b0a5c668fc</id>
      <revision>9</revision>
    </identity>
    <calculation>
      <precision>6</precision>
      <exponentialThreshold>9</exponentialThreshold>
      <fractions>decimal</fractions>
    </calculation>
    <pageModel active="true" printAreas="true" simpleEqualsOnly="false" printBackgroundImages="true">
      <paper id="1" orientation="Portrait" width="850" height="1100" />
      <margins left="39" right="39" top="39" bottom="39" />
      <header alignment="Center" color="#a9a9a9">&amp;[DATE] &amp;[TIME] - &amp;[FILENAME]</header>
      <footer alignment="Center" color="#a9a9a9">&amp;[PAGENUM] / &amp;[COUNT]</footer>
      <backgrounds />
    </pageModel>
    <dependences>
      <assembly name="SMath Studio Desktop" version="0.97.5346.24640" guid="a37cba83-b69c-4c71-9992-55ff666763bd" />
      <assembly name="Text Region" version="1.10.5346.31409" guid="485d28c5-349a-48b6-93be-12a35a1c1e39" />
      <assembly name="Math Region" version="0.97.5346.24640" guid="02f1ab51-215b-466e-a74d-5d8b1cf85e8d" />
      <assembly name="Special Functions" version="1.11.5346.31403" guid="2814e667-4e12-48b1-8d51-194e480eabc5" />
      <assembly name="Plot Region" version="1.9.5346.32570" guid="c451c2b5-798b-4f08-b9ec-b90963d1ddaa" />
    </dependences>
  </settings>
  <region id="0" left="18" top="27" width="595" height="24" border="true" color="#000000" bgColor="#ffffff" fontSize="10">
    <text lang="eng">
      <p>This example is based on http://twt.mpei.ac.ru/ochkov/Lace/Lace_eng.htm</p>
    </text>
  </region>
  <region id="1" left="18" top="54" width="229" height="26" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">x</e>
        <e type="operand">y</e>
        <e type="function" args="2">f</e>
        <e type="operand">2</e>
        <e type="operand">x</e>
        <e type="operator" args="2">*</e>
        <e type="function" preserve="true" args="1">sin</e>
        <e type="operand">y</e>
        <e type="function" preserve="true" args="1">cos</e>
        <e type="operator" args="2">*</e>
        <e type="operand">0.4</e>
        <e type="operator" args="2">-</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="2" left="639" top="81" width="96" height="26" color="#000000" bgColor="#ebebeb" fontSize="10">
    <math>
      <input>
        <e type="operand">t0</e>
        <e type="operand">1</e>
        <e type="function" preserve="true" args="1">time</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="3" left="18" top="90" width="499" height="40" border="true" color="#000000" bgColor="#c0c0c0" fontSize="10">
    <text lang="eng">
      <p>Specify what region of the input variables you want to plot (generically, we'll call these variables x and y):  </p>
    </text>
  </region>
  <region id="4" left="45" top="144" width="77" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">xmin</e>
        <e type="operand">3</e>
        <e type="operator" args="1">-</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="5" left="189" top="144" width="68" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">xmax</e>
        <e type="operand">3</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="6" left="315" top="144" width="77" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">ymin</e>
        <e type="operand">3</e>
        <e type="operator" args="1">-</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="7" left="459" top="144" width="68" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">ymax</e>
        <e type="operand">3</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="8" left="18" top="180" width="463" height="24" border="true" color="#000000" bgColor="#c0c0c0" fontSize="10">
    <text lang="eng">
      <p>Specify the fineness of display resolution of the plot:</p>
    </text>
  </region>
  <region id="9" left="27" top="216" width="117" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">xstep</e>
        <e type="operand">0.0625</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="10" left="144" top="216" width="117" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">ystep</e>
        <e type="operand">0.0625</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="11" left="18" top="261" width="187" height="31" color="#000000" bgColor="#c0c0c0" fontSize="14">
    <text lang="eng">
      <p bold="true">Plot size graph</p>
    </text>
  </region>
  <region id="12" left="36" top="315" width="180" height="43" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">xsize</e>
        <e type="operand">xmax</e>
        <e type="operand">xmin</e>
        <e type="operator" args="2">-</e>
        <e type="bracket">(</e>
        <e type="operand">xstep</e>
        <e type="operator" args="2">/</e>
        <e type="operand">1</e>
        <e type="operator" args="2">+</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="13" left="261" top="324" width="94" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">xsize</e>
      </input>
      <result action="numeric">
        <e type="operand">97</e>
      </result>
    </math>
  </region>
  <region id="14" left="369" top="324" width="347" height="24" color="#000000" bgColor="#ffff80" fontSize="10">
    <text lang="eng">
      <p>The graph region is this many points wide</p>
    </text>
  </region>
  <region id="15" left="36" top="369" width="180" height="43" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">ysize</e>
        <e type="operand">ymax</e>
        <e type="operand">ymin</e>
        <e type="operator" args="2">-</e>
        <e type="bracket">(</e>
        <e type="operand">ystep</e>
        <e type="operator" args="2">/</e>
        <e type="operand">1</e>
        <e type="operator" args="2">+</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="16" left="261" top="378" width="94" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">ysize</e>
      </input>
      <result action="numeric">
        <e type="operand">97</e>
      </result>
    </math>
  </region>
  <region id="17" left="369" top="378" width="347" height="24" color="#000000" bgColor="#ffff80" fontSize="10">
    <text lang="eng">
      <p>The graph region is this many points tall</p>
    </text>
  </region>
  <region id="18" left="36" top="423" width="159" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">xsize</e>
        <e type="operand">ysize</e>
        <e type="operator" args="2">*</e>
      </input>
      <result action="numeric">
        <e type="operand">9409</e>
      </result>
    </math>
  </region>
  <region id="19" left="252" top="423" width="356" height="24" color="#000000" bgColor="#ffff80" fontSize="10">
    <text lang="eng">
      <p>Total number of points potentially graphed</p>
    </text>
  </region>
  <region id="20" left="0" top="459" width="399" height="28" color="#0000ff" bgColor="#ffffff" fontSize="12">
    <text lang="eng">
      <p>The implicit-function graphing routine:</p>
    </text>
  </region>
  <region id="21" left="0" top="486" width="761" height="408" color="#000000" bgColor="#ffff80" fontSize="10">
    <text lang="eng">
      <p>It works by computing the value of the function at and near each one of the xsize*ysize points, scanning across the specified region (of the input variables) in grid fashion.  The value ("Pvalue") at each point P is multiplied by the value ("Qvalue") at a point Q that is close to point P (distance "xstep" away from P).   - If P or Q is a root of the equation, then Pvalue or Qvalue is 0, so Pvalue * Qvalue = 0.   - If a root is between P and Q, then, typically, one of Pvalue or Qvalue is positive and the other is negative, so Pvalue * Qvalue &lt; 0.   This requires that:        (a) xstep is small enough so that no other roots are between P and Q, and       (b) there does not happen to be a root between P and Q that is also a local maximum or                minimum [example:  if f(x)=x^2 and P is at x=-1 and Q is at x=+1, then Pvalue and                Qvalue are both positive, even though there is a root x=0 between P and Q].  So if Pvalue * Qvalue &lt;= 0, the coordinates (x,y) of P are added (concatenated) to a list of points to plot.  The same procedure that has just been described for points P and Q is also done for points P and R, where R is close in the y-direction (by distance ystep) to point P.  If only P and Q were considered, then nearly horizontal parts of the graph might not have as many points, which would make them harder to see.  The names P, Q, R are used only in this text, not in the graphing routine itself.    P is (x, y)  Q is (x-xstep, y)   R is (x, y-ystep) </p>
    </text>
  </region>
  <region id="22" left="18" top="1062" width="110" height="26" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">Points</e>
        <e type="operand">0</e>
        <e type="operand">0</e>
        <e type="operand">1</e>
        <e type="operand">2</e>
        <e type="function" preserve="true" args="4">mat</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="23" left="144" top="1062" width="619" height="56" color="#000000" bgColor="#ffff80" fontSize="10">
    <text lang="eng">
      <p>Initialize the list of points to plot; otherwise, when the first point is to be added, the software won't be able to detect the dimensions of the list and will indicate an error.</p>
    </text>
  </region>
  <region id="24" left="18" top="1125" width="478" height="114" border="true" color="#000000" bgColor="#ffffff" fontSize="10">
    <math optimize="2" decimalPlaces="4">
      <input>
        <e type="operand">y</e>
        <e type="operand">ymin</e>
        <e type="operand">ymax</e>
        <e type="operand">ymin</e>
        <e type="operand">ystep</e>
        <e type="operator" args="2">+</e>
        <e type="function" preserve="true" args="3">range</e>
        <e type="operand">x</e>
        <e type="operand">xmin</e>
        <e type="operand">xmax</e>
        <e type="operand">xmin</e>
        <e type="operand">xstep</e>
        <e type="operator" args="2">+</e>
        <e type="function" preserve="true" args="3">range</e>
        <e type="operand">x</e>
        <e type="operand">xstep</e>
        <e type="operator" args="2">-</e>
        <e type="operand">y</e>
        <e type="function" args="2">f</e>
        <e type="operand">x</e>
        <e type="operand">y</e>
        <e type="function" args="2">f</e>
        <e type="operator" args="2">*</e>
        <e type="operand">0</e>
        <e type="operator" args="2">≤</e>
        <e type="bracket">(</e>
        <e type="operand">x</e>
        <e type="operand">y</e>
        <e type="function" args="2">f</e>
        <e type="operand">x</e>
        <e type="operand">y</e>
        <e type="operand">ystep</e>
        <e type="operator" args="2">-</e>
        <e type="function" args="2">f</e>
        <e type="operator" args="2">*</e>
        <e type="operand">0</e>
        <e type="operator" args="2">≤</e>
        <e type="bracket">(</e>
        <e type="operator" args="2">|</e>
        <e type="bracket">(</e>
        <e type="operand">Points</e>
        <e type="operand">Points</e>
        <e type="operand">x</e>
        <e type="operand">y</e>
        <e type="operand">1</e>
        <e type="operand">2</e>
        <e type="function" preserve="true" args="4">mat</e>
        <e type="function" preserve="true" args="2">stack</e>
        <e type="operator" args="2">:</e>
        <e type="operand" style="string">out range</e>
        <e type="function" preserve="true" args="3">if</e>
        <e type="function" preserve="true" args="3">for</e>
        <e type="function" preserve="true" args="3">for</e>
      </input>
    </math>
  </region>
  <region id="25" left="18" top="1242" width="393" height="28" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">Points</e>
        <e type="operand">Points</e>
        <e type="operand">2</e>
        <e type="operand">Points</e>
        <e type="function" preserve="true" args="1">rows</e>
        <e type="operand">1</e>
        <e type="operand">2</e>
        <e type="function" preserve="true" args="5">submatrix</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="26" left="18" top="1278" width="677" height="72" color="#000000" bgColor="#ffff80" fontSize="10">
    <text lang="eng">
      <p>Remove the first "point" that was added when the list of points was initialized. This will NOT erase the point (0, 0), if it happened to be found as a root of the equation or found to be near a root - any (0, 0) that was found will still appear in the list.</p>
    </text>
  </region>
  <region id="27" left="18" top="1359" width="156" height="26" color="#000000" bgColor="#ffffff" fontSize="10">
    <math decimalPlaces="4">
      <input>
        <e type="operand">Points</e>
        <e type="function" preserve="true" args="1">rows</e>
      </input>
      <result action="numeric">
        <e type="operand">383</e>
      </result>
    </math>
  </region>
  <region id="28" left="18" top="1395" width="639" height="24" color="#000000" bgColor="#ffff80" fontSize="10">
    <text lang="eng">
      <p>The number of points that were found to be roots, or to have roots near them.</p>
    </text>
  </region>
  <region id="29" left="36" top="1431" width="324" height="162" border="true" color="#000000" bgColor="#ffffff" fontSize="10">
    <math fractionType="fraction">
      <input>
        <e type="operand">data</e>
        <e type="operand">spec</e>
        <e type="function" args="2">pts</e>
        <e type="operand">i</e>
        <e type="operand">1</e>
        <e type="operand">data</e>
        <e type="function" preserve="true" args="1">rows</e>
        <e type="function" preserve="true" args="2">range</e>
        <e type="operand">p</e>
        <e type="operand">i</e>
        <e type="function" preserve="true" args="2">el</e>
        <e type="operand">a</e>
        <e type="operand">b</e>
        <e type="operand">c</e>
        <e type="function" args="3">spec</e>
        <e type="operator" args="2">:</e>
        <e type="function" preserve="true" args="3">for</e>
        <e type="operand">v</e>
        <e type="operand">p</e>
        <e type="operand">1</e>
        <e type="function" preserve="true" args="2">el</e>
        <e type="operator" args="2">:</e>
        <e type="operand" style="string">Unest 'p' </e>
        <e type="operand">j</e>
        <e type="operand">2</e>
        <e type="operand">p</e>
        <e type="function" preserve="true" args="1">rows</e>
        <e type="function" preserve="true" args="2">range</e>
        <e type="operand">v</e>
        <e type="operand">v</e>
        <e type="operand">p</e>
        <e type="operand">j</e>
        <e type="function" preserve="true" args="2">el</e>
        <e type="function" preserve="true" args="2">stack</e>
        <e type="operator" args="2">:</e>
        <e type="function" preserve="true" args="3">for</e>
        <e type="operand">data</e>
        <e type="operand">v</e>
        <e type="function" preserve="true" args="2">augment</e>
        <e type="operand">5</e>
        <e type="operand">1</e>
        <e type="function" preserve="true" args="7">line</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="30" left="378" top="1431" width="365" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <text lang="eng">
      <p>Remember the meaning of "implicit function"</p>
    </text>
  </region>
  <region id="31" left="450" top="1458" width="212" height="26" color="#000000" bgColor="#ffffff" fontSize="10">
    <math>
      <input>
        <e type="operand">x</e>
        <e type="operand">y</e>
        <e type="function" args="2">f</e>
        <e type="operand">2</e>
        <e type="operand">x</e>
        <e type="operator" args="2">*</e>
        <e type="function" preserve="true" args="1">sin</e>
        <e type="operand">y</e>
        <e type="function" preserve="true" args="1">cos</e>
        <e type="operator" args="2">*</e>
        <e type="operator" args="2">:</e>
        <e type="operand">0</e>
        <e type="operator" args="2">≡</e>
      </input>
    </math>
  </region>
  <region id="32" left="45" top="1485" width="104" height="98" color="#000000" bgColor="#ebebeb" fontSize="10">
    <math>
      <input>
        <e type="operand">box</e>
        <e type="operand">3</e>
        <e type="operator" args="1">-</e>
        <e type="operand">3</e>
        <e type="operator" args="1">-</e>
        <e type="operand">3</e>
        <e type="operator" args="1">-</e>
        <e type="operand">3</e>
        <e type="operand">3</e>
        <e type="operand">3</e>
        <e type="operand">3</e>
        <e type="operand">3</e>
        <e type="operator" args="1">-</e>
        <e type="operand">3</e>
        <e type="operator" args="1">-</e>
        <e type="operand">3</e>
        <e type="operator" args="1">-</e>
        <e type="operand">5</e>
        <e type="operand">2</e>
        <e type="function" preserve="true" args="12">mat</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="33" left="378" top="1494" width="381" height="56" color="#000000" bgColor="#ffffff" fontSize="10">
    <text lang="eng">
      <p>An unspecified "implicit function", plotsthe zero contour level. Define your contour level like this =&gt; for the 0.4 contour level.</p>
    </text>
  </region>
  <region id="34" left="450" top="1557" width="229" height="26" color="#000000" bgColor="#ffffff" fontSize="10">
    <math>
      <input>
        <e type="operand">x</e>
        <e type="operand">y</e>
        <e type="function" args="2">f</e>
        <e type="operand">2</e>
        <e type="operand">x</e>
        <e type="operator" args="2">*</e>
        <e type="function" preserve="true" args="1">sin</e>
        <e type="operand">y</e>
        <e type="function" preserve="true" args="1">cos</e>
        <e type="operator" args="2">*</e>
        <e type="operand">0.4</e>
        <e type="operator" args="2">-</e>
        <e type="operator" args="2">:</e>
      </input>
    </math>
  </region>
  <region id="35" left="36" top="1593" width="266" height="50" color="#000000" bgColor="#ffffff" fontSize="10">
    <math>
      <input>
        <e type="operand">a</e>
        <e type="operand">b</e>
        <e type="operand">c</e>
        <e type="function" args="3">spec</e>
        <e type="operand" style="string">.</e>
        <e type="operand">5</e>
        <e type="operand" style="string">red</e>
        <e type="operand">1</e>
        <e type="operand">3</e>
        <e type="function" preserve="true" args="5">mat</e>
        <e type="operator" args="2">:</e>
        <e type="operand">pts</e>
        <e type="operand">Points</e>
        <e type="operand">a</e>
        <e type="operand">b</e>
        <e type="operand">c</e>
        <e type="function" args="3">spec</e>
        <e type="function" args="2">pts</e>
        <e type="operator" args="2">:</e>
        <e type="operand">2</e>
        <e type="operand">1</e>
        <e type="function" preserve="true" args="4">line</e>
      </input>
    </math>
  </region>
  <region id="36" left="342" top="1593" width="94" height="24" color="#000000" bgColor="#ffffff" fontSize="10">
    <math>
      <input>
        <e type="operand" style="string">#A0A0A0#</e>
      </input>
    </math>
  </region>
  <region id="37" left="351" top="1629" width="166" height="26" color="#000000" bgColor="#ebebeb" fontSize="10">
    <math decimalPlaces="0">
      <input>
        <e type="operand">1</e>
        <e type="function" preserve="true" args="1">time</e>
        <e type="operand">t0</e>
        <e type="operator" args="2">-</e>
      </input>
      <result action="numeric">
        <e type="operand">18</e>
        <e type="operand" style="unit">sec</e>
        <e type="operator" args="2">*</e>
      </result>
    </math>
  </region>
  <region id="38" left="351" top="1656" width="420" height="200" color="#000000" bgColor="#ffffff" fontSize="10">
    <text lang="eng">
      <p>At the opening, the canvas is rectangular.Make it square exactly [calippers]. The mesh we have chosen  will produce 97 pixels values in both directions. Click in the plot, wheel mouse is in steps of "one pica [8 pixels]".At 96 pixels wheel mouse, the plot is OK wrt the Smath canvas that is in "one" pixel fineness.This is the best contour plot Smath can render.It renders in points only. Whereas the high number of points to plot, pts(data,spec) rendersthe contour plot pretty fast. It will plot in allweb colors as you wish specify or in base colors. </p>
    </text>
  </region>
  <region id="39" left="54" top="1683" width="155" height="154" color="#000000" bgColor="#ffffff" fontSize="10">
    <plot type="2d" render="lines" scale_x="2.40420730599543" scale_y="2.71146276611481" scale_z="0.801092040124318" rotate_x="0" rotate_y="0" rotate_z="0" transpose_x="-1" transpose_y="2" transpose_z="0">
      <input>
        <e type="operand">box</e>
        <e type="operand">pts</e>
        <e type="operand">2</e>
        <e type="operand">1</e>
        <e type="function" preserve="true" args="4">sys</e>
      </input>
    </plot>
  </region>
</regions>