What is Causing Errors in My TI-89 Physics Program?

In summary, the conversation discusses a program for plotting vertical curves for surveying that the individual is having trouble with. They share their code and ask for assistance with a specific issue they are having. A fellow programmer offers suggestions and points out some potential errors in the code. The conversation concludes with the individual thanking the other and mentioning that they will try the suggested corrections.
  • #1
Clutch Cargo
18
0
After looking for programs for advanced physics with no luck I decided to write my own.
What I have so far is a simple program to calculate relitavistic velocity:

(v1,v2)
Prgm:Local
Input "Enter velocity 1" .v1
Input "Enter velocity 2" .v2
If v1<0 Then
(v1+v2)/(1+(v1*v2))»vr
EndIf
If V1>.9999 Then
(v1+v2)/(1+(v1*v2)/_c^2)»vr
EndIf
Disp "Relativistic Velocity",vr
Pause
DelVar vr
EndPrgm

The problem I have is that no matter what I do I get errors.

First it doesn't like my Input functions, if I take those out it doesn't like my If statements, if I take those out as well it doesn't even like the math statements. Can anyone tell me what I'm doing wrong? P.S. the math functions nested in the If statements are indented but this BB doesn't show that.
 
Computer science news on Phys.org
  • #2
Code:
Input "Enter velocity 1" .v1
Input "Enter velocity 2" .v2
Firstly, on my old 83+, this would be written as
Code:
Input "Enter velocity 1", U
Input "Enter velocity 2", V
Note that I replaced the dot by a comma, and that I renamed the variables as I'm not sure it can handle names with numbers in them.
Also, what's with the (v1, v2) on the top line? I hope that's not in your actual program? Or is it something TI-89-ful?
 
  • #3
I used to be pretty handy with the TI-83+, and I can tell you for certain that programming for the TI-86 or TI-89 is totally different, the command syntax is different, the variable names are different, the memory allocation is different. Everything is different.

Don't let that discourage you, just saying you're going to need to find a specific TI-89 resource.
 
  • #4
Clutch Cargo said:
After looking for programs for advanced physics with no luck I decided to write my own.
What I have so far is a simple program to calculate relitavistic velocity:

Input "Enter velocity 1" .v1
Input "Enter velocity 2" .v2

The problem I have is that no matter what I do I get errors.

First it doesn't like my Input functions

In the sample program given in the manual, input of numerical data is done in a strange way. A string is inputted, which is then converted to numerical data. I recently used a TI-89 program that used this technique and an If statement, and the program worked fine.

Try

Request "Enter velocity 1",v1
Request "Enter velocity 2",v2
expr(v1)->v1
expr(v2)->v2
 
  • #5
yes your problem is in your syntax;
Input "Enter velocity 1" .v1
Input "Enter velocity 2" .v2
it should be;
Input "Enter velocity 1",v1
Input "Enter velocity 2",v2
 
  • #6
please help ti-89 programming

keep getting missing paenthisis error can someone help this is a program for plotting vertical curves for surveying

Prgm
ClrIO
Local b,f,l,e,s,vpc,vpt,svpc,svpt,c,i
Dialog
Title "Variables"
Request "Backslope",b
Request "Foreslope",f
Request "Length In Stations",l
Request "Elevation at VPI",e
Request "Station at VPI In feet",s
EndDlog
Define c=(f-b)/(2*l)
Define vpc=e+(b*(l/2))
Define svpc=s-((l/2)*100)
Define vpt=e+(f*(l/2))
Define svpt=s+((l/2)*100)
Dialog
Title "Stationing and Elevation"
Text "VPC Elevation="(vpc)
Text "VPC Station="(svpc)
Text "VPT Elevation="(vpt)
Text "VPT Station="(svpt)
Text "Coefficient of Curvature="(c)
EndDlog
Pause
Dialog
Request "Starting Point",sp
Request "Interval of Points on Curve",i
Request "Height 1",h
Request "Height 2",o
EndDlog
Define d=§((2/l)(§(h)+§(o))^2)/(b-f)
Define x=(b*l)/(b-f)
define z=vpc+b(sp+i)+c(sp+i)^2
define w=vpc+b(sp+i2)+c(sp+i2)^2
define v=vpc+b(sp+i3)+c(sp+i3)^2
define u=vpc+b(sp+i4)+c(sp+i4)^2
define t=vpc+b(sp+i5)+c(sp+i5)^2
define p=vpc+b(sp+i6)+c(sp+i6)^2
define r=vpc+b(sp+i7)+c(sp+i7)^2
define q=vpc+b(sp+i8)+c(sp+i8)^2
define m=vpc+b(sp+i9)+c(sp+i9)^2
define n=vpc+b(sp+i10)+c(sp+i10)^2
define max=(vpc+b(ix)+c(ix)^2)
Dialog
Text "Elevation at X="(sp+i),(z)
Text "Elevation at X="(sp+i2),(w)
Text "Elevation at X="(sp+i3),(v)
Text "Elevation at X="(sp+i4),(u)
Text "Elevation at X="(sp+i5),(t)
Text "Elevation at X="(sp+i6),(p)
Text "Elevation at X="(sp+i7),(r)
Text "Elevation at X="(sp+i8),(q)
Text "Elevation at X="(sp+i9),(m)
Text "Elevation at X="(sp+i10),(n)
Text "Elevation at X="(x),(max)
EndDlog
EndPrgm
 
  • #7
ablemerle1 said:
keep getting missing paenthisis error can someone help this is a program for plotting vertical curves for surveying

Prgm
ClrIO
Local b,f,l,e,s,vpc,vpt,svpc,svpt,c,i
Dialog
Title "Variables"
Request "Backslope",b
Request "Foreslope",f
Request "Length In Stations",l
Request "Elevation at VPI",e
Request "Station at VPI In feet",s
EndDlog
Define c=(f-b)/(2*l)
Define vpc=e+(b*(l/2))
Define svpc=s-((l/2)*100)
Define vpt=e+(f*(l/2))
Define svpt=s+((l/2)*100)
Dialog
Title "Stationing and Elevation"
Text "VPC Elevation="(vpc)
Text "VPC Station="(svpc)
Text "VPT Elevation="(vpt)
Text "VPT Station="(svpt)
Text "Coefficient of Curvature="(c)
EndDlog
Pause
Dialog
Request "Starting Point",sp
Request "Interval of Points on Curve",i
Request "Height 1",h
Request "Height 2",o
EndDlog
Define d=§((2/l)(§(h)+§(o))^2)/(b-f)
Define x=(b*l)/(b-f)
define z=vpc+b(sp+i)+c(sp+i)^2
define w=vpc+b(sp+i2)+c(sp+i2)^2
define v=vpc+b(sp+i3)+c(sp+i3)^2
define u=vpc+b(sp+i4)+c(sp+i4)^2
define t=vpc+b(sp+i5)+c(sp+i5)^2
define p=vpc+b(sp+i6)+c(sp+i6)^2
define r=vpc+b(sp+i7)+c(sp+i7)^2
define q=vpc+b(sp+i8)+c(sp+i8)^2
define m=vpc+b(sp+i9)+c(sp+i9)^2
define n=vpc+b(sp+i10)+c(sp+i10)^2
define max=(vpc+b(ix)+c(ix)^2)
Dialog
Text "Elevation at X="(sp+i),(z)
Text "Elevation at X="(sp+i2),(w)
Text "Elevation at X="(sp+i3),(v)
Text "Elevation at X="(sp+i4),(u)
Text "Elevation at X="(sp+i5),(t)
Text "Elevation at X="(sp+i6),(p)
Text "Elevation at X="(sp+i7),(r)
Text "Elevation at X="(sp+i8),(q)
Text "Elevation at X="(sp+i9),(m)
Text "Elevation at X="(sp+i10),(n)
Text "Elevation at X="(x),(max)
EndDlog
EndPrgm

Prgm
ClrIO
Local b,f,l,e,s,vpc,vpt,svpc,svpt,c,i
Dialog
Title "Variables"
Request "Backslope",b
Request "Foreslope",f
Request "Length In Stations",l
Request "Elevation at VPI",e
Request "Station at VPI In feet",s
EndDlog
Define c=(f-b)/(2*l)
Define vpc=e+(b*(l/2))
Define svpc=s-((l/2)*100)
Define vpt=e+(f*(l/2))
Define svpt=s+((l/2)*100)
Dialog
Title "Stationing and Elevation"
Text "VPC Elevation=",(vpc)
Text "VPC Station=",(svpc)
Text "VPT Elevation=",(vpt)
Text "VPT Station=",(svpt)
Text "Coefficient of Curvature=",(c)
EndDlog
Pause
Dialog
Request "Starting Point",sp
Request "Interval of Points on Curve",i
Request "Height 1",h
Request "Height 2",o
EndDlog
Define d=§((2/l)(§(h)+§(o))^2)/(b-f)
Define x=(b*l)/(b-f)
define z=vpc+b(sp+i)+c(sp+i)^2
define w=vpc+b(sp+i2)+c(sp+i2)^2
define v=vpc+b(sp+i3)+c(sp+i3)^2
define u=vpc+b(sp+i4)+c(sp+i4)^2
define t=vpc+b(sp+i5)+c(sp+i5)^2
define p=vpc+b(sp+i6)+c(sp+i6)^2
define r=vpc+b(sp+i7)+c(sp+i7)^2
define q=vpc+b(sp+i8)+c(sp+i8)^2
define m=vpc+b(sp+i9)+c(sp+i9)^2
define n=vpc+b(sp+i10)+c(sp+i10)^2
define max=(vpc+b(ix)+c(ix)^2)
Dialog
Text "Elevation at X=",(sp+i),(z)
Text "Elevation at X=",(sp+i2),(w)
Text "Elevation at X=",(sp+i3),(v)
Text "Elevation at X=",(sp+i4),(u)
Text "Elevation at X=",(sp+i5),(t)
Text "Elevation at X=",(sp+i6),(p)
Text "Elevation at X=",(sp+i7),(r)
Text "Elevation at X=",(sp+i8),(q)
Text "Elevation at X=",(sp+i9),(m)
Text "Elevation at X=",(sp+i10),(n)
Text "Elevation at X=",(x),(max)
EndDlog

i know nothing about plotting vertical curves for surveying but as far as i can see the only problems i saw were commas i put the corrected program above try it and then tell me if you still have problems
 
  • #8
get same error
 
  • #9
i will put the program into my calc and get back to you in a few days
 
  • #10
ok i put it in my calc and found a few things that were messed up
Prgm
ClrIO
Local b,f,l,e,s,vpc,vpt,svpc,svpt,c,i
Dialog
Title "Variables"
Request "Backslope",b
Request "Foreslope",f
Request "Length In Stations",l
Request "Elevation at VPI",e
Request "Station at VPI In feet",s
EndDlog
Define c=(f-b)/(2*l)
Define vpc=e+(b*(l/2))
Define svpc=s-((l/2)*100)
Define vpt=e+(f*(l/2))
Define svpt=s+((l/2)*100)
Disp "Stationing and Elevation"
Disp "VPC Elevation=",(vpc)
Disp "VPC Station=",(svpc)
Disp "VPT Elevation=",(vpt)
Disp "VPT Station=",(svpt)
Disp "Coefficient of Curvature=",(c)
Pause
Dialog
Request "Starting Point",sp
Request "Interval of Points on Curve",i
Request "Height 1",h
Request "Height 2",o
EndDlog
Define d=§((2/l)(§(h)+§(o))^2)/(b-f)
Define x=(b*l)/(b-f)
define z=vpc+b(sp+i)+c(sp+i)^2
define w=vpc+b(sp+i2)+c(sp+i2)^2
define v=vpc+b(sp+i3)+c(sp+i3)^2
define u=vpc+b(sp+i4)+c(sp+i4)^2
define t=vpc+b(sp+i5)+c(sp+i5)^2
define p=vpc+b(sp+i6)+c(sp+i6)^2
define r=vpc+b(sp+i7)+c(sp+i7)^2
define q=vpc+b(sp+i8)+c(sp+i8)^2
define m=vpc+b(sp+i9)+c(sp+i9)^2
define n=vpc+b(sp+i10)+c(sp+i10)^2
define max=(vpc+b(ix)+c(ix)^2)
Dialog
Disp "Elevation at X=",(sp+i),(z)
Disp "Elevation at X=",(sp+i2),(w)
Disp "Elevation at X=",(sp+i3),(v)
Disp "Elevation at X=",(sp+i4),(u)
Disp "Elevation at X=",(sp+i5),(t)
Disp "Elevation at X=",(sp+i6),(p)
Disp "Elevation at X=",(sp+i7),(r)
Disp "Elevation at X=",(sp+i8),(q)
Disp "Elevation at X=",(sp+i9),(m)
Disp "Elevation at X=",(sp+i10),(n)
Disp "Elevation at X=",(x),(max)
by using Disp insted of Text it stops the () problem you might want to put some ClrIo's and Pauses between the Disp's to make it simpler to use but like i said i don't konw if the equations are right or not so that part is up to you
 
  • #11
thharrimw said:
ok i put it in my calc and found a few things that were messed up
Prgm
ClrIO
Local b,f,l,e,s,vpc,vpt,svpc,svpt,c,i
Dialog
Title "Variables"
Request "Backslope",b
Request "Foreslope",f
Request "Length In Stations",l
Request "Elevation at VPI",e
Request "Station at VPI In feet",s
EndDlog
Define c=(f-b)/(2*l)
Define vpc=e+(b*(l/2))
Define svpc=s-((l/2)*100)
Define vpt=e+(f*(l/2))
Define svpt=s+((l/2)*100)
Disp "Stationing and Elevation"
Disp "VPC Elevation=",(vpc)
Disp "VPC Station=",(svpc)
Disp "VPT Elevation=",(vpt)
Disp "VPT Station=",(svpt)
Disp "Coefficient of Curvature=",(c)
Pause
Dialog
Request "Starting Point",sp
Request "Interval of Points on Curve",i
Request "Height 1",h
Request "Height 2",o
EndDlog
Define d=§((2/l)(§(h)+§(o))^2)/(b-f)
Define x=(b*l)/(b-f)
define z=vpc+b(sp+i)+c(sp+i)^2
define w=vpc+b(sp+i2)+c(sp+i2)^2
define v=vpc+b(sp+i3)+c(sp+i3)^2
define u=vpc+b(sp+i4)+c(sp+i4)^2
define t=vpc+b(sp+i5)+c(sp+i5)^2
define p=vpc+b(sp+i6)+c(sp+i6)^2
define r=vpc+b(sp+i7)+c(sp+i7)^2
define q=vpc+b(sp+i8)+c(sp+i8)^2
define m=vpc+b(sp+i9)+c(sp+i9)^2
define n=vpc+b(sp+i10)+c(sp+i10)^2
define max=(vpc+b(ix)+c(ix)^2)
Dialog
Disp "Elevation at X=",(sp+i),(z)
Disp "Elevation at X=",(sp+i2),(w)
Disp "Elevation at X=",(sp+i3),(v)
Disp "Elevation at X=",(sp+i4),(u)
Disp "Elevation at X=",(sp+i5),(t)
Disp "Elevation at X=",(sp+i6),(p)
Disp "Elevation at X=",(sp+i7),(r)
Disp "Elevation at X=",(sp+i8),(q)
Disp "Elevation at X=",(sp+i9),(m)
Disp "Elevation at X=",(sp+i10),(n)
Disp "Elevation at X=",(x),(max)
by using Disp insted of Text it stops the () problem you might want to put some ClrIo's and Pauses between the Disp's to make it simpler to use but like i said i don't konw if the equations are right or not so that part is up to you

don't put the dialog before the disp
 

What is the TI-89 calculator?

The TI-89 is a graphing calculator manufactured by Texas Instruments. It is commonly used in math, science, and engineering courses.

Why am I having trouble programming my TI-89?

There could be several reasons for difficulty in programming your TI-89. Some common issues include incorrect syntax, lack of understanding of programming concepts, or outdated software.

How can I learn to program my TI-89?

There are many resources available to help you learn how to program your TI-89. You can start by reading the user manual or watching tutorials online. There are also books and online courses specifically designed for programming on the TI-89.

What programming language does the TI-89 use?

The TI-89 uses a language called TI-BASIC, which is a variation of BASIC (Beginner's All-purpose Symbolic Instruction Code). It is a user-friendly programming language that is relatively easy to learn.

Can I use my TI-89 for more than just math and science calculations?

Yes, the TI-89 has the capability to run programs for various purposes, such as gaming, finance, and data analysis. However, it is primarily designed for math and science calculations, so it may not have all the features and capabilities of a dedicated programming language or software.

Similar threads

  • Computing and Technology
Replies
5
Views
5K
  • Computing and Technology
Replies
2
Views
10K
  • Computing and Technology
Replies
6
Views
4K
Replies
1
Views
1K
  • Computing and Technology
Replies
8
Views
9K
  • Computing and Technology
Replies
10
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
22
Views
2K
  • Computing and Technology
Replies
1
Views
16K
  • Computing and Technology
Replies
1
Views
2K
  • Computing and Technology
Replies
1
Views
8K
Back
Top