<?php 


include("../../../../../site-common/common-functions.php");


set_title("August 26, 2003 : Jeremiah Oeltjen's Blog");

page_start();
?>
<div class="breadcrumb">
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="/" itemprop="url"><span itemprop="title">Home</span></a> &#x203a; 
</div>

<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="/blog/" itemprop="url"><span itemprop="title">Blog</span></a> &#x203a; 
</div>


<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="/blog/archives/2003/" itemprop="url"><span itemprop="title">2003</span></a> &#x203a; 
</div>
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="/blog/archives/2003/08/" itemprop="url"><span itemprop="title">August</span></a> &#x203a; 
</div>
<div class="this-node">
<span class="title">26</span>
</div>


</div>

<div class="blog">

<div id="menu">

<a href="https://jeremiah.oeltjen.us/blog/archives/2003/08/25/">&laquo; August 25, 2003</a> &#x2039;

<a href="https://jeremiah.oeltjen.us/blog/">Main</a>

&#x203a; <a href="https://jeremiah.oeltjen.us/blog/archives/2003/09/06/">September  6, 2003 &raquo;</a>

</div>

</div>

<div class="blog">




<h2 class="date">August 26, 2003</h2>


<div class="blogbody">
<a name="000039"></a>
<h3 class="title">Piecewise Functions on the HP48</h3>

<p>I had to graph this piecewise-defined function using a graphing utility (read graphing calculator) this evening:</p>
<pre>

       { -X-5 for -4 &lt;= X &lt; 0
f(X) = {
       { 0.2X^2 for 0 &lt;= X &lt;= 5
</pre>
<p>Of course I knew the HP48G should be able to do this, but I had never done this in the past. According to the user's manual this can be accomplished by entering a program using if-then-else statements. It worked, except I wasn't sure what do do for those parts of the graph that are not in the domain of this function as the calculator still tries to plot them. In the end I used a catchall branch to return 0 if the independent variable was not within the intervals defined in the function. This was not ideal, but I was able to work with it.</p>

<p>Plotting a function this way proved to be quite time consuming to say the least. I think I spend 15 - 20 minutes on getting it right. Once I completed my homework I went on the Internet and found <a title="Frequently Asked Questions" href="http://members.iinet.net.au/~ccroft/faqs.htm">this FAQ</a> and more specifically <a title="FAQs numbers 40 to 49" href="http://members.iinet.net.au/~ccroft/faqs_40-49.htm#47">this entry</a> regarding this very issue. Restrict the domain of an expression by dividing the expression by the domain.</p>

<pre>
-X-5 for -4 &lt;= X &lt; 0 becomes (-X-5)/(-4\&lt;=X AND X&lt;0)
</pre>
<p>To do more than one equation at the same time, put them in a list (curly braces). Don't forget to surround each expression in single quotes:</p>
<pre>
{ '(-X-5)/(-4\&lt;=X AND X&lt;0)' '(0.2*X^2)/(0&lt;X AND X\&lt;=5)' }
</pre>

<p><em>Note:</em> The <strike>"&lt;="</strike> "\&lt;=" should be replaced with the "less than or equal to" symbols from the character map or alpha-left shift-3 ("less than" signs are alpha-left shift-2).</p>



<div class="posted">
Posted by <a href="http://jeremiah.oeltjen.us/" rel="author">Jeremiah Oeltjen</a> at <a href="https://jeremiah.oeltjen.us/blog/archives/2003/08/26/piecewise-funct"><time datetime="2003-08-26T06:49:02-06:00"> 6:49 AM</time></a>


</div>

</div>


</div>
<?php
page_end();
?>
