[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem with the octave built-in function "kron"
From: |
c. |
Subject: |
Re: problem with the octave built-in function "kron" |
Date: |
Fri, 3 May 2013 18:44:05 +0200 |
On 3 May 2013, at 18:30, Stephen Montgomery-Smith <address@hidden> wrote:
> On 05/03/2013 10:51 AM, Juan Pablo Carbajal wrote:
>
>> Check your sizes... the matrix after kron is really huge.
>> What are you trying to achieve? Can't you do it without kron or iteratively?
>
> Finite difference representation of Laplacian in 2D with Dirichlet
> boundary conditions.
oh well then it can be done with the bim package:
pkg load bim
x = linspace(0,1,rx);
y = linspace(0,1,ry);
msh = bim2c_mesh_properties (msh2m_structured_mesh (x, y, 1, 1:4));
A = bim2a_laplacian (msh, 1, 1);
bim actually uses Finite Elements rather than Finite Differences and a
triangular rather than
rectangular mesh, but in this case the results should only differ by a constant
factor, so
AFD = rx*ry*A;
should return the result the OP was aiming for.
c.