1 / 6

Solving Variable Coefficients BVP Problem with Weak Formulation

Learn to solve a boundary value problem with variable coefficients using weak formulation in the language of functions and gradients. Find primary stiffness matrix, integrate equations, and handle cyclic permutations efficiently.

Download Presentation

Solving Variable Coefficients BVP Problem with Weak Formulation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Problem with Variable Coefficients BVP Remark: is a function If k is a constant then this problem reduces to the one we solved before. Weak Formulation ( variational formulation) Multiply equation (1) by and then integrate over the domain Green’s theorem gives where

  2. Problem with Variable Coefficients For k = 1 : 16 Step1a: find all gradients Step1b: Find 9 integrals Step1c: Add these contributions to the primary stiffness matrix End the loop

  3. Find the gradients with cyclic permutation of the index i,j k over 1,2,3 function [area,b,c] = Gradients(x,y) area=polyarea(x,y); b=[y(2)-y(3); y(3)-y(1); y(1)-y(2)]/2/area; c=[x(3)-x(2); x(1)-x(3); x(2)-x(1)]/2/area;

  4. Step1 primary stiffnes matrix Loop over all triangles 1 -16 for example K9 10 5 13

  5. Problem with Variable Coefficients Find 3x3 matrix Loop over all triangles 1 -16. for example K9 10 5 13 1 Find gradient for each

  6. Problem with Variable Coefficients 10 Find gradient for each Loop over all triangles 1 -16. for example K9 5 13 1 2 3 4 5 6 7 8 9 10 11 12 function A = StiffMat2D(p,t) np = size(p,2); nt = size(t,2); A = sparse(np,np); for K = 1:nt loc2glb = t(1:3,K); % local-to-global map x = p(1,loc2glb); % node x-coordinates y = p(2,loc2glb); % node y- [area,b,c] = Gradients(x,y); AK = (b*b'+c*c')*area; % element stiff mat A(loc2glb,loc2glb) = A(loc2glb,loc2glb)+ AK; % add element stiffnesses to A end xc = mean(x); yc = mean(y); kc = k(xc,yc);

More Related