Laplace Equation : with " irregular boundary'h1,h2,h3,h4' "
∂/∂x(∂/∂x(u))+∂/∂y(∂/∂y(u)) = 0
grid spacing : 'x direction' = h
grid spacing : 'y direction' = k
arm length     :   h1,h2,h3,h4
peter.vlasschaert@gmail.com,14/12/2017

 a,b

 rectangular domain,grid spacing (same for x,y)
,arm length same.

Figure 1a:   grid spacing : a (same for x,y)
                    arm length : east = h*a ,north = k*a,west = a,south = a
Figure 1b:   grid spacing : a  ( same for x,y)
                    arm length : east = h1*a ,north = k2*a,west =h3* a,south = k4*a
------------------------------------------------------------------------------------------------------------
irregular boundary => irregular grid points ,example :Figure 1a,1b
regular   boundary => regular    grid points ,example :Figure 2, u8                                                                                                                  

 general irregular node (0),h1,h2,h3,h4,grid spacing (same for x,y)

find : numerical representation for 'general irregular node (0)'
           grid spacing ' x - direction ' = h
           grid spacing ' y - direction ' = k
           arm length                                = h1,h2,h3,h4

1e) construct polynomial 'u(x,y)'

p1:u(x,y):=a0+a1*x+a2*y+a3*x^2+a4*y^2;

2e) ref node (0) ,coordinate = (0,0),u0

p2:u0=u(0,0);
p2a:u(0,0)=u0;

3e)  other nodes , hi = ui  , i=1,2,3,4

p3a:ev(u1=u(h1,0),p2a)-p2a;
p3b:ev(u2=u(0,h2),p2a)-p2a;
p3c:ev(u3=u(-h3,0),p2a)-p2a;
p3d:ev(u4=u(0,-h4),p2a)-p2a;

4e) find values :a)∂/∂x(∂/∂x(u)) ,b)∂/∂y(∂/∂x(u))

a) ∂/∂x(∂/∂x(u)) 

p4:'diff(u,x)=diff(rhs(p1),x)$
p5:'diff(u,x,2) = diff(rhs(p4),x);

b) ∂/∂y(∂/∂y(u)) 

p6:'diff(u,y)=diff(rhs(p1),y)$
p7:'diff(u,y,2) = diff(rhs(p6),y);

5e) we need to find : a) a3, b)a4

a) find a3 : see above : ' p3a,p3c ' =>  remove  a1

p8:ev(p3a*h3,p2a);
p9:ev(p3c*h1,p2a);
p10:ratsimp(p8+p9);
p11:solve(p10,a3)[1];

b) find a4 : see above : ' p3b,p3d ' =>  remove  a2

p12:ev(p3b*h4,p2a);
p13:ev(p3d*h2,p2a);
p14:ratsimp(p12+p13);
p15:solve(p14,a4)[1];

6e) result: a) ∂/∂x(∂/∂x(u)) *grid spacing 'x',b) ∂/∂y(∂/∂y(u)) *grid spacing 'y'

correction for grid spacing =>

a) ∂/∂x(∂/∂x(u)) *grid spacing 'x' = ∂/∂x(∂/∂x(u)) *1/h^2  

p16:lhs(p5)=rhs(p5)*1/h^2$
p16a:ev(p16,p11);

b) ∂/∂y(∂/∂y(u)) *grid spacing 'y' = ∂/∂y(∂/∂y(u)) *1/k^2 

p17:lhs(p7)=rhs(p7)*1/k^2$
p17a:ev(p17,p15);

7e) laplace equation:∂/∂x(∂/∂x(u))+∂/∂y(∂/∂y(u)),irregular node

p18:p16a+p17a;

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

rem: regular node h1=h2=h3=h4=1 
          grid spacing 'x' = h
          grid spacing 'y' = k

p19:ev(p18,h1=1,h2=1,h3=1,h4=1);

rem : h=k  'p19',same grid spacing for x,y.

p20:ev(p19,k=h)*h^2;
p21:factor(ratsimp(p20));

see :laplace equation 2D (numerical molecule) ,website

-----------------------------------------------------------------------------------------------------------------------------------------------------------------