# Math Help - Ti Nspire --My first program

1. ## Ti Nspire --My first program

Ti Nspire finally has some programming capabilities with the latest operating system upgrade. The program editor is accessible through the 1.calculator option (press menu and choose 8 then 1). Nspire doesn't come with any documentation about programming.

Here is my first program. THE HORRENDOUS QUADRATIC FORMULA (wish i had this calculator during beginning of High School)

Define LibPub qdratic(a,b,c)=
Prgm
Disp "+ root =", $\frac{-b+ \sqrt{(b^2)-4*a*c}}{2*a}$
Disp "- root =", $\frac{-b- \sqrt{(b^2)-4*a*c}}{2*a}$
EndPrgm

*note you must save this in myLib folder for it to be accessible via command line

Simple Enough

if you save the file as eqn then
Calculator entry line is eqn\qdratic(a,b,c)

Well the reasoning behind this post was simple enough - I am hoping other people will share their programs ...now that this calculator is finally capable. As you can see many tedious calculations can be made easy even on the non-CAS version of the calculator with little code. The CAS version can do all of calculus but it is not allowed on any exams so not worthwhile for most students.

[hey i learned some latex commands too whoohoo]

2. I'm confused. Is this a program to mimic a graphing calculator?

3. Originally Posted by hercules
Ti Nspire finally has some programming capabilities with the latest operating system upgrade. The program editor is accessible through the 1.calculator option (press menu and choose 8 then 1). Nspire doesn't come with any documentation about programming.

Here is my first program. THE HORRENDOUS QUADRATIC FORMULA (wish i had this calculator during beginning of High School)

Define LibPub qdratic(a,b,c)=
Prgm
Disp "+ root =", $\frac{-b+ \sqrt{(b^2)-4*a*c}}{2*a}$
Disp "- root =", $\frac{-b- \sqrt{(b^2)-4*a*c}}{2*a}$
EndPrgm

*note you must save this in myLib folder for it to be accessible via command line

Simple Enough

if you save the file as eqn then
Calculator entry line is eqn\qdratic(a,b,c)

Well the reasoning behind this post was simple enough - I am hoping other people will share their programs ...now that this calculator is finally capable. As you can see many tedious calculations can be made easy even on the non-CAS version of the calculator with little code. The CAS version can do all of calculus but it is not allowed on any exams so not worthwhile for most students.

[hey i learned some latex commands too whoohoo]
Hi hercules, i'm from portugal and i've just bought the nspire, and i was very surprised when finding out that it had no quadratic formula. When i saw you post i went right away to do the thing. I've don it just has you say, but when tiping for example: blabla eqn/... (5,3,7) it says: too many componets, (it says "argumentos", wich stands for letters os things in english, do you think you can help me? regards

4. Thanks for bringing this up....I just realized that I forgot to mention something. I am going to repeat a few things.
ok...first use the program editor to create and save the following file:

Define LibPub qdratic(a,b,c)=
Prgm
Disp "+ root =",
Disp "- root =",
EndPrgm

*note you must save this in myLib folder for it to be accessible via command line

if you save the file as eqn then
Calculator entry line is eqn\qdratic(a,b,c)

****It seems \ is not one of the keys on the calculator.
So what you do is click on the key with Book drawn on it - It is right underneath the CLEAR key. Then click 5 and you will see your program listed there ...select it and a command line will appear in the calculator screen...there type in your a,b,c in the paranthesis given.

I hope this is clear. Let me know if you have any questions.

Note: after you save the file. You can always go to HOME then Documents then Open your file and work in the split screen of the program.

5. This program will give you an error message "non-real calculation" if (b^2)-4ac is negative because you will be taking the square-root of a negative number.

6. Originally Posted by hercules
This program will give you an error message "non-real calculation" if (b^2)-4ac is negative because you will be taking the square-root of a negative number.
No im sorry but the thing wit say's its rong its the amount of something that i dont remember, because ive found how to find the thing on the book before you said it here but when i tipe for exemple : (2,3,1) it says that is has to many smth that i don't recall, do you jnow wahts the problem?

7. ## Excellent!!!

Thanks for your help. The program works great in the Nspire CAS. After keying it in and correcting a few syntax errors on my part, it works great.

The only problem I encountered was checking the syntax and storing the program before I ran it; this can be accomplished by pressing, ctrl and then B after the program is entered.

Overall, this is a very useful piece of information. Thanks again.

8. No Prob. ur welcome, God Of Reason.
Just a small request:
Could you please post any programs that you create on this forum too? Thanks!

Note: There is computer software for Ti-Nspire that you can download and try out for 30 days; you can create and test programs on it too. ...Makes it easy to copy paste.

9. Hey hercules, thanks for the post.

Every time I run the program I get an "Error: Variable is not defined" message. do you know why this might be? I'm sure I copied down the code exactly. Thanks.

Max