### Re: is it a bug in sum?

2008-04-01 07:03:36 GMT

On Mon, Mar 31, 2008 at 10:01 PM, laurent couraud <l.couraud <at> free.fr> wrote: > simpsum:true$ > sum((x[i]-sum(x[i],i,1,n)/n)^2,i,1,n) > > The result is 0. I don't have Maxima where I am (travelling), but I imagine that using the same index names for the inner and outer sums will cause problems (and is not standard mathematical usage either). Try using j as the inner index, for example. -s

### Re: is it a bug in sum?

2008-04-01 10:40:11 GMT

Stavros is correct; with distinct sum indices, it works: (%i6) sum((x[j]-sum(x[i],i,1,n)/n)^2,j,1,n); (%o6) sum((x[j]-sum(x[i],i,1,n)/n)^2,j,1,n) (%i7) ev(%,n=2,'sum); (%o7) (x[2]-(x[2]+x[1])/2)^2+(x[1]-(x[2]+x[1])/2)^2 Barton -----maxima-bounces <at> math.utexas.edu wrote: ----- >Try using j as the inner index, for example. > > -s

### FW: benchmarking CAS

2008-04-01 13:21:51 GMT

> -----Original Message----- > From: Roman Pearce [mailto:rpearcea <at> gmail.com] > Sent: Monday, March 31, 2008 8:43 PM > To: rjf > Subject: Re: benchmarking CAS > > > Are you saying that if the polynomials were small, Maple > would not use > > the same routines and would not run with garbage collection? > > That's correct. For small polynomials Maple expands and divides > products in the kernel, using compiled C code that runs without > garbage collection. For large problems the kernel calls back into the > Maple library, to the routines `expand/bigprod` and `expand/bigdiv` > and `expand/bigpow`. These routines are recursive, interpreted Maple > code that run with garbage collection. That's why in your paper on > sparse multiplication Maple 7 was found to be much slower than > MapleVR4, etc. They had to change it because for their algorithms, > doing a big problem without garbage collection will crash the system. > > On 3/30/08, rjf <fateman <at> gmail.com> wrote: > > On Mar 29, 6:28 pm, Roman Pearce <rpear... <at> gmail.com> wrote: > > > > > > > > Because the polynomials are large, Maple uses interpreted routines > > > that run with garbage collection. > > > > Are you saying that if the polynomials were small, Maple > would not use(Continue reading)

### Re: is it a bug in sum?

2008-04-01 15:13:32 GMT

On 4/1/08, Stavros Macrakis <macrakis <at> alum.mit.edu> wrote: > I don't have Maxima where I am (travelling), but I imagine that using > the same index names for the inner and outer sums will cause problems > (and is not standard mathematical usage either). Well, as it stands, the sum-simplfication code attempts to treat the summation index as a local variable, although it messes up this problem. (%i1) trace (?simpsum2, ?simpsum1, ?simpsum1\-save); (%o1) [simpsum2, simpsum1, simpsum1-save] (%i2) display2d : false; (%o2) false (%i3) sum ((x[j] - sum (x[j], j, 1, n)/n)^2, j, 1, n); 1 Enter ?simpsum1 [x[?g15869],?g15869,1,n] 1 Exit ?simpsum1 'sum(x[?g15869],?g15869,1,n) 1 Enter ?simpsum1 [x[?g15869],?g15869,1,n] 1 Exit ?simpsum1 'sum(x[?g15869],?g15869,1,n) 1 Enter ?simpsum1 [x[j],j,1,n] 1 Exit ?simpsum1 'sum(x[j],j,1,n) 1 Enter ?simpsum1 [(x[j]-('sum(x[j],j,1,n))/n)^2,j,1,n] 1 Exit ?simpsum1 'sum((x[j]-('sum(x[j],j,1,n))/n)^2,j,1,n) (%o3) 'sum((x[j]-('sum(x[j],j,1,n))/n)^2,j,1,n) (%i4) %, simpsum; 1 Enter ?simpsum1 [x[?g15929],?g15929,1,n] 1 Enter ?simpsum1\-save [x[?g15929],?g15929,1,n] 1 Enter ?simpsum2 [x[?g15929],?g15929,1,n] 2 Enter ?simpsum1 [x[?g15929],?g15929,1,n] 2 Exit ?simpsum1 'sum(x[?g15929],?g15929,1,n)(Continue reading)

### Re: vector geometrie

2008-04-01 15:14:02 GMT

On Monday 31 March 2008 17:25, Hans W. Hofmann wrote: > I am searching for some macros to handle vector geometrie inclusive > plotting. Is there a pending project or exist here some people zu start a > project? As rookie in programming macros I want to discuss the basics and > structur of a vector geometrie macros preferably in german-english . > > Some thoughts: > Points should described as a list [y,x,z] and vectors as matrix > matrix([x],[y],[z]). > I tend to have e.g. a line object, pardon, will say a line list, which > covers all/some details of describing/plotting a line. Input wellcome... As far as I know, there are no special packages for analytic geometry, but basic functions and linear algebra stuff are enough, I think. Introducing new objects may produce more mess than advantages. In vector calculus code, Maxima represents vectors as lists; "listarith" works with lists in appropriate way. Vector plotting is already implemented in draw2d / draw3d. -- -- Alexey Beshenov <al <at> beshenov.ru> http://beshenov.ru/

_______________________________________________ Maxima mailing list Maxima <at> math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima(Continue reading)

### besselarray?

2008-04-01 16:55:02 GMT

Maxima has the variable besselarray. It's no longer documented, but I think it used to contain the values of the bessel functions since the computation of a bessel function oftentimes computes the value of the bessel function for all lower orders. Bug 1920177 <https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1920177&group_id=4933> has several fixes, and the besselarray, besides being currently broken, also complicates the implementation a bit. I guess it's important if you're using Fourier-Bessel expansions or something like that, but perhaps we should provide a different interface if you want the sequence of values. Should we keep besselarray around? Ray

### Re: cardioid

2008-04-01 17:09:55 GMT

Hi Thx for all answers. 1. I think that in polar form cardioid: e1:exp(t*%i)/2-exp(2*t*%i)/4; can't be drawn since polar plots have "center " in point 0 ( This cardioid really has radius equation: r: (1-cos(theta))/2; but it has to be moved to the right 1/4 unit. It can't be done in polar form 2. You say: "You're converting expression to polar form incorrectly." Can you show me how to do it correctly ? Regards Adam

### Re: A partfrac limitation

2008-04-01 18:15:57 GMT

Dear All, I have the same problem with partfrac like Albert Reiner had:

kovzol <at> pascal:~$ maxima

Maxima 5.13.0 http://maxima.sourceforge.net

Using Lisp CLISP 2.38 (2006-01-24)

Distributed under the GNU Public License. See the file COPYING.

Dedicated to the memory of William Schelter.

This is a development version of Maxima. The function bug_report()

provides bug reporting information.

(%i1) load(simplify_sum)$

(%i2) my_partfrac(e, x) := partfrac(num(e)/factor_with_solve(e, x), x)$

(%i3) my_partfrac(1/(x^4+20*x^2+120), x);

Division by 0

#0: my_partfrac(e=1/(x^4+20*x^2+120),x=x)(simplify_sum.mac line 511)

-- an error. To debug this try debugmode(true);

Am I using a too old version of Maxima?

Best regards, Zoltan

_______________________________________________ Maxima mailing list Maxima <at> math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima

### Re: A partfrac limitation

2008-04-01 18:58:32 GMT

Hi Zoltan, I think that there should be denom(e)

my_partfrac(e, x) := partfrac(num(e)/factor_with_solve(denom(e), x), x)$

Another problem is that factor_with_solve factors over complex numbers. I used the following:

(factor_with_solve_real is very close to factor_with_solve but gives factorization over reals)

factor_with_solve_real(expr, n) := block(

[sol, fac, expr1],

sol : solve(expr, n),

expr : ratexpand(expr),

fac : ratcoef(expr, n, hipow(expr, n)),

for i:1 thru length(sol) do (

if not(freeof(n, rhs(sol[i]))) then error(),

if imagpart(rectform(rhs(sol[i])))=0 then

fac : fac * (n - rhs(sol[i]))^multiplicities[i]

else

(if imagpart(rectform(rhs(sol[i])))>0 then

fac: fac*(ratsimp(expand((n-rhs(sol[i]))*(n-conjugate(rhs(sol[i]))))))^multiplicities[i])

),

if expand(expr)#expand(fac) then error(),

fac

)$

my_partfrac(e, x) := partfrac(num(e)/factor_with_solve_real(denom(e), x), x);

Robert M.

Dear All, I have the same problem with partfrac like Albert Reiner had:

kovzol <at> pascal:~$ maxima

Maxima 5.13.0 http://maxima.sourceforge.net

Using Lisp CLISP 2.38 (2006-01-24)

Distributed under the GNU Public License. See the file COPYING.

Dedicated to the memory of William Schelter.

This is a development version of Maxima. The function bug_report()

provides bug reporting information.

(%i1) load(simplify_sum)$

(%i2) my_partfrac(e, x) := partfrac(num(e)/factor_with_solve(e, x), x)$

(%i3) my_partfrac(1/(x^4+20*x^2+120), x);

Division by 0

#0: my_partfrac(e=1/(x^4+20*x^2+120),x=x)(simplify_sum.mac line 511)

-- an error. To debug this try debugmode(true);

Am I using a too old version of Maxima?

Best regards, Zoltan

_______________________________________________

Maxima mailing list

Maxima <at> math.utexas.edu

http://www.math.utexas.edu/mailman/listinfo/maxima

_______________________________________________ Maxima mailing list Maxima <at> math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima