Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Which numerical method should I use??

Subject: Which numerical method should I use??

From: Hermano Cappa

Date: 2 Dec, 2011 17:06:07

Message: 1 of 4

Hi,

I want to solve the 3D Laplace equation in cylindrical coordinates with a fast finite difference technique. Which one should I use if I want to solve it with Matlab (SOR, congujate gradient, etc)?

I tried this with a simple loop but the calculation time is so big....

Examples in 3D are very welcome!!

Thx

Subject: Which numerical method should I use??

From: Rune Allnor

Date: 2 Dec, 2011 17:17:00

Message: 2 of 4

On 2 Des, 18:06, "Hermano Cappa" <cappaste...@gmail.com> wrote:
> Hi,
>
> I want to solve the 3D Laplace equation in cylindrical coordinates with a fast finite difference technique. Which one should I use if I want to solve it with Matlab (SOR, congujate gradient, etc)?
>
> I tried this with a simple loop but the calculation time is so big....
>
> Examples in 3D are very welcome!!

Wrong question. First find a method that works *well*,
only then ask for fast.

FEM is among the harder numerical tasks to implement
from scratch, so get your priorities right.

Rune

Subject: Which numerical method should I use??

From: Bruno Luong

Date: 2 Dec, 2011 17:39:08

Message: 3 of 4

"Hermano Cappa" wrote in message <jbb0hv$g38$1@newscl01ah.mathworks.com>...
> Hi,
>
> I want to solve the 3D Laplace equation in cylindrical coordinates with a fast finite difference technique. Which one should I use if I want to solve it with Matlab (SOR, congujate gradient, etc)?

In the cylindrical coordinates, there is a singularity at r=0 which requires careful discretisation, whatever the method you use.

For Laplace equation, the most efficient solver to date is probably multi-grid solver. Some of the other technique such as FFT might be used in some cases.

Bruno

Subject: Which numerical method should I use??

From: Nasser M. Abbasi

Date: 2 Dec, 2011 18:48:44

Message: 4 of 4

On 12/2/2011 11:06 AM, Hermano Cappa wrote:
> Hi,
>
> I want to solve the 3D Laplace equation in cylindrical coordinates with a fast finite
>difference technique. Which one should I use if I want to solve it with Matlab (SOR,
>congujate gradient, etc)?
>
> I tried this with a simple loop but the calculation time is so big....
>
> Examples in 3D are very welcome!!
>
> Thx

CG is not really a 'FDM' method.

matlab has a cg solver, doc:

  PCG Preconditioned Conjugate Gradients Method.

and try that, will be faster than the stationary methods such as
sor, jacobi, gauss-siedel, etc...

you can also try multi-resolution type methods, such as multigrid,
should be the fastest on the elliptic pde you have.

--Nasser

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us