Re: Parsing and solving algebraic equation from string

2014-07-29 Thread Michael Pigott
Mansour, Cool, that's what I thought. Did you take a look at SymJa ( https://bitbucket.org/axelclk/symja_android_library/wiki/Home )? They have an online demo set up ( http://symjaweb.appspot.com/ ) and I input your equation and got the following: Input: 2x - x^2 + 9 - 4 Output: -x^2+2*x+5 S

Re: Parsing and solving algebraic equation from string

2014-07-29 Thread Mansour Al Akeel
Michael, Indeed I am looking for a parser that can give me an array that math commons can accept. So iterating over the coefficients taking the order in account is necessary. For example: 3x + 7 - 8---> an array [3 -1] 2x - x^2 + 9 - 4 ---> [1 2 5] I was looking into Bills work, and trying

Re: Parsing and solving algebraic equation from string

2014-07-29 Thread Michael Pigott
Bill, My interpretation of Mansour's original question was that he had an equation in the form "x + 3 = 10" and he needed to have a computer tell him x = 7. SymJa appears to solve more complex problems that that, at least from the limited documentation I saw, so it may be helpful? As for t

Re: Parsing and solving algebraic equation from string

2014-07-29 Thread William Speirs
Someone else who is more experienced please jump-in here. My $0.02... 1. Would this be significantly different from SymJa? > https://bitbucket.org/axelclk/symja_android_library/wiki/Home I think we're talking about two different thing: 1) Mansour was asking for a library that can take a string

Re: Parsing and solving algebraic equation from string

2014-07-28 Thread Michael Pigott
So here are some random thoughts / questions I had: 1. Would this be significantly different from SymJa? https://bitbucket.org/axelclk/symja_android_library/wiki/Home 2. Should this be an implementation of an existing spec, like RPN or MathML, or do we need a new one? 3. Will the language be inter

Re: Parsing and solving algebraic equation from string

2014-07-28 Thread William Speirs
Seems like it's more for entering math formulas for display than for computation: http://www.intmath.com/help/send-math-email-syntax.php Like I don't think we care about a/b vs a//b (regular vs inline fractions). For this, it's the same, right? Thoughts? Bill- On Jul 28, 2014 3:03 PM, "Paul Libbr

Re: Parsing and solving algebraic equation from string

2014-07-28 Thread Paul Libbrecht
Send an announce to www-m...@w3.org? I'm happy to do that. Aim at ASCIIIMath syntax? paul On 28 juil. 2014, at 16:16, William Speirs wrote: > So here is an idea, let's not worry about where said project would live, > but focus on implementing/working on it. I'm happy to host it off my GitHub

Re: Parsing and solving algebraic equation from string

2014-07-28 Thread William Speirs
For anyone who cares (and maybe we should take this off the mailing list) I updated the now called MathBlotter to use Maven to construct the JJTree files. It *should* compile, but fails on some tests. It will run though and render equations in pretty LaTeX output. https://github.com/wspeirs/MathBlo

Re: Parsing and solving algebraic equation from string

2014-07-28 Thread William Speirs
So here is an idea, let's not worry about where said project would live, but focus on implementing/working on it. I'm happy to host it off my GitHub and give anyone access that wants to play. If people are really interested, then we should start by speccing out what the "language" will look like.

Re: Parsing and solving algebraic equation from string

2014-07-28 Thread Mansour Al Akeel
Paul, we are on the same page. We are looking for independent component separated from apache commons-math, but as a subproject. The value of keeping it under apache, is the visibility. What I have in mind is a sub project "commons-math-extensions" or c-m-optional, c-m-extra .. etc This sub project

Re: Parsing and solving algebraic equation from string

2014-07-27 Thread Paul Libbrecht
I am definitely in favor of an independent component such as "formula-parser". paul On 28 juil. 2014, at 02:34, Mansour Al Akeel wrote: > William, > I agree with you about the maturity and active community associated > with commons math. > I noticed other commons project are not as active. >

Re: Parsing and solving algebraic equation from string

2014-07-27 Thread Mansour Al Akeel
William, I agree with you about the maturity and active community associated with commons math. I noticed other commons project are not as active. Moving to a top level project, in my own opinion is valid, since the math topic covers a big area, unlike other projects in commons where they solve an

Re: Parsing and solving algebraic equation from string

2014-07-27 Thread William Speirs
I think the better idea would be to promote commons-math to it's own top-level project. It's a very impressive math library, and more active than some of the other commons projects. If made a top-level project then we could make subprojects like a parser, GUI, etc. Thoughts? Bill- On Jul 27, 201

Re: Parsing and solving algebraic equation from string

2014-07-27 Thread Mansour Al Akeel
William, Thank you a lot. Is there building instructions ? Are there any interest in creating/adding these efforts as commons-math subproject. I understand and agree with the point that a parser is outside of the scope of commons-math, but may be we can create a subproject "commons-math-sandbox"

Re: Parsing and solving algebraic equation from string

2014-07-21 Thread William Speirs
Errr... nothing at the moment, but I'll make it Apache2 :-) Bill- On Mon, Jul 21, 2014 at 8:29 AM, Paul Libbrecht wrote: > Coool. License? > > paul > > > On 21 juil. 2014, at 14:26, William Speirs wrote: > > > It's certainly incomplete, but I started working on a CAS (Computer > Algebra > > S

Re: Parsing and solving algebraic equation from string

2014-07-21 Thread Paul Libbrecht
Coool. License? paul On 21 juil. 2014, at 14:26, William Speirs wrote: > It's certainly incomplete, but I started working on a CAS (Computer Algebra > System: http://en.wikipedia.org/wiki/Computer_algebra_system) that was > "backed" by commons-math: https://github.com/wspeirs/math > > The JJT

Re: Parsing and solving algebraic equation from string

2014-07-21 Thread William Speirs
It's certainly incomplete, but I started working on a CAS (Computer Algebra System: http://en.wikipedia.org/wiki/Computer_algebra_system) that was "backed" by commons-math: https://github.com/wspeirs/math The JJT (parser file for JavaCC) file can be found here, and is fairly complete if I remember

Re: Parsing and solving algebraic equation from string

2014-07-20 Thread Ted Dunning
On Sun, Jul 20, 2014 at 9:18 PM, Mansour Al Akeel wrote: > As Luc said, it will big project to write a parser that takes any > equation as a string, and generate the matrix (2-dimensional array) to > feed it into Commons Math. > It actually isn't a big project. See http://www.antlr.org/ The s

Re: Parsing and solving algebraic equation from string

2014-07-20 Thread Paul Libbrecht
Mansour, aren't you looking for a computer-algebra system? There's a broad amount out there, but not many in Java. Also, parsers for formulæ exist in numerous fashions. You may want to look at the content-mathml-oriented processors listed in the MathML software list. It's full of old things too,

Re: Parsing and solving algebraic equation from string

2014-07-20 Thread Mansour Al Akeel
Luc and Ted, thank you for your help and support. I understand the dimensionality part. Indeed most of the equations I need to solve have one unknown. I am looking to parse the equation from String to matrix form. I was not lucky enough to find any parser that can do this out-of-the-box. As Luc sa

Re: Parsing and solving algebraic equation from string

2014-07-20 Thread Ted Dunning
On Sun, Jul 20, 2014 at 12:01 AM, Luc Maisonobe wrote: > There are no parser in Apache Commons Math to build such systems > directly from string representations. We already discussed about this > and decided not to implement parsers, as they are already big projects > by themselves and depend on

Re: Parsing and solving algebraic equation from string

2014-07-20 Thread Luc Maisonobe
Hi Mansour, Le 15/07/2014 15:02, Mansour Al Akeel a écrit : > I am new to commons-math. I need to solve simple equations in the form > "x + 3 = 10" > The closest thing I was able to find is > http://commons.apache.org/proper/commons-math/userguide/linear.html#a3.4_Solving_linear_systems If you ha

Parsing and solving algebraic equation from string

2014-07-15 Thread Mansour Al Akeel
I am new to commons-math. I need to solve simple equations in the form "x + 3 = 10" The closest thing I was able to find is http://commons.apache.org/proper/commons-math/userguide/linear.html#a3.4_Solving_linear_systems However, this needs a square matrix, and can not build the coefficients and c