Re: Slow LinearSolve.
- To: mathgroup at smc.vnet.net
- Subject: [mg49684] Re: Slow LinearSolve.
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Tue, 27 Jul 2004 07:01:37 -0400 (EDT)
- Organization: The University of Western Australia
- References: <ce2gcm$8tu$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <ce2gcm$8tu$1 at smc.vnet.net>, Aaron Fude <aaronfude at yahoo.com> wrote: > Within 24 hours and counting, Mathematica was not able to solve Ax = b for > the following A and the following B. Another system does this in a matter of > seconds. The other system does it numerically, I assume? Mathematica is trying to compute the answer exactly. If you enter LinearSolve[N[A], b] and you will get an answer immediately. I note that your matrix A is a Vandermonde matrix Table[Exp[I n m Pi/12], {m, -6, 6}, {n, 0, 12}] == A or x[m_] = Exp[I m Pi/12] Table[x[m]^n, {m, -6, 6}, {n, 0, 12}] == A (see http://mathworld.wolfram.com/VandermondeMatrix.html) and the system you want to solve is related to computing the (inverse) discrete Fourier transform of b. Cheers, Paul > How do make Mathematica do the same? I use "LinearSolve[A, b]" > > A = {{1, -I, -1, I, 1, -I, -1, I, 1, -I, -1, I, 1}, {1, E^(((-5*I)/12)*Pi), > E^(((-5*I)/6)*Pi), > E^(((3*I)/4)*Pi), E^((I/3)*Pi), E^((-I/12)*Pi), -I, E^(((-11*I)/12)*Pi), > E^(((2*I)/3)*Pi), > E^((I/4)*Pi), E^((-I/6)*Pi), E^(((-7*I)/12)*Pi), -1}, > {1, E^((-I/3)*Pi), E^(((-2*I)/3)*Pi), -1, E^(((2*I)/3)*Pi), E^((I/3)*Pi), 1, > E^((-I/3)*Pi), > E^(((-2*I)/3)*Pi), -1, E^(((2*I)/3)*Pi), E^((I/3)*Pi), 1}, > {1, E^((-I/4)*Pi), -I, E^(((-3*I)/4)*Pi), -1, E^(((3*I)/4)*Pi), I, > E^((I/4)*Pi), 1, > E^((-I/4)*Pi), -I, E^(((-3*I)/4)*Pi), -1}, {1, E^((-I/6)*Pi), > E^((-I/3)*Pi), -I, > E^(((-2*I)/3)*Pi), E^(((-5*I)/6)*Pi), -1, E^(((5*I)/6)*Pi), > E^(((2*I)/3)*Pi), I, > E^((I/3)*Pi), E^((I/6)*Pi), 1}, {1, E^((-I/12)*Pi), E^((-I/6)*Pi), > E^((-I/4)*Pi), > E^((-I/3)*Pi), E^(((-5*I)/12)*Pi), -I, E^(((-7*I)/12)*Pi), > E^(((-2*I)/3)*Pi), > E^(((-3*I)/4)*Pi), E^(((-5*I)/6)*Pi), E^(((-11*I)/12)*Pi), -1}, > {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, E^((I/12)*Pi), E^((I/6)*Pi), > E^((I/4)*Pi), > E^((I/3)*Pi), E^(((5*I)/12)*Pi), I, E^(((7*I)/12)*Pi), E^(((2*I)/3)*Pi), > E^(((3*I)/4)*Pi), > E^(((5*I)/6)*Pi), E^(((11*I)/12)*Pi), -1}, {1, E^((I/6)*Pi), E^((I/3)*Pi), > I, > E^(((2*I)/3)*Pi), E^(((5*I)/6)*Pi), -1, E^(((-5*I)/6)*Pi), > E^(((-2*I)/3)*Pi), -I, > E^((-I/3)*Pi), E^((-I/6)*Pi), 1}, {1, E^((I/4)*Pi), I, E^(((3*I)/4)*Pi), -1, > E^(((-3*I)/4)*Pi), -I, E^((-I/4)*Pi), 1, E^((I/4)*Pi), I, > E^(((3*I)/4)*Pi), -1}, > {1, E^((I/3)*Pi), E^(((2*I)/3)*Pi), -1, E^(((-2*I)/3)*Pi), E^((-I/3)*Pi), 1, > E^((I/3)*Pi), > E^(((2*I)/3)*Pi), -1, E^(((-2*I)/3)*Pi), E^((-I/3)*Pi), 1}, > {1, E^(((5*I)/12)*Pi), E^(((5*I)/6)*Pi), E^(((-3*I)/4)*Pi), E^((-I/3)*Pi), > E^((I/12)*Pi), I, > E^(((11*I)/12)*Pi), E^(((-2*I)/3)*Pi), E^((-I/4)*Pi), E^((I/6)*Pi), > E^(((7*I)/12)*Pi), -1}, > {1, I, -1, -I, 1, I, -1, -I, 1, I, -1, -I, 1}} > > b = {0, (-2*I)/5, 0, (-2*I)/3, 0, -2*I, Pi, 2*I, 0, (2*I)/3, 0, (2*I)/5, 0} > -- Paul Abbott Phone: +61 8 9380 2734 School of Physics, M013 Fax: +61 8 9380 1014 The University of Western Australia (CRICOS Provider No 00126G) 35 Stirling Highway Crawley WA 6009 mailto:paul at physics.uwa.edu.au AUSTRALIA http://physics.uwa.edu.au/~paul