# H can I make a function on Ti-basic?

1. Nov 14, 2007

Hi,

Do any one know how can I make a function on Ti-basic?

What I mean by function is mathematical function IE. f(x)=x^2+3x and then take the value of f(2) and f(3) and store them on a variable.

I'm trying to program the bisection method on the calculator for my Numerical Analysis class and I need to take f(a) and f(Pn).

f(p)=0

Thanks

2. Nov 14, 2007

Apparently nobody programs on a TI calculators.

Kind of obvious why.

3. Nov 14, 2007

### ranger

You should have more patience.

Anyway, have a look at this link:
http://www.math.ou.edu/~amiller/ti85/bisect.htm

Some programming:
http://en.wikibooks.org/wiki/Programming:TI-Basic

Not sure how fast the BASIC program would be. But its problems of this nature that would make me want to use something like TI asm.

Last edited: Nov 14, 2007
4. Nov 15, 2007

:evalF(F,x,A)->FA
:evalF(F,x,C)->FC

This evalf() command is not on the ti-89, at least doesn't have the same name and it just what I need.

Thanks Ranger

5. Nov 15, 2007

### ranger

6. Nov 16, 2007

### Coin

You say that it is a TI-89?

I am quite sure that the TI-89 allows you to actually define functions. I do not remember exactly where in the interface you do this, and I cannot find my TI-89 right now. However as I remember it, in the menu where you can create programs, you can also create "functions". Functions are like programs, but they return a value. This means (1) you can call them like functions from the interpreter prompt, which is what you seem to want to do and (2) you can call them from other programs the way functions in a normal programming language would work. Look in the menus, do you see what I am referring to?

7. Nov 16, 2007

Yes, Coin there is a way to define a function actually is Define like this

:Define f(x)=Funct
: /*Function of x*/
:
EndFunct

But for some reason when i try to run the program, I get an error message telling me that I didn't define variable.

I had read the manual a couple of times, is not real good source for programming and commands.

8. Nov 16, 2007

Thanks Ranger, but the problem is that I'm suppose to make the program. I already manage to evaluate the desire function but is was not a real profesional way. It is kind of lame.

Code (Text):
ClrIO
Dialog
Request "Function: f(x)",f
Request "Initial point",a
Request "Final Point",b
Request "Tolerance",tol
EndDlog
If Ok=0:Stop
expr(a)->a:expr(f)->f:expr(b)->b:expr(tol)->tol
[B]a->x
f->fa[/B]
While abs(a-b)/(abs(a+b)/2)>tol
a+(b-a)*0.5->p
[B] p-x
f->fp[/B]
If fp=0 Then
Disp "p=",p
Stop
EndIf
If fa*fp>0 Then
p->a
fp->a
Else
p->b
EndIf
EndWhile
Disp "f(p)=0, p=",p
EndPrgm
The bold is how do manage to evaluate my function