How to express a matrix in terms of matrices and how to integrate a matrix using dblquad and summing

3 Ansichten (letzte 30 Tage)
For example, I used bi-linear square finite elements and assuming
A = the finite element solution matrix ( 9x9),
u(x,y) = x.*(1-exp(y-1))/(1-exp(-2)), be the exact solution of the given equation.
D = [-1,1] x [-1,1], be the square domain and h=0.25(size of element length).
What I want to do is 1) to have an element-based description of A (not a nodal based one),
which means A has 64 small matrices (2x2)
2) computing the square of the difference in the gradients within an element and then integrating over each element of the grid (using dblquad) and summing.
I have tried the following way:
Let A11= [ -1.0000 -0.7500 ; -1.0000 -0.7503],
be the first 2x2 matrix of the finite element solution matrix(A).
Let [A11 x, A11y] = gradient(A11,0.25,0.25)
be gradient of the 2x2 matrix.
Let the gradient of the exact solution u be
grad1 = diff(u(x,y),x)
grad2 = diff(u(x,y),y)
gradu = simplify([grad1;grad2])
Therefore, we have
z = (grad1 - A11x) ^ 2 + (grad2 - A11y) ^ 2
which is for one element.
Then I use the dblquad integration to find the integration of z i.e.,
Q = dblquad(@(x,y) z, xmin, xmax, ymin, ymax, tol)
but error occurred. I don't know what to do next.
Please show me how to express the matrix ,A, in terms of 2x2 matrices and integrating ‘z’ over each element of the grid (using dblquad) and then summing all 64 integrations.
Thank you for everything !

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by