Skip to main content
Became Hot Network Question
[Ьatlab](https://www.predictiveanalyticsworld.com/patimes/wp-content/uploads/2019/01/BatMan-Computer.png)?
Source Link
Federico Poloni
  • 12.5k
  • 1
  • 34
  • 62

Recently, I have met a question that

a saying goes that for large linear system: iterative methods are required because of memory problem of direct methods.

But when I implement some experiments in ЬatlabMatlab, I find a strange phenomenon: I used the Poisson equation in 2D and use Q1 element, grid input is 10, and I got a system: $$Ax = f$$ where $A$ is $1050625\times 1050625$, which is large and sparse.

In principle, we should use iterative methods, such as PCG or minres built-in Matlab, with AMG preconditioner. But when I input A\f in the command window, Matlab direct method only costs $4.588234$ seconds, which is fast.

Then, I want to test PCG with AMG preconditioner. I find the time for setup of the AMG preconditioner to be very very long. First, I thought this is because the size of system is not large enough, then I use the grid input =11, and the memory breaks down, the system matrix $A$ cannot be generated, so in my PC, I can not get the result that iterative method is better than direct method for large sparse system. Why? Is it the reason that the size is not enough? but the larger system cannot be generated in our personal computer.

I also believe that for large sparse system, iterative methods are necessary, but the numerical results are contrary: Matlab's A\b is so fast.

How should we understand the saying "iterative methods are better than direct methods for large sparse system"? Could you please give me some suggestions?

Recently, I have met a question that

a saying goes that for large linear system: iterative methods are required because of memory problem of direct methods.

But when I implement some experiments in Ьatlab, I find a strange phenomenon: I used the Poisson equation in 2D and use Q1 element, grid input is 10, and I got a system: $$Ax = f$$ where $A$ is $1050625\times 1050625$, which is large and sparse.

In principle, we should use iterative methods, such as PCG or minres built-in Matlab, with AMG preconditioner. But when I input A\f in the command window, Matlab direct method only costs $4.588234$ seconds, which is fast.

Then, I want to test PCG with AMG preconditioner. I find the time for setup of the AMG preconditioner to be very very long. First, I thought this is because the size of system is not large enough, then I use the grid input =11, and the memory breaks down, the system matrix $A$ cannot be generated, so in my PC, I can not get the result that iterative method is better than direct method for large sparse system. Why? Is it the reason that the size is not enough? but the larger system cannot be generated in our personal computer.

I also believe that for large sparse system, iterative methods are necessary, but the numerical results are contrary: Matlab's A\b is so fast.

How should we understand the saying "iterative methods are better than direct methods for large sparse system"? Could you please give me some suggestions?

Recently, I have met a question that

a saying goes that for large linear system: iterative methods are required because of memory problem of direct methods.

But when I implement some experiments in Matlab, I find a strange phenomenon: I used the Poisson equation in 2D and use Q1 element, grid input is 10, and I got a system: $$Ax = f$$ where $A$ is $1050625\times 1050625$, which is large and sparse.

In principle, we should use iterative methods, such as PCG or minres built-in Matlab, with AMG preconditioner. But when I input A\f in the command window, Matlab direct method only costs $4.588234$ seconds, which is fast.

Then, I want to test PCG with AMG preconditioner. I find the time for setup of the AMG preconditioner to be very very long. First, I thought this is because the size of system is not large enough, then I use the grid input =11, and the memory breaks down, the system matrix $A$ cannot be generated, so in my PC, I can not get the result that iterative method is better than direct method for large sparse system. Why? Is it the reason that the size is not enough? but the larger system cannot be generated in our personal computer.

I also believe that for large sparse system, iterative methods are necessary, but the numerical results are contrary: Matlab's A\b is so fast.

How should we understand the saying "iterative methods are better than direct methods for large sparse system"? Could you please give me some suggestions?

added 17 characters in body; edited tags
Source Link
Anton Menshov
  • 8.7k
  • 7
  • 41
  • 94

why Why iterative mtthod method:AMG AMG preconditioned PCG is slower than matlabMatlab direct method 'A\b';'A\b'?

Recently, I have met a question that 'a saying goes that for large linear system: iterative methods are required because of memory problem of direct methods'.

a saying goes that for large linear system: iterative methods are required because of memory problem of direct methods.

But when I implement some experiments in matlabЬatlab, I find a strange phenomenon: I used the poissonPoisson equation in 2D and use Q1 element, grid input is 10, and I got a sysmtesystem: A* x = f; where A$$Ax = f$$ where $A$ is 1050625X1050625$1050625\times 1050625$, which is so large and sparse. 

In princicleprinciple, we should use iterative methods,such such as PCG or minres built in matlab-in Matlab, with AMG preconditioner. But But when I input A\fA\f in the command window, matlabMatlab direct method only cost 4.588234costs $4.588234$ seconds., which is so fast. Then

Then, I want to test PCG with AMG preconditioner. I I find the time for setup of the AMG preconditioner isto be very very long. First First, I thought this is because the size of system is not large enough, then I use the grid input =11, and the memory breaks down,the the system matrix A$A$ cannot be generated, so in my PC, I can not get the result that iterative method is better than direct method for large sparse system. Why? Is it the reason that the size is not enough? but too largethe larger system cannot be generated in our personal computer. I

I also believe that for large sparse system, iterative methods are necessary,but but the numerical results are contrary: matlab A\bMatlab's A\b is so fast. How shold

How should we understand the saying 'iterative methods are better than direct methods for large sparse system',"iterative methods are better than direct methods for large sparse system"? Could you please give me some suggestions, thanks very much. files are below.?

why iterative mtthod :AMG preconditioned PCG is slower than matlab direct method 'A\b';

Recently, I have met a question that 'a saying goes that for large linear system: iterative methods are required because of memory problem of direct methods'. But when I implement some experiments in matlab, I find a strange phenomenon: I used the poisson equation in 2D and use Q1 element, grid input is 10, and I got a sysmte: A* x = f; where A is 1050625X1050625, which is so large and sparse. In princicle, we should use iterative methods,such as PCG or minres built in matlab, with AMG preconditioner. But when I input A\f in command window, matlab direct method only cost 4.588234 seconds. which is so fast. Then, I want to test PCG with AMG preconditioner. I find the time for setup of AMG preconditioner is very very long. First I thought this is because the size of system is not large enough, then I use the grid input =11, and the memory breaks down,the system matrix A cannot be generated, so in my PC, I can not get the result that iterative method is better than direct method for large sparse system. Why? Is it the reason that the size is not enough? but too large system cannot be generated in our personal computer. I also believe that for large sparse system, iterative methods are necessary,but the numerical results are contrary: matlab A\b is so fast. How shold we understand the saying 'iterative methods are better than direct methods for large sparse system', Could you please give me some suggestions, thanks very much. files are below.

Why iterative method: AMG preconditioned PCG is slower than Matlab direct method 'A\b'?

Recently, I have met a question that

a saying goes that for large linear system: iterative methods are required because of memory problem of direct methods.

But when I implement some experiments in Ьatlab, I find a strange phenomenon: I used the Poisson equation in 2D and use Q1 element, grid input is 10, and I got a system: $$Ax = f$$ where $A$ is $1050625\times 1050625$, which is large and sparse. 

In principle, we should use iterative methods, such as PCG or minres built-in Matlab, with AMG preconditioner. But when I input A\f in the command window, Matlab direct method only costs $4.588234$ seconds, which is fast.

Then, I want to test PCG with AMG preconditioner. I find the time for setup of the AMG preconditioner to be very very long. First, I thought this is because the size of system is not large enough, then I use the grid input =11, and the memory breaks down, the system matrix $A$ cannot be generated, so in my PC, I can not get the result that iterative method is better than direct method for large sparse system. Why? Is it the reason that the size is not enough? but the larger system cannot be generated in our personal computer.

I also believe that for large sparse system, iterative methods are necessary, but the numerical results are contrary: Matlab's A\b is so fast.

How should we understand the saying "iterative methods are better than direct methods for large sparse system"? Could you please give me some suggestions?

Source Link
Happy
  • 981
  • 4
  • 13

why iterative mtthod :AMG preconditioned PCG is slower than matlab direct method 'A\b';

Recently, I have met a question that 'a saying goes that for large linear system: iterative methods are required because of memory problem of direct methods'. But when I implement some experiments in matlab, I find a strange phenomenon: I used the poisson equation in 2D and use Q1 element, grid input is 10, and I got a sysmte: A* x = f; where A is 1050625X1050625, which is so large and sparse. In princicle, we should use iterative methods,such as PCG or minres built in matlab, with AMG preconditioner. But when I input A\f in command window, matlab direct method only cost 4.588234 seconds. which is so fast. Then, I want to test PCG with AMG preconditioner. I find the time for setup of AMG preconditioner is very very long. First I thought this is because the size of system is not large enough, then I use the grid input =11, and the memory breaks down,the system matrix A cannot be generated, so in my PC, I can not get the result that iterative method is better than direct method for large sparse system. Why? Is it the reason that the size is not enough? but too large system cannot be generated in our personal computer. I also believe that for large sparse system, iterative methods are necessary,but the numerical results are contrary: matlab A\b is so fast. How shold we understand the saying 'iterative methods are better than direct methods for large sparse system', Could you please give me some suggestions, thanks very much. files are below.