User:EML4500.f08.JAMAMA/FE/JAN

= 7.1 LLEBF 2D =

Given BCs for 2D
$$ \Omega = \bar \omega = \Box $$ (bi-unit square)

Stiffness matrix $$ \mathbf{\kappa} = \mathbf{I} $$

Where $$ \mathbf{I} \ $$ is identity matrix, namely $$ \mathbf{I}_{nxn} =

\begin{bmatrix} 1 & 0 & \cdots & 0 & 0      \\ 0 & 1 & \cdots & 0 & 0      \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & \cdots & 1 & 0      \\ 0 & 0 & \cdots & 0 & 1 \end{bmatrix}_{nxn}

$$

Forcing functions

$$ f = 1 \ $$

Transien response

$$ \frac{\partial u}{\partial t} = 0 \ $$

Essential BC

$$ g = 2 \ $$ on $$ \partial \Omega \ $$

Natural BC

None

Find Temperature at (0,0) and other inside nodes
Knowing the

$$ div(\mathbf{\kappa} \ grad(u)) + f = \rho c \frac{\partial u}{\partial t} \ $$

1) Find steady state displacement and plot.

2) Find transient displacement and plot

$$ u(x,t=0) = xy \ $$

a)

$$ f(x,t) = 0; x \in \Omega and t > 0 \ $$

$$ g(x,t) = 2; \Gamma_g \in \partial \Omega \ $$

b)

$$ f(x,t) = 1; x \in \Omega and t > 0 \ $$

$$ g(x,t) = 2; \Gamma_g \in \partial \Omega \ $$

1)
In general by Prof. Vu Quoc's

$$ \tilde{m}(w,u) + \tilde{k}(w,u) = \tilde{f}(w,u) \ $$

$$ \tilde{m}(w,u) = \int_\Omega w \rho c \frac{\partial u}{\partial t} d \Omega \ $$

$$ \tilde{k}(w,u) = \int_{\Omega^e} \triangledown{w} \kappa(x, y) \triangledown{u} d \Omega \ $$

$$ \tilde{f}(w) = - \int_{\Gamma_h}w h d \Gamma_h + \int_\Omega w f d \Omega \ $$

$$ K_{ij}^e = \int_{\Omega^e} \triangledown{b^e_i}'(x, y) \kappa(x, y) \triangledown{b^e_j}'(x, y) d \omega_x \ $$

, where $$ x = x^e \ $$, where $$x^e \ $$ represents local node.

For linear 2D case with boundary being square

Bases, $$ b_i \ $$ are defined to be $$ L_{[I,J]} (x, y) = N^e_{[I,J]} (x, y) \ $$

where $$ N^e_{[I,J]}(x, y) = N_I^e(x)N_J^e(y) \ $$ and $$ I, J \ $$ corresponds to numbering of nodes on element scale.



also noting that it's a rectangular shape, such that the distance from x: 1-to-2 = 1-to-3 and node 1 = node 4 in 'x' coordiantes, y: 1-to-4 = 1-to-3 and node 1 = node 2 in 'x' coordinates, we substitute $$ y^e_4 $$ for $$ y^e_3 \ $$ and $$ y^e_1 $$ for $$ y^e_2 \ $$ and the same for other coordinates

$$ N^e_{[1,1]} (x, y) = \frac{x^e-x^e_2}{x^e_1 - x^e_2} \frac{y^e-y^e_4}{y^e_1 - y^e_4} = \frac{1}{A^e}(x-x^e_2)(y - y^e_4) = b_1^e (x,y) \ $$

$$ N^e_{[2,1]} (x, y) = \frac{x^e-x^e_1}{x^e_2 - x^e_1} \frac{y^e-y^e_4}{y^e_1 - y^e_4} = -\frac{1}{A^e}(x-x^e_1)(y - y^e_4) = b_2^e(x,y)\ $$

$$ N^e_{[2,2]} (x, y) = \frac{x^e-x^e_1}{x^e_2 - x^e_1} \frac{y^e-y^e_1}{y^e_4 - y^e_1} = \frac{1}{A^e}(x-x^e_1)(y - y^e_1) = b_3^e (x,y) \ $$

$$ N^e_{[1,2]} (x, y) = \frac{x^e-x^e_2}{x^e_1 - x^e_2} \frac{y^e-y^e_1}{y^e_4 - y^e_1} = -\frac{1}{A^e}(x-x^e_2)(y - y^e_1) = b_4^e (x,y) \ $$

Next we will convert the square element to same size parent element of bi-unit square

$$ x^e = x_1^e N_1^e(\xi) + x_2^e N_2^e(\xi) = x_1^e \frac{1-\xi}{2} + x_2^e \frac{1+\xi}{2}, \xi \in [-1 +1] \ $$

$$ y^e = y_1^e N_1^e(\eta) + y_4^e N_4^e(\eta) = y_1^e \frac{1-\eta}{2} + y_4^e \frac{1+\eta}{2}, \eta \in [-1 +1] \ $$

Then by noting wich side/value of 'x' will be greater in defined rectangular shown

Therefore, we convert element coordinates to parent coordinates

$$ N^e_{[1,1]} (\xi, \eta) = \frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + x_2^e \frac{1+\xi}{2}-x^e_2)(y_1^e \frac{1-\eta}{2} + y_4^e \frac{1+\eta}{2} - y^e_4) \  $$

$$ N^e_{[1,1]} (\xi, \eta) = \frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + [ \frac{1+\xi}{2}- 1 ] x^e_2)(y_1^e \frac{1-\eta}{2} + [ \frac{1+\eta}{2} - 1 ] ) y^e_4)= b^e_1(\xi, \eta) \ $$

$$ N^e_{[2,1]} (x, y) = -\frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + x_2^e \frac{1+\xi}{2} - x^e_1)(y_1^e \frac{1-\eta}{2} + y_4^e \frac{1+\eta}{2} - y^e_4) \ $$

$$ N^e_{[2,1]} (\xi,\eta) =  -\frac{1}{A^e}( [\frac{1-\xi}{2}- 1]x^e_1 + x_2^e \frac{1+\xi}{2})(y_1^e \frac{1-\eta}{2} +  [\frac{1+\eta}{2} - 1] y^e_4) = b_2^e(\xi, \eta)\ $$

$$ N^e_{[2,2]} (\xi, \eta) =  \frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + x_2^e \frac{1+\xi}{2}-x^e_1)(y_1^e \frac{1-\eta}{2} + y_4^e \frac{1+\eta}{2} - y^e_1)  \ $$

$$ N^e_{[2,2]} (\xi, \eta) =  \frac{1}{A^e}( [\frac{1-\xi}{2}- 1]x^e_1 + x_2^e \frac{1+\xi}{2})([\frac{1-\eta}{2} -1]y^e_1 + y_4^e \frac{1+\eta}{2} ) = b_3^e (\xi, \eta) \ $$

$$ N^e_{[1,2]} (\xi, \eta) =  -\frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + x_2^e \frac{1+\xi}{2}-x^e_2)(y_1^e \frac{1-\eta}{2} + y_4^e \frac{1+\eta}{2} - y^e_1) \ $$

$$ N^e_{[1,2]} (\xi, \eta) =  -\frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + [\frac{1+\xi}{2}- 1]x^e_2)( [\frac{1-\eta}{2}-1]y^e_1 + y_4^e \frac{1+\eta}{2}) = b_4^e (\xi, \eta) \ $$

Jacobian Matrix:

$$ \mathbf{J}^e =

\begin{bmatrix} \frac{\partial x}{\partial \xi} &  \frac{\partial y}{\partial \xi}    \\ \\ \frac{\partial x}{\partial \eta} &  \frac{\partial y}{\partial \eta} \end{bmatrix}

$$

taking the $$ x^e \ $$ and $$ y^e \ $$ values from the definition of parent element and substituting into Jacobian matrix we get:

$$ \mathbf{J}^e =

\begin{bmatrix} \frac{\partial x}{\partial \xi} &  \frac{\partial y}{\partial \xi}    \\ \\ \frac{\partial x}{\partial \eta} &  \frac{\partial y}{\partial \eta} \end{bmatrix} =

\begin{bmatrix} \frac{1}{2} (x_2^e - x_1^e) & 0    \\ \\ 0 &  \frac{1}{2} (y_4^e - y_1^e) \end{bmatrix}

$$

From given

$$ d \omega_x = det(\mathbf{J}^e) d \omega_\xi = d \omega_x = \frac{1}{2} (x_2^e - x_1^e)*\frac{1}{2} (y_4^e - y_1^e) d \omega_\xi \ $$

or

$$ d \omega_\xi = \frac{ d \omega_x}{det(\mathbf{J}^e)} = d \omega_\xi = \frac{ d \omega_x}{\frac{1}{2} (x_2^e - x_1^e)*\frac{1}{2} (y_4^e - y_1^e)} $$

With this last information we have a completely defined stiffness element matrix $$ K^e \ $$. Also note that since we have, 4 degrees of freedom in 1 element node, we do expect the gram matrix $$ \Gamma \ $$ to be 4x4, therefore, $$ \kappa_{4x4} \ $$

$$ K_{ij}^e = \int_{\Omega^e} \triangledown{b^e_i}'(x, y) \kappa(x, y) \triangledown{b^e_j}'(x, y) d \omega_x \ $$

$$ K_{ij}^e = \int_{-1}^{+1}

\begin{bmatrix} \triangledown{b^e_1} \triangledown{b^e_1} & \triangledown{b^e_1} \triangledown{b^e_2} & \triangledown{b^e_1} \triangledown{b^e_3} & \triangledown{b^e_1} \triangledown{b^e_4}      \\ & \triangledown{b^e_2} \triangledown{b^e_2} & \triangledown{b^e_2} \triangledown{b^e_3} & \triangledown{b^e_2}\triangledown{b^e_4}      \\ & &  \triangledown{b^e_3} \triangledown{b^e_3} & \triangledown{b^e_3} \triangledown{b^e_4}      \\ symetry & &   & \triangledown{b^e_4} \triangledown{b^e_4} \end{bmatrix}

\begin{bmatrix} 1 & 0 & 0 & 0      \\ 0 & 1 &  0 & 0      \\ 0 & 0 &  1 & 0      \\ 0 & 0 &  0 & 1      \end{bmatrix}

\left ( d \frac{1}{2} (x_2^e - x_1^e)*\frac{1}{2} (y_4^e - y_1^e) d \omega_\xi \right ) \ $$

note, to save some space in typing the formula (else it stretched out of the page), the independent variables for $$ b_i^e (\xi, \eta) \ $$ were avoided

for the initial square of length of '1', we divided into 4 smaller squares each 0.5 length, the element nodes stiffness matrix came out to be:

K(:,:,1) = [ 1/24, -1/96, -1/48, -1/96] [ -1/96,  1/24, -1/96, -1/48] [ -1/48, -1/96,  1/24, -1/96] [ -1/96, -1/48, -1/96,  1/24] K(:,:,2) = [ 1/24, -1/96, -1/48, -1/96] [ -1/96,  1/24, -1/96, -1/48] [ -1/48, -1/96,  1/24, -1/96] [ -1/96, -1/48, -1/96,  1/24]

this answer shows 2 elements stiffness matrices located along 'x' axes. Noting that because of the symmetry of each elements, the equivalent spacing of each node in elements, and because the material matrix $$ \kappa \ $$ is identity matrix, all stiffness element matrices will be the same. The only differ in element stiffness matrix will occur when we will change the number of stiffness.

,where

$$ b^e_1(\xi, \eta) = \frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + [ \frac{1+\xi}{2}- 1 ] x^e_2)(y_1^e \frac{1-\eta}{2} + [ \frac{1+\eta}{2} - 1 ] ) y^e_4) \ $$

$$ b_2^e(\xi, \eta) =  -\frac{1}{A^e}( [\frac{1-\xi}{2}- 1]x^e_1 + x_2^e \frac{1+\xi}{2})(y_1^e \frac{1-\eta}{2} +  [\frac{1+\eta}{2} - 1] y^e_4)  \ $$

$$ b_3^e (\xi, \eta)  =  \frac{1}{A^e}( [\frac{1-\xi}{2}- 1]x^e_1 + x_2^e \frac{1+\xi}{2})([\frac{1-\eta}{2} -1]y^e_1 + y_4^e \frac{1+\eta}{2} ) \ $$

$$  b_4^e (\xi, \eta) =  -\frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + [\frac{1+\xi}{2}- 1]x^e_2)( [\frac{1-\eta}{2}-1]y^e_1 + y_4^e \frac{1+\eta}{2})  \ $$

force
From prof. Vu Quoc's notes for

$$ f^e(w) = - \int_{\Gamma_h} wh d {\Gamma_h} + \int_\omega wf d \omega \ $$

$$ f^e(w) = - \int_{\Gamma_h} wh d {\Gamma_h} + \int_\omega w1 d \omega \ $$

converting to local coordinates

$$ f^e(w) = - \int_{\omega_\xi}

\begin{bmatrix} \triangledown{b^e_1}      \\ \triangledown{b^e_2}    \\ \triangledown{b^e_3}     \\ \triangledown{b^e_4} \end{bmatrix}

2* \left ( \frac{1}{4} A_e \ d\omega_\xi \right ) + \int_{\omega_\xi}

\begin{bmatrix} \triangledown{b^e_1}      \\ \triangledown{b^e_2}    \\ \triangledown{b^e_3}     \\ \triangledown{b^e_4} \end{bmatrix}

\left( \frac{1}{4} A_e \ d\omega_\xi \right ) =

- \int_{\omega_\xi}

\begin{bmatrix} \triangledown{b^e_1}      \\ \triangledown{b^e_2}    \\ \triangledown{b^e_3}     \\ \triangledown{b^e_4} \end{bmatrix}

\left( \frac{1}{4} A_e \ d\omega_\xi \right ) \ $$

F(:,:,1) = [ 1/16,  1/16] [ -1/16,  1/16] [ -1/16, -1/16] [  1/16, -1/16] F(:,:,2) = [ 1/16,  1/16] [ -1/16,  1/16] [ -1/16, -1/16] [  1/16, -1/16]

Global Matrix creation
Then we constructed the Global stiffness matrix by the process of superimposing the local stiffness coefficients. Matlab output below shows the process of superimposing the elements to global stiffness matrix.

The matlab code for global matrix construction was written with respect to this element naming system, and then it was extended to encompass other numbers of elements



Original element matrices

K(:,:,1) = [ 1/24, -1/96, -1/48, -1/96] [ -1/96,  1/24, -1/96, -1/48] [ -1/48, -1/96,  1/24, -1/96] [ -1/96, -1/48, -1/96,  1/24]

K(:,:,2) = [ 1/24, -1/96, -1/48, -1/96] [ -1/96,  1/24, -1/96, -1/48] [ -1/48, -1/96,  1/24, -1/96] [ -1/96, -1/48, -1/96,  1/24] Superpositions to global matrix

KGlobal = 1/24         -1/96           0             -1/96          -1/48           0              0              0              0             -1/96           1/12          -1/96          -1/48          -1/48          -1/48           0              0              0              0             -1/96           1/24           0             -1/48          -1/96           0              0              0             -1/96          -1/48           0              1/12          -1/48           0             -1/96          -1/48           0             -1/48          -1/48          -1/48          -1/48           1/6           -1/48          -1/48          -1/48          -1/48           0             -1/48          -1/96           0             -1/48           1/12           0             -1/48          -1/96           0              0              0             -1/96          -1/48           0              1/24          -1/96           0              0              0              0             -1/48          -1/48          -1/48          -1/96           1/12          -1/96           0              0              0              0             -1/48          -1/96           0             -1/96           1/24

FGlobal = 1/8           0             -1/8            1/4            0             -1/4            1/8            0             -1/8

Boundary Conditions
Noting that essential BCs were specified to be on all sides of the 2x2 square. It would mean (viewing from the above global node figure) all nodes around node 5 will be tagged as essential BC.



Since we can either eliminate the nodes form Global Stiffness matrix to construct another one with Temperature ('u' function) as unknown or just '0' the node values in Global Stiffness matrix and then do inverse and multiply by Force matrix to find other non-constrained dofs.

We wrote a matlab code that automatically constrains the associate nodes and puts their contribution to force function.

Here how code applies BC's

KGlobal = 1/24         -1/96           0             -1/96          -1/48           0              0              0              0             -1/96           1/12          -1/96          -1/48          -1/48          -1/48           0              0              0              0             -1/96           1/24           0             -1/48          -1/96           0              0              0             -1/96          -1/48           0              1/12          -1/48           0             -1/96          -1/48           0             -1/48          -1/48          -1/48          -1/48           1/6           -1/48          -1/48          -1/48          -1/48           0             -1/48          -1/96           0             -1/48           1/12           0             -1/48          -1/96           0              0              0             -1/96          -1/48           0              1/24          -1/96           0              0              0              0             -1/48          -1/48          -1/48          -1/96           1/12          -1/96           0              0              0              0             -1/48          -1/96           0             -1/96           1/24

Kchange = 0             0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              1/6            0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0              0

FGlobal = -1/16          0              1/16          -1/8            0              1/8           -1/16           0              1/16

Fchange = -7/48         -7/48           0             -1/6            1/3            1/12          -7/48          -7/48           0

Then the matrices were reduced to the ones of the importance ( Global K matrix after the BCs where applied was isolated so no 0s would be present and attributing F function value(s) where picked by code as well)

KchangeF = 1/6

FchangeF = 1/3

Finally Temperature at unknown nodes was found by using this formula

$$ u = K^{-1}F \ $$

u = 2

Also output for 4x4 element free node values came out to be:

dcalc = 2             2              2              2

as you may see, only 1 node, in this example was present, so only 1 numerical value was generated.



Discussion
Note 1 important aspect of this output. That is, with forcing function changed to 1, the output of free degrees of freedom is still '2' as if no forcing function was present to begin with. I guess it might be explainable that because of constrained boundary conditions at all 4 ends, in order to keep the temperature constant at all 4 ends while heat was generated, the generated heat had to be instantaneously dissipated though the boundaries of the area, so that boundary temperature would stay unchanged.

As in matrix/numeral explanation, it should be noted, that because essential boundary condition is applied over all 4 sides, it has integration limits (working boundary range) as all element boundary. Therefore, with intorduction with heat source, force instead of being modified, was only scaled (remember force equation):

for f = 0 (HW 6.6)

$$ f^e(w) = - \int_{\omega_\xi}

\begin{bmatrix} \triangledown{b^e_1}      \\ \triangledown{b^e_2}    \\ \triangledown{b^e_3}     \\ \triangledown{b^e_4} \end{bmatrix}

2* \left ( \frac{1}{4} A_e \ d\omega_\xi \right ) \ $$

for f= 1 (HW 7.1)

$$ f^e(w) = - \int_{\omega_\xi}

\begin{bmatrix} \triangledown{b^e_1}      \\ \triangledown{b^e_2}    \\ \triangledown{b^e_3}     \\ \triangledown{b^e_4} \end{bmatrix}

2* \left ( \frac{1}{4} A_e \ d\omega_\xi \right ) + \int_{\omega_\xi}

\begin{bmatrix} \triangledown{b^e_1}      \\ \triangledown{b^e_2}    \\ \triangledown{b^e_3}     \\ \triangledown{b^e_4} \end{bmatrix}

\left( \frac{1}{4} A_e \ d\omega_\xi \right ) =

- \int_{\omega_\xi}

\begin{bmatrix} \triangledown{b^e_1}      \\ \triangledown{b^e_2}    \\ \triangledown{b^e_3}     \\ \triangledown{b^e_4} \end{bmatrix}

\left( \frac{1}{4} A_e \ d\omega_\xi \right ) \ $$

you may see that force term is a scale only term. Moreover, notice the force global term

For 4 element at f = 0: FGlobal = 1/8           0             -1/8            1/4        0            -1/4            1/8            0             -1/8

Fchange = 5/24          7/48          -1/16           7/24         -1/3           -5/24           5/24           7/48          -1/16

For 4 element at f = 1:

FGlobal =

-1/16          0              1/16          -1/8            0             1/8           -1/16           0              1/16

Fchange =

-7/48         -7/48           0             -1/6           -1/3            1/12          -7/48          -7/48           0

For 9 element at f = 1

FGlobal =

-1/36          0              0              1/36          -1/18           0        0            1/18          -1/18           0        0            1/18          -1/36           0              0              1/36

Fchange =

-7/108        -7/108         -7/108          0            -11/108         5/54           5/54           1/108         -5/54         5/54           5/54           1/54          -7/108         -7/108         -7/108          0

, where boxed answer shows free nodes.

Note that force matrix DOES differ, but note that because of the similarity of force functions (scalar multiples of each other, namely, caused because forcing function is a constant and essential boundary condition acts on the same area as forcing function), the global force matrix, since it contained '0's on initial force function, will contain '0's on any other force function, as long as forcing function is scalar and essential B.C is the same as whole element B.C. Therefore, with same used stiffness matrix 'K' the adjusted force matrix with initial values of '0' on free nodes, always came out to be the same for specific number of elements with differing scalar value of forcing function.

As a result, for free node displacements, we observed the constant value of '2'.

--Eml5526.s11.team5.JA 20:51, 6 April 2011 (UTC)

2)
a)

In general by Prof. Vu Quoc's

$$ \tilde{m}(w,u) + \tilde{k}(w,u) = \tilde{f}(w,u) \ $$

$$ \tilde{m}(w,u) = \int_\Omega w \rho c \frac{\partial u}{\partial t} d \Omega \ $$

$$ \tilde{k}(w,u) = \int_{\Omega^e} \triangledown{w} \kappa(x, y) \triangledown{u} d \Omega \ $$

$$ \tilde{f}(w) = - \int_{\Gamma_h}w h d \Gamma_h + \int_\Omega w f d \Omega \ $$

$$ K_{ij}^e = \int_{\Omega^e} \triangledown{b^e_i}'(x, y) \kappa(x, y) \triangledown{b^e_j}'(x, y) d \omega_x \ $$

, where $$ x = x^e \ $$, where $$x^e \ $$ represents local node.

For linear 2D case with boundary being square

Bases, $$ b_i \ $$ are defined to be $$ L_{[I,J]} (x, y) = N^e_{[I,J]} (x, y) \ $$

where $$ N^e_{[I,J]}(x, y) = N_I^e(x)N_J^e(y) \ $$ and $$ I, J \ $$ corresponds to numbering of nodes on element scale.



also noting that it's a rectangular shape, such that the distance from x: 1-to-2 = 1-to-3 and node 1 = node 4 in 'x' coordiantes, y: 1-to-4 = 1-to-3 and node 1 = node 2 in 'x' coordinates, we substitute $$ y^e_4 $$ for $$ y^e_3 \ $$ and $$ y^e_1 $$ for $$ y^e_2 \ $$ and the same for other coordinates

$$ N^e_{[1,1]} (x, y) = \frac{x^e-x^e_2}{x^e_1 - x^e_2} \frac{y^e-y^e_4}{y^e_1 - y^e_4} = \frac{1}{A^e}(x-x^e_2)(y - y^e_4) = b_1^e (x,y) \ $$

$$ N^e_{[2,1]} (x, y) = \frac{x^e-x^e_1}{x^e_2 - x^e_1} \frac{y^e-y^e_4}{y^e_1 - y^e_4} = -\frac{1}{A^e}(x-x^e_1)(y - y^e_4) = b_2^e(x,y)\ $$

$$ N^e_{[2,2]} (x, y) = \frac{x^e-x^e_1}{x^e_2 - x^e_1} \frac{y^e-y^e_1}{y^e_4 - y^e_1} = \frac{1}{A^e}(x-x^e_1)(y - y^e_1) = b_3^e (x,y) \ $$

$$ N^e_{[1,2]} (x, y) = \frac{x^e-x^e_2}{x^e_1 - x^e_2} \frac{y^e-y^e_1}{y^e_4 - y^e_1} = -\frac{1}{A^e}(x-x^e_2)(y - y^e_1) = b_4^e (x,y) \ $$

Next we will convert the square element to same size parent element of bi-unit square

$$ x^e = x_1^e N_1^e(\xi) + x_2^e N_2^e(\xi) = x_1^e \frac{1-\xi}{2} + x_2^e \frac{1+\xi}{2}, \xi \in [-1 +1] \ $$

$$ y^e = y_1^e N_1^e(\eta) + y_4^e N_4^e(\eta) = y_1^e \frac{1-\eta}{2} + y_4^e \frac{1+\eta}{2}, \eta \in [-1 +1] \ $$

Then by noting wich side/value of 'x' will be greater in defined rectangular shown

Therefore, we convert element coordinates to parent coordinates

$$ N^e_{[1,1]} (\xi, \eta) = \frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + x_2^e \frac{1+\xi}{2}-x^e_2)(y_1^e \frac{1-\eta}{2} + y_4^e \frac{1+\eta}{2} - y^e_4) \  $$

$$ N^e_{[1,1]} (\xi, \eta) = \frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + [ \frac{1+\xi}{2}- 1 ] x^e_2)(y_1^e \frac{1-\eta}{2} + [ \frac{1+\eta}{2} - 1 ] ) y^e_4)= b^e_1(\xi, \eta) \ $$

$$ N^e_{[2,1]} (x, y) = -\frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + x_2^e \frac{1+\xi}{2} - x^e_1)(y_1^e \frac{1-\eta}{2} + y_4^e \frac{1+\eta}{2} - y^e_4) \ $$

$$ N^e_{[2,1]} (\xi,\eta) =  -\frac{1}{A^e}( [\frac{1-\xi}{2}- 1]x^e_1 + x_2^e \frac{1+\xi}{2})(y_1^e \frac{1-\eta}{2} +  [\frac{1+\eta}{2} - 1] y^e_4) = b_2^e(\xi, \eta)\ $$

$$ N^e_{[2,2]} (\xi, \eta) =  \frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + x_2^e \frac{1+\xi}{2}-x^e_1)(y_1^e \frac{1-\eta}{2} + y_4^e \frac{1+\eta}{2} - y^e_1)  \ $$

$$ N^e_{[2,2]} (\xi, \eta) =  \frac{1}{A^e}( [\frac{1-\xi}{2}- 1]x^e_1 + x_2^e \frac{1+\xi}{2})([\frac{1-\eta}{2} -1]y^e_1 + y_4^e \frac{1+\eta}{2} ) = b_3^e (\xi, \eta) \ $$

$$ N^e_{[1,2]} (\xi, \eta) =  -\frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + x_2^e \frac{1+\xi}{2}-x^e_2)(y_1^e \frac{1-\eta}{2} + y_4^e \frac{1+\eta}{2} - y^e_1) \ $$

$$ N^e_{[1,2]} (\xi, \eta) =  -\frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + [\frac{1+\xi}{2}- 1]x^e_2)( [\frac{1-\eta}{2}-1]y^e_1 + y_4^e \frac{1+\eta}{2}) = b_4^e (\xi, \eta) \ $$

Jacobian Matrix:

$$ \mathbf{J}^e =

\begin{bmatrix} \frac{\partial x}{\partial \xi} &  \frac{\partial y}{\partial \xi}    \\ \\ \frac{\partial x}{\partial \eta} &  \frac{\partial y}{\partial \eta} \end{bmatrix}

$$

taking the $$ x^e \ $$ and $$ y^e \ $$ values from the definition of parent element and substituting into Jacobian matrix we get:

$$ \mathbf{J}^e =

\begin{bmatrix} \frac{\partial x}{\partial \xi} &  \frac{\partial y}{\partial \xi}    \\ \\ \frac{\partial x}{\partial \eta} &  \frac{\partial y}{\partial \eta} \end{bmatrix} =

\begin{bmatrix} \frac{1}{2} (x_2^e - x_1^e) & 0    \\ \\ 0 &  \frac{1}{2} (y_4^e - y_1^e) \end{bmatrix}

$$

From given

$$ d \omega_x = det(\mathbf{J}^e) d \omega_\xi = d \omega_x = \frac{1}{2} (x_2^e - x_1^e)*\frac{1}{2} (y_4^e - y_1^e) d \omega_\xi \ $$

or

$$ d \omega_\xi = \frac{ d \omega_x}{det(\mathbf{J}^e)} = d \omega_\xi = \frac{ d \omega_x}{\frac{1}{2} (x_2^e - x_1^e)*\frac{1}{2} (y_4^e - y_1^e)} $$

With this last information we have a completely defined stiffness element matrix $$ K^e \ $$. Also note that since we have, 4 degrees of freedom in 1 element node, we do expect the gram matrix $$ \Gamma \ $$ to be 4x4, therefore, $$ \kappa_{4x4} \ $$

$$ K_{ij}^e = \int_{\Omega^e} \triangledown{b^e_i}'(x, y) \kappa(x, y) \triangledown{b^e_j}'(x, y) d \omega_x \ $$

$$ K_{ij}^e = \int_{-1}^{+1}

\begin{bmatrix} \triangledown{b^e_1} \triangledown{b^e_1} & \triangledown{b^e_1} \triangledown{b^e_2} & \triangledown{b^e_1} \triangledown{b^e_3} & \triangledown{b^e_1} \triangledown{b^e_4}      \\ & \triangledown{b^e_2} \triangledown{b^e_2} & \triangledown{b^e_2} \triangledown{b^e_3} & \triangledown{b^e_2}\triangledown{b^e_4}      \\ & &  \triangledown{b^e_3} \triangledown{b^e_3} & \triangledown{b^e_3} \triangledown{b^e_4}      \\ symetry & &   & \triangledown{b^e_4} \triangledown{b^e_4} \end{bmatrix}

\begin{bmatrix} 1 & 0 & 0 & 0      \\ 0 & 1 &  0 & 0      \\ 0 & 0 &  1 & 0      \\ 0 & 0 &  0 & 1      \end{bmatrix}

\left ( d \frac{1}{2} (x_2^e - x_1^e)*\frac{1}{2} (y_4^e - y_1^e) d \omega_\xi \right ) \ $$

note, to save some space in typing the formula (else it stretched out of the page), the independent variables for $$ b_i^e (\xi, \eta) \ $$ were avoided

for the initial square of length of '1', we divided into 4 smaller squares each 0.5 length, the element nodes stiffness matrix came out to be:

K(:,:,1) = [ 1/24, -1/96, -1/48, -1/96] [ -1/96,  1/24, -1/96, -1/48] [ -1/48, -1/96,  1/24, -1/96] [ -1/96, -1/48, -1/96,  1/24] K(:,:,2) = [ 1/24, -1/96, -1/48, -1/96] [ -1/96,  1/24, -1/96, -1/48] [ -1/48, -1/96,  1/24, -1/96] [ -1/96, -1/48, -1/96,  1/24]

this answer shows 2 elements stiffness matrices located along 'x' axes. Noting that because of the symmetry of each elements, the equivalent spacing of each node in elements, and because the material matrix $$ \kappa \ $$ is identity matrix, all stiffness element matrices will be the same. The only differ in element stiffness matrix will occur when we will change the number of stiffness.

,where

$$ b^e_1(\xi, \eta) = \frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + [ \frac{1+\xi}{2}- 1 ] x^e_2)(y_1^e \frac{1-\eta}{2} + [ \frac{1+\eta}{2} - 1 ] ) y^e_4) \ $$

$$ b_2^e(\xi, \eta) =  -\frac{1}{A^e}( [\frac{1-\xi}{2}- 1]x^e_1 + x_2^e \frac{1+\xi}{2})(y_1^e \frac{1-\eta}{2} +  [\frac{1+\eta}{2} - 1] y^e_4)  \ $$

$$ b_3^e (\xi, \eta)  =  \frac{1}{A^e}( [\frac{1-\xi}{2}- 1]x^e_1 + x_2^e \frac{1+\xi}{2})([\frac{1-\eta}{2} -1]y^e_1 + y_4^e \frac{1+\eta}{2} ) \ $$

$$  b_4^e (\xi, \eta) =  -\frac{1}{A^e}(x_1^e \frac{1-\xi}{2} + [\frac{1+\xi}{2}- 1]x^e_2)( [\frac{1-\eta}{2}-1]y^e_1 + y_4^e \frac{1+\eta}{2})  \ $$

force
From prof. Vu Quoc's notes for

$$ f^e(w) = - \int_{\Gamma_h} wh d {\Gamma_h} + \int_\omega wf d \omega \ $$

$$ f^e(w) = - \int_{\Gamma_h} wh d {\Gamma_h} + \int_\omega w0 d \omega = - \int_{\Gamma_h} wh d {\Gamma_h} \ $$

converting to local coordinates

$$ f^e(w) = - \int_{\omega_\xi}

\begin{bmatrix} \triangledown{b^e_1}      \\ \triangledown{b^e_2}    \\ \triangledown{b^e_3}     \\ \triangledown{b^e_4} \end{bmatrix}

2* \left ( \frac{1}{4} A_e \ d\omega_\xi \right ) \ $$

F(:,:,1) = [ 1/16,  1/16] [ -1/16,  1/16] [ -1/16, -1/16] [  1/16, -1/16] F(:,:,2) = [ 1/16,  1/16] [ -1/16,  1/16] [ -1/16, -1/16] [  1/16, -1/16]

Transient Term
$$ \tilde{m}(w,u) = \int_\Omega w \rho c \frac{\partial u}{\partial t} d \Omega = \int_\Omega w xy \frac{\partial u}{\partial t} d \Omega =

\int_{\omega_\xi}

\begin{bmatrix} \triangledown{b^e_1}      \\ \triangledown{b^e_2}    \\ \triangledown{b^e_3}     \\ \triangledown{b^e_4} \end{bmatrix}

\left( x_1^e \frac{1-\xi}{2} + x_2^e \frac{1+\xi}{2} \right ) \left( y_1^e \frac{1-\eta}{2} + y_4^e \frac{1+\eta}{2} \right ) \frac{\partial u}{\partial t} \left( \frac{1}{4} A_e \ d\omega_\xi \right ) \ $$

Overall Equation
$$ \int_{\omega_\xi}

\begin{bmatrix} \triangledown{b^e_1}      \\ \triangledown{b^e_2}    \\ \triangledown{b^e_3}     \\ \triangledown{b^e_4} \end{bmatrix}

\left( x_1^e \frac{1-\xi}{2} + x_2^e \frac{1+\xi}{2} \right ) \left( y_1^e \frac{1-\eta}{2} + y_4^e \frac{1+\eta}{2} \right ) \frac{\partial u}{\partial t} \left( \frac{1}{4} A_e \ d\omega_\xi \right ) + \int_{\omega_\xi}

\begin{bmatrix} \triangledown{b^e_1} \triangledown{b^e_1} & \triangledown{b^e_1} \triangledown{b^e_2} & \triangledown{b^e_1} \triangledown{b^e_3} & \triangledown{b^e_1} \triangledown{b^e_4}      \\ & \triangledown{b^e_2} \triangledown{b^e_2} & \triangledown{b^e_2} \triangledown{b^e_3} & \triangledown{b^e_2}\triangledown{b^e_4}      \\ & &  \triangledown{b^e_3} \triangledown{b^e_3} & \triangledown{b^e_3} \triangledown{b^e_4}      \\ symetry & &   & \triangledown{b^e_4} \triangledown{b^e_4} \end{bmatrix}

\begin{bmatrix} 1 & 0 & 0 & 0      \\ 0 & 1 &  0 & 0      \\ 0 & 0 &  1 & 0      \\ 0 & 0 &  0 & 1      \end{bmatrix}

\left ( d \frac{1}{2} (x_2^e - x_1^e)*\frac{1}{2} (y_4^e - y_1^e) d \omega_\xi \right ) = - \int_{\omega_\xi}

\begin{bmatrix} \triangledown{b^e_1}      \\ \triangledown{b^e_2}    \\ \triangledown{b^e_3}     \\ \triangledown{b^e_4} \end{bmatrix}

2* \left ( \frac{1}{4} A_e \ d\omega_\xi \right ) \ $$