showing only real numbers



On Wednesday 19 November 2008 12:42:19 Justin Harford wrote:

> I am doing calculations to find solution concentrations in chemical
> equilibria.  Some of this involves work solving cubics, which I am
> finding yield a lot of imaginary numbers.  Is there perhaps a way
> to make maxima only give the real roots of a cubic, or any other
> polynomial for that matter?  They really just get in the way when
> dealing with real processes.

realroots, realonly.

(%i1) realroots (x^3-3*x^2+4*x-2 = 0);
(%o1)                              [x = 1]

(%i2) algsys([x^3-3*x^2+4*x-2 = 0], [x]);
(%o2)               [[x = %i + 1], [x = 1 - %i], [x = 1]]

(%i3) block([realonly:true], algsys([x^3-3*x^2+4*x-2 = 0], [x]));
(%o3)                             [[x = 1]]

http://maxima.sourceforge.net/docs/manual/en/maxima_21.html

-- 
Pungenday, Aftermath 31 YOLD 3174
Alexey Beshenov  http://beshenov.ru/