Maybe you should figure out a format for storing polynomials, make a
class to deal with this, and then create some basic functions like
multiply or whatever you think you'll need. or find a library to do
this.
Hey, has anyone successfully created a program with Ruby that uses
maxima or any other "reasonably cheap" (or free) math programs?? If so,
can you point me to any resources??
I'm not sure what you mean by Ruby "using" maxima. Maxima is a
stand-alone program, and it has a wxWidgets GUI called "wxMaxima" and an
X-Windows GUI called XMaxima. If you just want to access maxima as a
"server" from Ruby, I'm sure there's a way to start it up using "system"
and pass it input / capture its output via pipes.
What's the application goal / use case / problem you're trying to solve?
Are you trying to use symbolic mathematics as part of a Ruby application?
···
--
M. Edward (Ed) Borasky
I've never met a happy clam. In fact, most of them were pretty steamed.
As this is a calc student, I would assume he want to write the whole thing.
M. Edward (Ed) Borasky wrote:
···
Hmmm ... there's actually a C++ library for writing computer algebra function -- it's called "ginac". Maybe all you need to do is write Ruby bindings to ginac and call the ginac functions. I'm not sure what "high-level" classes it has, like for differentiation, integration or equation solving.
Elliot Temple wrote:
On Apr 27, 2006, at 4:29 PM, SleepJunk13 wrote:
So.. I have no idea where to start.
Maybe you should figure out a format for storing polynomials, make a class to deal with this, and then create some basic functions like multiply or whatever you think you'll need. or find a library to do this.
By "using" maxima, I mean accessing maxima via a pipe in Ruby. I am
developing a web based mathematical application that can integrate
symbolically among other things. I don't have to use maxima or even ruby
for that matter but I would like to if possible. I understand the
concept of "system" access but during the execution I've hit two snags
First, If i run this code multiple times:
max = IO.popen("maxima", "w+")
max.puts "1+1;"
8.times {max.gets} #needed to rid of unneeded lines
response = max.gets
max.close
I get a new instances (found via ps -A) of "ttys000 0:00.00 (sbcl)"
every time i run the code. And i can't kill this "sbcl" via "kill pid".
And after enough runs, I have to restart my computer.
Second, I am unable to just get the last line from maxima without
running "8.times {max.gets}." If i try to execute "max.gets" after
maxima has reached the last line, I get an error (and no return to
ruby). While i can get around this problem, (via 8.times ) it isn't
exactly best practices.
Second, I am unable to just get the last line from maxima without
running "8.times {max.gets}." If i try to execute "max.gets" after
maxima has reached the last line, I get an error (and no return to
ruby). While i can get around this problem, (via 8.times ) it isn't
exactly best practices.
AFAIK the maxima gui itself passes the code on to an inferior lisp
process that does the actual work. I don't know how much work that
would be to implement that protocol but maybe looking at the gui's
source code would help to give you an idea of how to communicate with
maxima reliably.
There are a number of web apps that do this sort of thing -- live math
on the web. It sounds to me like you're re-inventing a wheel here. Of
course, most of said web apps are not in Ruby, because Ruby and Rails
weren't popular when they were designed.
···
On Thu, Feb 5, 2009 at 12:49 PM, Richard Schneeman <thedickster@gmail.com> wrote:
By "using" maxima, I mean accessing maxima via a pipe in Ruby. I am
developing a web based mathematical application that can integrate
symbolically among other things. I don't have to use maxima or even ruby
for that matter but I would like to if possible. I understand the
concept of "system" access but during the execution I've hit two snags
First, If i run this code multiple times:
max = IO.popen("maxima", "w+")
max.puts "1+1;"
8.times {max.gets} #needed to rid of unneeded lines
response = max.gets
max.close
I get a new instances (found via ps -A) of "ttys000 0:00.00 (sbcl)"
every time i run the code. And i can't kill this "sbcl" via "kill pid".
And after enough runs, I have to restart my computer.
Second, I am unable to just get the last line from maxima without
running "8.times {max.gets}." If i try to execute "max.gets" after
maxima has reached the last line, I get an error (and no return to
ruby). While i can get around this problem, (via 8.times ) it isn't
exactly best practices.
For reinventing the wheel...the best candidate for copying is WMI (uses
maxima) http://matek.hu/ which is kind enough to give its src code away
for free, unfortunately its PHP and I haven't had anyone who knows
enough about PHP & Ruby to help me figure out what i'm doing wrong:
I also discovered Sage an open source math program written in python http://www.sagemath.org/ I haven't done anything with python before, but
I have some friends who rave django, so it may just be easier to go that
route. Either way I'll let everyone know what ended up meeting my needs.
I also discovered Sage an open source math program written in python http://www.sagemath.org/ I haven't done anything with python before, but
I have some friends who rave django, so it may just be easier to go that
route. Either way I'll let everyone know what ended up meeting my needs.
Sage is an outstanding project, even though it is written in Python.
I'm on their mailing list and I've done a fair amount of testing of it.
In terms of tools for day-to-day use by working mathematicians, I don't
know of anything better in the open source world, and they are closing
in on the expensive proprietary packages like Mathematica and Matlab.
Funny you should mention Sage, since their slogan is, or used to be,
"Building the car, not re-inventing the wheel."
···
--
M. Edward (Ed) Borasky
I've never met a happy clam. In fact, most of them were pretty steamed.