Solving elliptic pde for G and Q components with different b.c.s

1 view (last 30 days)

Please refer to the matlab documentation on elliptic pdes. https://www.mathworks.com/help/pde/ug/elliptic-pdes.html

So, I am ONLY trying to solve the components Q and G for multiple finite segments on the boundary.

$Q(i,j) = \int_{El} \phi_i \phi_j dS$ and $G(i) = \int_{El} \phi_i dS$,

where El, l = 1,...,N is some finite arc length of an object... say, .005m.... that occurs N times along the boundary.

How do I properly specify the boundary conditions matrices g and q? I attached an image of problem I am describing. The stars indicate the nodes I have to integrate over.

Here is what I know. We solve for G (and Q similarly by referring to the assemb function) as G = G + sparse(e(1,:),g,nodes,1); G = G + sparse(e(2,:),g,nodes,1), where it calculates the surface area between two nodes and {g = |P1-P2|/2 on El OR 0 off El, l=1,...,N} for all nodes on the boundary.

However, for nodes with indices n1,n2, do I need to find x1_n1 = find(e(1,:)==n1) and x2_n1 = find(e(2,:)==n1) => g(x1_n1) = 1 and g(x2_n1) = 1 AND x1_n2 = find(e(1,:)==n2) and x2_n2 = find(e(2,:)==n2) => g(x1_n2) = 1 and g(x2_n2) = 1?

I cannot figure out how to properly form the boundary conditions matrices for g and q because e(1,:) covers all the nodes on the boundary and so does e(2,:). Do I set g to its nnz value where e(1,x1*),e(2,x2*)=n1, etc.?

If anyone knows another simpler way to solve Q and G, please let me know as well! Please message me if you have further questions. I need help desperately because I have been stuck on this problem for a long time.

Thank you for the help!

Answers (0)

Community Treasure Hunt

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

Start Hunting!