[11.7] Saving Multiple Answers With Solve() In Program - Texas Instruments TI-89 Tip List

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

but not every equation has every variable. For example, consider the equations for Ohm's law and
electrical power:
V = I * R
P = I * V
In this case, there are four variables, but by specifying any two, it is possible to solve for the remaining
two variables. You can use the solve() function to simulate the HP48 multiple equation solving
capability, like this:
solve(v=i*r and p=i*v,{r})|v=4.2 and p=10
In this example I know v = 4.2V and p = 10 watts, and I want to find the resistance r. I can't find the
resistance directly from either equation; I need both equations to find it. In this case, r = 1.764 ohms.
It is nearly as easy to find both unknown variables at once:
solve(v=i*r and p=i*v,{r,i})|v=4.2 and p=10
which returns
r = 1.746 and i = 2.381

[11.7] Saving multiple answers with solve() in program

solve() returns multiple answers for simultaneous equations. The answers are returned as an
expression, for example
x1=1.234 and x2=5.678
This works well from the command line, but not within a program. For example,
solve({equation1 and equation2},var1,var2)→res1
doesn't work, because TI Basic interprets the solve() result as a boolean, evaluates the boolean and
saves the result; either true or false.
This works:
string(solve(...))→res1
This saves the results as a string, which can be displayed, or decomposed into individual answers by
using inString() to search for the location of "and", then using mid() to extract the answers.
Another solution, which is better in most cases, is to use the zeros() function, which is equivalent to
exp▶list(solve( expression=0,var ))
This returns all the solutions as a list, and the individual solutions can be extracted by their position in
the list.
[DOESN'T WORK!]
11 - 7

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92+

Table of Contents