Jump to content
xisto Community
Sign in to follow this  
coolcat50

Ti-basic: Solving Equations With Variables Useful for Algebra

Recommended Posts

In this tutorial I will show you how to create a program that will solve a equation with variables for you. There are some requirements though.

 

Requirements

A Ti-83 or better calculator

Knowledge of how to use the calculator

Knowledge of where to find the functions

A little Ti-BASIC knowledge will be helpful

Well lets get into it.

Creating the Program

First, we need to create the program. Open up your program screen and create a new program. Name it something like EQSOLV.

 

Ok let's get started with the coding.

WARNING:

This program will use the following variables.

Str9

Str0

Y1

X

Ok, first open up the edit screen. It should like like this.

 

PROGRAM:EQSOLV

If it looks like then you did the creation of the program correctly.

 

Ok, we need to add a ClrHome command. Your screen should like this.

 

PROGRAM:EQSOLV:ClrHome

Great! Time to start having user input screens. We will use the Input command and the Str0 and Str9 variables here.

 

-> = STO

PROGRAM:EQSOLV:ClrHome:Input "EQUATION:",Str0:Input "ANSWER:",Str9

Now when the program is executed, it will ask for the equation. Then it will ask for the answer.

 

Ok, we now need to create one big string for the equation. We will also add some other parts to the string for evaluating.

 

The reason for this is that we will use the solve() function. The synatx for solve() is:solve(equation-(answer),X,guess)

 

PROGRAM:EQSOLV:ClrHome:Input "EQUATION:",Str0:Input "ANSWER:",Str9:Str0+"-("+Str9+")"->Str0
We now have our equation ready for solving. First, we need to turn the equation into a function.

 

We will use a function called String-to-Equ(). It is pictured with an arrow as "to". I will call it String-to-Equ though.

 

PROGRAM:EQSOLV:ClrHome:Input "EQUATION:",Str0:Input "ANSWER:",Str9:Str0+"-("+Str9+")"->Str0:String-to-Equ(Str0,Y1)

We now have our equation saved as a function for solving. Now let's solve the equation and display our answer.

 

PROGRAM:EQSOLV:ClrHome:Input "EQUATION:",Str0:Input "ANSWER:",Str9:Str0+"-("+Str9+")"->Str0:String-to-Equ(Str0,Y1):solve(Y1,X,0)->X:Output(3,1,"X=:Output(3,3,X

That will solve the equation, store it in X and display it. Keep off the end quotation marks for memory management.

You may think we are done. Well we are not quite finished. Now we need to clean up the program by erasing the variables we used. It will help memory management.

 

Our final code should look like this.

 

PROGRAM:EQSOLV:ClrHome:Input "EQUATION:",Str0:Input "ANSWER:",Str9:Str0+"-("+Str9+")"->Str0:String-to-Equ(Str0,Y1):solve(Y1,X,0)->X:Output(3,1,"X=:Output(3,3,X:DelVar X:DelVar Str0:DelVar Str9:DelVar Y1:Stop

There you go. A simple equation solver made in Ti-BASIC.

 

Instructions on Use

To use the equation solver simply enter in the equation to be solved in the equation input. Enter in the answer to the equation in the answer input.

When typing in the variable use the [X,T,(theta)] button.

 

Example of use:

EQUATION:2+XANSWER:4X=2Done

That would be the results when you enter in that equation.

 

Well thank you for reading. This is my third tutorial and I hope you like it.

Share this post


Link to post
Share on other sites

Although this works, it seems a little verbose. I do this instead (Equation must use the X variable):

Input Str1

Str1->Y1

Prompt X

Disp Y1

 

That's the necessary stuff. Everything else is extra. I personally do not like to ClrHome. I do like a menu to repeat the program with a new variable, but use the same equation. And deleting old variables is a good idea. Here is my complete code:

 

Input Str1

Str1->Y1

Lbl 1

Prompt X

Disp Y1

Pause

Menu("AGAIN?","YES",1,"NO",2)

Lbl 2

DelVar X

DelVar Str1

DelVar Y1

DelVar A

 

In case someone looks at this and doesn't know where to find these commands, here is list:

 

Input, Prompt, Disp, Pause, Menu(, Lbl, and DelVar can all be found by clicking the "PRGM" button and looking around.

Str1 can be found by clicking the "VARS" button, followed by option 7:String...

Y1 can be found by clicking the "VARS" button, using arrow button to move to second column "Y-VARS", followed by option 1:Function...

This symbol: -> is created by clicking the "STO->" button.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.