Omnimaga

General Discussion => Other Discussions => Math and Science => Topic started by: mrmprog on September 05, 2011, 10:43:20 pm

Title: CAS
Post by: mrmprog on September 05, 2011, 10:43:20 pm
Simply put, I want to make a cas system for my calc. The problem is, I don't really understand how to go about doing so. :( I also don't know how a computer cas system works. A while back, I did some string stuff in BASIC, but is never went further than an idea. If anyone knows of any information on how I could do this, please tell me. I really want to know how CAS systems work, even if I can't make one for calc.
Title: Re: CAS
Post by: fb39ca4 on September 05, 2011, 10:46:04 pm
It will be quite complicated. You have to have a system that interprets the string the user enters, then it has to compute the results like a human would, with out a loss of accuracy (no approximating square roots as decimals, etc.)
Which calc?
Title: Re: CAS
Post by: mrmprog on September 05, 2011, 10:53:36 pm
Ti-84+SE. I am very interested in stuff like that, but sadly, I don't know much about it. This is my way of learning. Ever since I made a "semi-smart" equation solver in basic, I have wanted to know more about algebra systems. It is interesting to think of how I could make something that could solve equations like we could.


Edit: I know that the cas system in other ti calcs is called "Derive". Would anyone happen to have more information on it?
Title: Re: CAS
Post by: DJ Omnimaga on September 05, 2011, 10:56:39 pm
I remember critor made a tool called Autocalc that, if combined with prettyprint, MathPrint OSes and Symbolic, acted like a CAS kinda. However, Autocalc was written in TI-BASIC, which made it very slow.
Title: Re: CAS
Post by: mrmprog on September 05, 2011, 11:02:21 pm
Well, If I can learn enough to make one, it will either be really slow in basic, or Axe. I will have to take a look at that, and see if I can make sense of it. Some more info I found: The cas system in other ti calcs (Ti-89T, I think) is called "Derive". Would anyone happen to have more information on it?
Title: Re: CAS
Post by: fb39ca4 on September 05, 2011, 11:05:15 pm
I know derive is propriteary software, so we don't have any source code from there to learn from. There are lots of open source CAS libraries though, so you could take a look at the code and see how stuff gets done.
Title: Re: CAS
Post by: LincolnB on September 05, 2011, 11:14:37 pm
To make a CAS, you'll probably need to first make some kind of custom input function, with menus/keyboard chortcuts, basically something that will let you type in something like 2X=6.

Then, you will need to make a function that sorts through whatever input string/system you've come up with, identifies what steps it needs to take (probably through a bunch of if statements), and takes the steps necessary, and displays the output on screen.

If it's a Complete CAS you're after, it'll be a considerable amount of work (not that it won't be worth it, I'm sure it will be), because you'll need to implement a buttload of features.

You might be interested in this thread: http://ourl.ca/12563 (this was a thread I started because I too was once interested in making a CAS but won't get around to it for quite some time, or not at all if you make one :) ) (also, the thread may look somewhat intimidating, but if you're determined it should really be no problem)

Good luck. ;)
Title: Re: CAS
Post by: AngelFish on September 06, 2011, 12:38:42 am
Perfect timing for this thread! I've spent a ton of time lately working on a project very closely related to this (one of the reasons I'm behind on my JVM for Prizm, incidentally :P), so I hope I can answer your question to some extent. Also, please use my post in buttsfredkins' thread as guidelines, not hard "You have to implement <feature>" for a CAS. I've been learning a lot of CAS theory lately and I realize just how ambiguous a lot of my statements in there really are.

First of all, computer algebra systems are difficult to write because they have to do a lot of things and there's a lot of math underlying them. If you don't have a firm mathematical background, you're quickly going to find yourself in over your head once you try doing research on how to write one. Accordingly, make yourself familiar with Wikipedia and Wolfram MathWorld (http://mathworld.wolfram.com/). They'll be your best friends when you're struggling to understand say, Grobner Bases.

Also, remember that almost everything you need to write a CAS has already been discovered and published. When in doubt, Google. Another excellent source that I refer to for all kinds of things is Algorithms for Computer Algebra by Geddes, Czapor, and Labahn. It basically takes you through many of the most useful (and difficult!) algorithms in any CAS with good descriptions, excellent mathematical underpinnings, and even pseudo-code. If you can't get your hands on it, I believe certain member(s) are willing to make it available.

Also, learn the distinction between Numerical packages and Computer Algebra packages. CA packages deal with symbolic manipulations of relations in order to get a symbolic answer (e.g. ∫2xdx → x^2+c). Numerical packages deal with evaluating and approximating relations to get a numerical answer (e.g. Lim (x^2) as x → ∞ = ∞). Both types of packages are useful for solving certain types of problems that the other type has significant trouble solving. Very few "CAS" packages fail to include numerical functions on account of this.

As for a general idea of how CASes work...

Code: [Select]
----------------------------------------------------------------------------------------------------
|                                                                                                    |
|    ------------       --------------       ---------       -------------------------               |
 -->| Text input |---->| Tokenization |---->| Parsing |---->| Decide algorithm to use |---           |
     ------------       --------------       ---------       -------------------------   |           |
                                                                                         |           |
 ----------------------------------------------------------------------------------------            |
|                                                                                                    |
|    ---------------------       -------------------       ---------------------       --------      |
 -->| Apply manipulations |---->| Evaluate function |---->| Make output legible |---->| Output |-->--
     ---------------------       -------------------       ---------------------       --------

These steps are generally combined in various ways in a real CAS, but I think it helps demonstrate the process a bit more clearly.
Title: Re: CAS
Post by: Yeong on September 07, 2011, 07:50:59 pm
It will be awesome to have limit solver in ti84 :)
Title: Re: CAS
Post by: fb39ca4 on September 07, 2011, 08:07:01 pm
Do you think it will be banned from tests if a CAS actually gets completed?
Title: Re: CAS
Post by: BalancedFury on September 07, 2011, 08:37:01 pm
What's CAS?
Title: Re: CAS
Post by: pianoman on September 07, 2011, 08:51:54 pm
Do you think it will be banned from tests if a CAS actually gets completed?
I don't think so, and even so, IMHO, it's high time that all the major tests learn to accept the CAS system. I know that in the US, only one major test doesn't allow the CAS, and it really doesn't affect the scores much at all, according to some studies about it.
ANyways, good luck with this :D
Title: Re: CAS
Post by: willrandship on September 07, 2011, 09:19:32 pm
I've taken the ACT a few times now, and a CAS would accomplish absolutely nothing on the test. You have to understand how to do the problem to be able to type it in, and typing it in is so slow, it's significantly faster to do in your head.
Title: Re: CAS
Post by: LincolnB on September 07, 2011, 10:44:26 pm
What's CAS?

A CAS is a type of program, it stands for Computer Algebra System. Basically it let's you type in stuff like 2X=6 (and obviously much more advanced stuff) and have it solve for variables and other such math functions.
Title: Re: CAS
Post by: AngelFish on September 08, 2011, 01:22:09 am
It will be awesome to have limit solver in ti84 :)

I see no particular reason why that couldn't be done, even in BASIC.
Title: Re: CAS
Post by: Yeong on September 08, 2011, 06:59:23 am
It will be awesome to have limit solver in ti84 :)

I see no particular reason why that couldn't be done, even in BASIC.
But the lim(x-> oo) stuff, it cant be done, right?
Title: Re: CAS
Post by: willrandship on September 10, 2011, 12:47:04 am
I never actually realized how slow the SciTools app was until this year, when I'm actually using it heavily. I also didn't notice that it redraws the whole screen for every single menu movement. That's just sad.
Title: Re: CAS
Post by: AngelFish on September 10, 2011, 01:23:12 am
It will be awesome to have limit solver in ti84 :)

I see no particular reason why that couldn't be done, even in BASIC.
But the lim(x-> oo) stuff, it cant be done, right?

It can.
Title: Re: CAS
Post by: AHelper on September 10, 2011, 01:29:10 am
The ti89 solves limits correctly, so it is possible.  A side note, I already am working on a cas (gCAS2) for GlassOS, which runs oncalc and on PC.  I haven't worked on it recently, but it can parse, create a node tree, simplify and approximate it, and create output, including steps in simplifying the problem... :-D
Title: Re: CAS
Post by: mrmprog on September 14, 2011, 09:26:32 pm
If I am able to do this, it would be something very simple. Perhaps more of a "symbolic manipulator" thing. Mostly I want to do this just for fun, and to learn more about the subject. I am currently researching all I can about CAS systems in general. If anyone can recommend materials for that, let me know.
Title: Re: CAS
Post by: Hayleia on September 17, 2011, 09:50:54 am
I remember critor made a tool called Autocalc that, if combined with prettyprint, MathPrint OSes and Symbolic, acted like a CAS kinda.
Also, Symbolic is released with the source code here (http://www.detachedsolutions.com/symbolic/).
Title: Re: CAS
Post by: apcalc on September 17, 2011, 11:40:40 am
I have always been interested in the theory behind Computer Algebra Systems, but most of it is way above my own current knowledge!  I wish you luck! :)