[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: algebraic manipulator in octave
From: 
Geraint Paul Bevan 
Subject: 
Re: algebraic manipulator in octave 
Date: 
Sun, 22 Feb 2004 00:14:19 +0000 
Useragent: 
Mozilla/5.0 (X11; U; Linux i686; enUS; rv:1.6b) Gecko/20031221 Thunderbird/0.4 
BEGIN PGP SIGNED MESSAGE
Hash: SHA1
Paul Kienzle wrote:

 On Feb 21, 2004, at 3:15 PM, Arnau Mir wrote:

> Hello.
>
> Can I use octave as algebraic manipulator?
> For example, can I make with octave the following:
>
> a x^2+b x+c=0
>
> and octave responses a solution as a function of a,b c?


 octaveforge (http://octave.sf.net) has a symbolic
 package which is a wrapper around GiNaC. It
 preserves symbols through mathematical operations.
 Later you can substitute values for the symbols.

 It looks to have some numeric solvers, but I don't
 see anything to solve for x symbolically.

 Paul Kienzle
 address@hidden

I have just tried using ginsh directly to solve this equation, but it
seems that ginsh can only solve linear systems:
 lsolve ( { a*x^2 + b*x + c == 0 } , { x } );
lsolve: system is not linear
This seems to agree with the GiNaC tutorial pages
(http://www.ginac.de/tutorial) which state that lsolve is just a wrapper
for matrix::solve which "linear systems may be solved with".
Therefore, I doubt that any of the Octave interfaces to GiNaC/ginsh will
be able to solve this problem symbolically.
Maxima (http://maxima.sourceforge.net) is capable of solving the
problem, but I do not know of any Octave interface to it,
(C1) solve ( a*x^2 + b*x + c , x );
2 2
SQRT(b  4 a C) + b SQRT(b  4 a C)  b
(D1) [x =  , x = ]
2 a 2 a
Another package, Reduce (http://www.unikoeln.de/REDUCE/) is also
certainly capable of solving nonlinear expressions, but is
unfortunately not free software.
1: solve ( a*x^2 + b*x + c , x );
~ 2
~  4*a*c + b 0.5
~ ()  0.5*b
~ 4
{x=,
~ a
~ 2
~  4*a*c + b 0.5
~  ()  0.5*b
~ 4
~ x=}
~ a
 
Geraint Bevan
http://homepage.ntlworld.com/geraint.bevan
BEGIN PGP SIGNATURE
Version: GnuPG v1.2.4 (GNU/Linux)
iEYEARECAAYFAkA39FsACgkQcXV3N50QmNODiQCfU+Fyz5MvOGdSkPuWLMvX7ltQ
K0oAnA3MA4+39IxNmyUerb8MJMCLCBEF
=mfnD
END PGP SIGNATURE

Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
