<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="None">
  <name>Formula Node Exercise VI</name>
  <metadata>
  <md:version>**new**</md:version>
  <md:created>2004/06/28 12:26:13.196 GMT-5</md:created>
  <md:revised>2004/06/28 12:27:42.173 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="NationalInstruments">
      <md:firstname>National</md:firstname>
      
      <md:surname>Instruments</md:surname>
      <md:email>certification@ni.com</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="mshiralkar05">
      <md:firstname>Malan</md:firstname>
      
      <md:surname>Shiralkar</md:surname>
      <md:email>mshiralkar05@hotmail.com</md:email>
    </md:maintainer>
    <md:maintainer id="harika">
      <md:firstname>Harika</md:firstname>
      
      <md:surname>Basana</md:surname>
      <md:email>ilsai@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="lizzardg">
      <md:firstname>Elizabeth</md:firstname>
      
      <md:surname>Gregory</md:surname>
      <md:email>lizzardg@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="NationalInstruments">
      <md:firstname>National</md:firstname>
      
      <md:surname>Instruments</md:surname>
      <md:email>certification@ni.com</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>National Instruments</md:keyword>
    <md:keyword>LabVIEW</md:keyword>
    <md:keyword>exercise</md:keyword>
    <md:keyword>formula node</md:keyword>
  </md:keywordlist>

  <md:abstract>In this exercise, the objective is to use the Formula Node in a VI. Complete the following steps to build a VI that uses the Formula Node to perform a complex mathematical operation and graphs the results.</md:abstract>
</metadata>
  <!--When CXNML 0.6 comes out, this module will need to be revised to
  include para in the items indicated.-->
  <content>
    <exercise id="e1">
      <problem>
	<section id="s1">
	  <name>Front Panel</name>
	  <list id="s1l1" type="enumerated">
	    <item>
	      Open a blank VI and build the front panel shown in <cnxn target="s1l1f1"/>.
	      <figure id="s1l1f1">
		<media type="image/png" src="formulaexer.png"/>
	      </figure>
	    </item>
	  </list>
	</section>
	<section id="s2">
	  <name>Block Diagram</name>
	  <list id="s2l1" type="enumerated">
	    <item>
	      Build the block diagram shown in <cnxn target="s2l1f1"/>.
	      <figure id="s2l1f1">
		<media type="image/png" src="formulaexerbd.png"/>
	      </figure>
	      <list id="s2l1l1" type="enumerated">
		<item>
		  Place the <code>Formula Node</code>, located on the
		  <code>Functions&gt;&gt;All Functions&gt;&gt;Structures</code>
		  palette, on the block diagram.
		</item>
		<item>
		  Create the <code>x</code> input terminal by
		  right-clicking the left border and selecting
		  <code>Add Input</code> from the shortcut menu. Type
		  <code>x</code> in the box that appears.
		</item>
		<item>
		  Create the <code>y</code> and a output terminals by
		  right-clicking the right border and selecting
		  <code>Add Output</code> from the shortcut
		  menu. Enter <code>y</code> and <code>a</code>,
		  respectively, in the boxes that appear. You must
		  create output terminals for temporary variables like
		  <m:math><m:ci>a</m:ci></m:math>.
		  <note>
		    When you create an input or output terminal, you
		    must use a variable name that exactly matches the
		    one in the equation. Variable names are case
		    sensitive.
		  </note>
		</item>
		<item>
		  Type the following equations in the <code>Formula
		  Node</code>, where <code>**</code> is the
		  exponentiation operator. Refer to the <cite>LabVIEW
		  Help</cite> for more information about syntax for
		  the <code>Formula Node</code>.
		  <code type="block">
		    a = tanh(x) + cos(x);
		    y = a**3 + a;
		  </code>
		</item>
		<item>
		  Complete the block diagram as shown in <cnxn target="s2l1f1"/>.
		</item>
	      </list>
	    </item>
	    <item>
	      Save the VI as <code>Formula Node Exercise.vi</code> in
	      the <code>C:\Exercises\ LabVIEW Basics I</code>
	      directory.
	    </item>
	  </list>
	</section>
	<section id="s3">
	  <name>Run the VI</name>
	  <list id="s3l1" type="enumerated">
	    <item><!--needs para-->
	      <!--para-->
	      Display the front panel and run the VI. The graph
	      displays the plot of the equation 
	      <m:math>
		<m:apply>
		  <m:eq/>
		  <m:ci>y</m:ci>
		  <m:apply>
		    <m:plus/>
		    <m:apply>
		      <m:power/>
		      <m:apply>
			<m:ci type="fn">f</m:ci>
			<m:ci>x</m:ci>
		      </m:apply>
		      <m:cn>3</m:cn>
		    </m:apply>
		    <m:apply>
		      <m:ci type="fn">f</m:ci>
		      <m:ci>x</m:ci>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:math>, where 
	      <m:math>
		<m:apply>
		  <m:eq/>
		  <m:apply>
		    <m:ci type="fn">f</m:ci>
		    <m:ci>x</m:ci>
		  </m:apply>
		  <m:apply>
		    <m:plus/>
		    <m:apply>
		      <m:tanh/>
		      <m:ci>x</m:ci>
		    </m:apply>
		    <m:apply>
		      <m:cos/>
		      <m:ci>x</m:ci>
		    </m:apply>
		  </m:apply>
		</m:apply>
	      </m:math>.
	      <!--para-->
	      During each iteration, the VI divides the iteration
	      terminal value by <code>15.0</code>. The quotient is
	      wired to the <code>Formula Node</code>, which calculates
	      the function value. The VI plots the array as a graph.
	    </item>
	    <item>
	      Close the VI.
	    </item>
	  </list>
	</section>
      </problem>
    </exercise>
  </content> 
</document>
