Is it possible to create one?

It should do this:
2x^2+5x^2+2x*4x+1 ---> 15x^2+1

(sin(x)+tan(x))/2*x ---->

x(tan(x)+sin(x)
---------------------
2


I know that there is a calculator that does it, but what about the ones that don't like my ti-83?

Just tell me if you think it is possible, I want to try to write it myself
Yes, it is.
You'd have to think of a way to parse such an input string to something you can work with to find such patterns and optimize them.
Sorunome wrote:
Yes, it is.
You'd have to think of a way to parse such an input string to something you can work with to find such patterns and optimize them.



Can you be a bit more clear? Im not really that experienced in programming.
What does parse mean?
Well, the thing you are trying to accomplish is rather more complex, sorry.
And to parse is like taking a string and converting it to data that is readable to your program. Like the webbrowser, for example, parses HTML and then displays it to the screen.
Take a look at this explanation Tari posted to a very similar question; it may help inform your further, more specific questions.
Sorunome wrote:
Well, the thing you are trying to accomplish is rather more complex, sorry.
And to parse is like taking a string and converting it to data that is readable to your program. Like the webbrowser, for example, parses HTML and then displays it to the screen.


KermMartian wrote:
Take a look at this explanation Tari posted to a very similar question; it may help inform your further, more specific questions.


I think I can work something out of Tari's tree...

My problem is with variables. Like, when you have x*x I want to to display x^2. You see, I don't want the result of the expression, I just want to simplify it. I need a letter that is read as such, like X in Y1,Y2, etc...

EDIT: I figured that i can use the number i for sums and differences, but not for multiplication Sad
AliceIsDead:
I've actually written a program that takes every word i.e. characters until a space and treats it as a variable unless its a specific token that is defined; such as +, -, *, /, ^ I'm not sure where that program went but it was pretty neat. It took lua syntax and could store variables and their corresponding value. It wasn't too complex, written in Ti-Basic.
So basically make your program recognize numbers and variables.. A cas!
Hey guys just letting you know I'm making progress! Using QuadReg, I simplified a funtion! I'm making progress, I'm so happy

I'll post the code when I finish the program Very Happy
Here's the code:


Code:
Prompt Y1
seq(x,x,1,20)->L2
seq(Y1,x,1,20)->L1

Menu("Type of expression","ax+b",1,"ax^3+bx^2+cx+d",2,"ax^2+bx+c",3,"ax^2+bx+c",3,"a*sin(bx+c)+d)",4,"ax^4+bx^3+...e",5,"a*b^x",6,"a*x^b",7)

lbl 1
LinReg(L2,L1,Y1)
stop
lbl2
CubicReg(L2,L1,Y1)
stop
lbl3
QuadReg(L2,L1,Y1
stop
lbl4
SinReg (L2,L1,Y1
lbl5
QuartReg(L2,L1,Y1
stop
lbl6
ExpReg(L2,L1,Y1
stop
lbl7
PwrReg(L2,L1,Y1
stop



It's not quite finished yet, but that's the most important part.
To use this you input Y1 between "". If the expression is expression1/expression2, run the program for each separately.
Also, before running the program, put your expression in Y1 (separating them if it's expr1/expr2) and look at the graphic so you know what kind of expression it is.

Run the program and select the right option.

Well and this is it for now, really. I think it will help me for Maths class

If you have any sugestions/corrections, feel free to tell me
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement