8 Calculator Basics: 8.1 Equation Solving

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

8 Calculator Basics

Over the years, engineers have changed their problem solving tools from
slide rules to modern scientific calculators. There are a number of excellent
calculators available, but I am going to restrict my discussion to the TI-89.
Both of these calculators have symbolic and numerical equation solving
functions. This chapter is not intended to be a sales pitch for either calculator
and I realize that many mathematics departments restrict their use, but there
are few problems that you will encounter in undergraduate engineering
classes that can not be solved using either of these two calculators. In this
chapter we will concentrate on four basic functions of the calculator that
are extremely useful. It is assumed that you know how to perform basic
operations on your calculator.

8.1 Equation Solving


Solving equations or systems of equations can be done numerically or
symbolically. The TI 89 has functions to do both. As the number of
equations increases, the time to obtain a solution increases dramatically.

8.1.1 Algebraic Equation Solving


The Solve function requires that an equation be entered on the command
line. It has some ability to deal with constraints i.e. solve for x with x
constrained to be greater than one. To get the Solve function simply press
F2 and then either the ENTER or 1 key. The following appears on the
command line.
solve(
Enter the equation to be solved and a closing ) and press the ENTER key.
Depending upon the complexity of the equation an answer will appear after

61
8. Calculator Basics

a short delay. A simple example is given below.

Example 8.1. Solve the following equation for x

2x2 + 5x + 1 = 0

Press F2, Enter and enter the equation in the form

solve(2 ∗ x2 + 5 ∗ x + 1 = 0, x)

The calculator returns


√ √
17 + 5 17 + 5
x=− or x =
4 4

If you enter a decimal point with any of the numbers in the equation,
the computer will produce the answer in decimal form. The solver will also
solve the problem in symbolic form if the equation is entered with symbolic
coefficients.

Example 8.2. Solve the following equation for x

ax2 + bx + c = 0

Press F2, Enter and enter the equation in the form

solve(a ∗ x2 + b ∗ x + c = 0, x)

The calculator returns


√ √
b2 − 4 a c + b b2 − 4 a c − b
x=− or x =
2a 2a

The x-axis value at the point of intersection of two lines provides a more
complex example.

62
Equation Solving

Example 8.3. Data has been collected on two different processes that
share a common x-axis range and the two different data sets intersect
at some point. One of the data sets is adequately described by the
equation
y = ax+b
and the other by
y = c0 + c1 x + c2 x2
The coefficients are
a = 2.0 b = 0.5
c0 = 15 c1 = 0.1 c2 = −0.05

20

15
y

10

0 2 4 6 8 10
x

To find the point of intersection, enter the following in your calculator

1. Press F2 and then 1

2. Enter 2 × x + 0.5 = 15 + 0.1 × x − 0.05 × x2 , x

3. Press )

4. Press the ENTER key

Since there is an x2 term, two answers will be produced.

x = −44.51 x = 6.51

Select the positive answer.

Example 8.3 provides an excellent place to use constraints in the solve


function to limit the results to the range of interest. From the plot, it is
obvious that we would like an answer in the positive x-range. To add a

63
8. Calculator Basics

constraint, all that needs to be done is add a | x > 0 to the line after the
closing parenthesis (the > is obtained by pushing 2nd and then the decimal
point key).
solve(2 × x + 0.5 = 15 + 0.1 × x − 0.05 × x2 , x)|x > 0
Pressing the ENTER key now produces only one answer, x = 6.51.
The same example could have been done using symbols in place of the
numeric coefficients. This might be useful if the process needed to be done
many times with different numeric values for the coefficients. After we
discuss integration, we will see how these two functions can be combined
to solve some difficult problems.

8.2 Derivatives
One of the first topics covered in calculus is derivatives. You learn the steps
necessary to take the derivative of a function and get plenty of practice.
Fortunately, there is an easier way. Symbolic processing of equations is
available on the TI-89 calculator. The system as implemented will take the
derivative of most equations that you will encounter during your undergrad-
uate career. To take the derivative of an equation first press F3 1 and then
enter the equation. After the equation, add a comma and the differential
variable followed by a right parenthesis. Pressing ENTER will display the
derivative of the equation on the screen.
1. F3 1

2. d( f(x) ,x )
3. ENTER

Let us look at several examples of common problems found in Calculus


books

Example 8.4. Use the TI-89 to evaluate the following

• ax3 =⇒ 3 · a · x2

• 7x4 − 2x3 + 8x + 5 =⇒ 28 · x3 − 6 · x2 + 8

=⇒ 2 · (x −8(x·2x−4+3· x+1)
· x2 −4 · x+8)
4 3
2x3 +4
• x2 −4x+1 2

64
Integration

As you can see, the calculator will take the derivatives of a number of
different types of functions. Numerical differentiation is more difficult
than numerical integration since it relies on a data set.

8.3 Integration
One of the problems that many mathematics departments have with these
types of calculators is the ability to integrate equations both numerically
and symbolically. Some mathematics departments will allow the use of a
TI-83 calculator but not the TI-89 calculator because the TI-83 is limited
to numeric integration.

Symbolic Integration
The integration function is just as easy to use as the solve function. Getting
the integration function on the command line is the first step. This can be
accomplished by pressing F3 and then 2 or by pressing 2nd and then the
7 key. In either case, a small integral sign and a left parenthesis appears
on the command line.Next type in the equation to be integrated and then a
comma followed by the integration variable.
!
(2 x, x)

Pressing the ENTER key produces x2 . This was a simple example of an


equation that was easy to integrate. A more complex example is shown
below. !
1+x
( , x) = −2(ln(|x − 1|) + x)
1−x
This equation is entered as (the extra right parenthesis at the end just closes
the left parenthesis provided by the function)
F3 2
"#$% (1 + x)/1 − x), x)
Command

With limits from x0 to x f


! xf
1+x
dx = 2(ln(|x0 − 1|) + x0 ) − 2(ln(|x f − 1|) − x f ) (8.1)
x0 1−x
Enter the equation as
F3 2
"#$% (1 + x)/(1 − x), x, x0, x f )
Command

65
8. Calculator Basics

and the result will be

2(ln(|x0 − 1) + x0) − 2(ln(|x f − 1|) − x f )

which, except for the subscripts, is identical to the result given in Equation
8.1.

8.3.1 Numerical Integration


There are equations that do not lend themselves to symbolic or closed form
solutions. In this case, numerical methods can be used to evaluate the
integral over a specific range. Numerical methods are also used to solve
equations that have closed-form solutions because of the complexity of the
result makes it difficult to use.
Returning to Equation 8.1, this equation can be integrated between the
limits of zero and fractionally less than one. Using one as the upper limit, a
divide by zero error will occur. When using numerical limits the calculator
function is nint. It is obtained by pressing F3 (ALPHA) B to yield F3 B. This
results in nint( on the command line. If we want to integrate the equation
between zero and 0.7 the sequence is

F3 (ALPHA) B (1 + x)/(1 − x), x, 0, 0.7) = 1.707


" #$ %
Command

The main difference is the initial command to get nint( and replacing
the symbolic limits with numeric limits. When you integrate an equation,
you obtain the area under the curve between the limits (Figure 8.1.

8.3.2 Interlude – Creating Functions


There will be times that you will use the same equation over and over.
The example (8.5) in the next section is one of them. In this case a func-
tion makes it easier to enter the equation and minimizes the chance for
typographical errors. Functions are entered using the following format

F4 #$ r ALPHA %a (z) = (1 − z) / (1 + z) ENTER


1 "ALPHA f ALPHA
"#$% " #$ %
Command Command

This results in a function that looks like this on the calculator screen
1−z
fra(z) =
1+z

66
Integration and Solve

1
!!!!!!!!!!!!
Rate
8
6
4
2
Conversion
0.2 0.4 0.6 0.8

Figure 8.1: Area under the curve from the discussion.

where z is a dummy variable that holds values sent to the function. If you
enter f ra(0.5), the calculator returns 0.3333. It is good practice to give the
functions unique names. I suggest starting them with an f or g to set them
apart from named constants.

8.4 Integration and Solve


It is possible to combined the integration and solve function to solve com-
plex problems. There is an interesting example from chemical reactor
design where this comes in handy. Chemical reactors tend to be continuous
so reactants flow in and products flow out. There are two types of reactors:
continuous stirred tank reactor (CSTR) and plug flow reactor (PFR). A plug
flow reactor is just a tube and the flow is assumed to be turbulent within the
tube. A CSTR is a tank with a stirrer that is capable of keeping the tank well
mixed. The two reactors have very different governing equations. Since
most of the time the volume of the reactor is of interest to the designer, the
equations are expressed in terms of volume.
FA0 (Xout − Xin )
V CST R = (8.2)
−rA
! Xout
1
V PFR = FA0 dX (8.3)
Xin −r A

67
8. Calculator Basics

Example 8.5. We have two reactors in series that yield an overall


conversion X f = 0.7 with an entering conversion of X0 = 0.0.

What is the intermediate conversion, X1 , if the volumes of the reactors


are equal? For this example, we will set rA equal to the same func-
tion that was used in Equation 8.1, (1 − X)/(1 + X). Notice that the
equation seems to be inverted, but we need to take the inverse so it
will end up looking the same. Since the volumes are equal, we can
set equation 8.2 equal to equation 8.3 and solve for the conversion, X1 .
The equation that must be solved is
! Xf
FA0 (X1 − X0 ) 1
= FA0 dX
−rA X1 −rA
This is entered into the calculator as (the FA0 terms cancel)

1. F2 8 =⇒ nSolve(

2. (x1 − 0)/ f ra(x1) = nInt(1/ f ra(x), x, x1, 0.7), x1)

3. ENTER

4. After some time the answer, 0.421, appears

There are a couple of things to note in this example. We have used


nSolve and nInt rather than Solve and Int. The problem could have
been solved symbolically, but the result is a little messy and we are
interested in a number not an equation. In addition, the integration
variable, in this case x has to be different than the variable that we want
to find, x1. If you use x in both places, the calculator will produce an
error.

68
Building Tables

8.5 Building Tables

The TI-89 calculator has a table function that allows the entry of lists of
numbers. On the APPS screen the table function is called the Data/Matrix
Editor. Invoking the editor brings us a window that asks

Table 8.1: Data/Matrix Editor file selection window.

Data/Matrix Editor

1:Current
2:Open
3:New

If you have an active table, selecting the first option will open the table.
Saved tables can be opened with the second option and a new table can
be created using the third option. The basic table looks like that shown in
Table 8.2.

Table 8.2: Calculator table.

Data

c1 c2 c3

Using the right arrow key, you can scroll to the right to see cells c4, c5, c6
…. This table has the same form as a spreadsheet, but you cannot perform
calculations in the cells. You can, however, place calculated values in the
cells. For instance, if you want to enter the ln of a series of numbers into
the table all you have to do is select a cell, press the 2nd x, enter the number,
place a closing parenthesis and then press ENTER . The natural log of the

69
8. Calculator Basics

number that you entered will be placed in the cell. Example 8.6

Example 8.6. Find the mean, median, and standard deviation of the
list of temperatures shown below.

Time (hr) Temperature ( ◦C)


1 100
2 110
3 107
4 102
5 98

Solution: The TI-89 calculator provides a workspace called Stats/List.


Select this option from the APPS screen and enter T in response to the
Name=. A t[1]= will appear in the entry box. Enter the first number,
press the ENTER key, enter the second number, and so on until all five
numbers have been entered. Press the F4 1 which calculates the one
variable statistics. A window will appear that asks for the List. Type in
T and then press ENTER twice. A window will appear with the various
statistical measures of the data.

8.6 Regression
The Stats/List (a free download from www.ti.com) workspace provides a con-
venient place for performing regression analysis. For large data sets, Excel
or some other computer program is better suited for regression analysis,
but the calculator works well for small data sets. If you went through the
steps for Example 8.6, clear the variable t by pressing F1 8. You now have
a empty workspace. Name the first column x and the second column y. We
will start out using a linear data set and performing linear regression. Table
8.3 has a set of (x,y) data that can be used to test linear regression on the
TI-89 calculator. After naming the columns x and y, enter the data as shown
and push the F4 3 2 buttons in order. A window will appear that asks for the
X List and Y List. Enter x ENTER and y ENTER and select the y1 variable in
which to store the best fit equation. Once this is done, press ENTER twice to
return to the Stats/Listworkspace. A window that has the best fit parameters
with goodness-of-fit measure will appear. Press ENTER and then press F2
1 and then press F5. A plot will appear with the best fit line added to the

70
Regression

x y
0 0.1
0.5 0.25
1.0 0.4
1.5 0.55
2 0.7
Table 8.3: Data for linear regression

points.
There are other built-in functions that can be used to fit data. The
choices are

• LinReg (a + bx)

• LinReg (ax + b)

• MedMed (median-median line)

• QuadReg (c0 + c1 x + c2 x2 )

• CubicReg (c0 + c1 x + c2 x2 + c3 x3 )

• QuartReg (c0 + c1 x + c2 x2 + c3 x3 + c4 x4 )

• LnReg (a + b ln x)

• ExpReg (a + bx )

• PowerReg (axb )

• Logist83 (c/(1 + ae−bx ))

• Logistic (a/(1 + becx ) + b)

• SinReg (a sin bx + c + d)

• MultReg

Included in the TI-89 software is a spreadsheet like environment called


the CellSheet. It is laid out like an Excel spreadsheet. Performing regression
analysis is not quite as easy as it is in the Stats/List workspace, but CellSheet
offers other advantages.

71
8. Calculator Basics

8.7 Summary
Learning to use your calculator is important. The TI-89 calculator is a
powerful tool that can be a great help in your undergraduate career. We
have only covered a few of the capabilities of the calculator, but they are
probably the most important ones that you will need besides the standard
functions.

72

You might also like