Re: [q-lang-users] newbie question
Brought to you by:
agraef
From: Rob H. <hub...@gm...> - 2008-07-09 10:01:21
|
Hello Álvaro, > I'm taking a look at this programming language and I'm trying to > figure out some of its uses. I've read about equations in this > programming language and pattern rewriting. I find it really > interesting. > > I would like to ask a very simple question. Is it possible to use this > language for solving symbolic equations? if so, could you give me a > quick example with two linear equations? I myself first got interested in Q whilst looking to do some symbolic mathematics. I think the first thing to say is that Q is *not* a CAS (computer algebra system). There are very many out there. Amongst the free and/or open source tools, I would recommend taking a look at Axiom <http://wiki.axiom-developer.org/> and wxMaxima <http://wxmaxima.sourceforge.net/wiki/index.php/Main_Page>. Axiom is the most comprehensive and sophisticated CAS that I've encountered, but has quite a steep learning curve; its type system is extraordinary. wxMaxima, on the other hand, is a very easy tool to get started with. I'd highly recommend taking a look at both. That said, Q, too is a very useful tool with which to do some mathematics. I spent some time working with (univariate, numerical) polynomials, particularly those with rational coefficients, and that resulted in the creation of Q's rational number and polynomial libraries (now distributed with Q). Q has very useful features for working symbolically, such as the quote operator (a single ' prefix), and the string / quoted-expression conversion functions strq and valq. Q (or Pure) would both be perfectly suitable languages in which to write a CAS, but are not in themselves CASs. To represent mathematical expressions and other objects, you really need a more sophisticated set of data structures than just the parse trees. For example, it might be appropriate to store expressions modulo associativity, or to reduce an expression internally to some specific normal form. To manipulate an expression in Q, you will need to explicitly handle associativity and commutativity in all possible contexts. For example, notice that (B+C) is not a sub-expression of (A+B+C), as the latter is ((A+B)+C). If you're specifically interested in solving linear equations, then what you need is probably a matrix library. I hope you remain interested in Q. Please also take a look at Qpad (Windows only), Qcalc (not available for Windows yet) and Pure (an alpha(?) version of a replacement for Q). Regards, Rob. Rob Hubbard |