FEM1
this is the main routine for solving ODE BVPs using any combination of Dirichlet, Neumann or Robin conditions
GENMAT1
called by FEM1 and is the core of the program. It generates the
matrices used for solving the linear equation system for the ODE
REFINE1
with this routine you can refine the mesh over certain critical grid
points. The the gridpoints will become non-uniformly linearly spaced
TEST1
this is a test for the 1D case of FEM. Look through this example carefully in order to fully understand how FEM1 works
FEM2.mat
contains examples over meshes/triangulations in 2D
PLOTGRID2
plot mesh/triangulation in 2D and put a number in each corresponding element/triangle
QUADSPACE
generates quadratically spaced vectors. That is, the spaces are linearly decreasing/increasing
FEM2
this is the main routine for solving PDE BVPs using any combination of Dirichlet, Neumann or Robin conditions
GENMAT2
called by FEM2 and is the core of the program. It generates the
matrices used for solving the linear equation system for the PDE
TEST2
test for the 2D case of FEM. Test this for better learning how to use FEM2 and other utilities
همچنین در این مجموعه، شش مثال و پروژه یصورت کامل و شبیه سازی شده قرار داده شده است. مانند:
1- برخورد یک موج به یک صفحه شیشه ای در خلا (مشخصات صفحه:conductivity %sigma=.02 mho/m و relative permittivity of e_r=2.5)
2- مثال الکترواستاتیک
3- کار با Handle Graphics در متلب
کد نوشته شده جهت حل مثال شماره 1 بصورت زیر می باشد:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | %This is an electrostatic example. It is a resistive element %with a potential at the bottom equal to V=0 and at the top %the electric potential is V=10. There is no net electric field %towards the other sides of the square plate. % ************** % http://EngPedia.ir % Iranian Engineering Encyclopedia % ************************** N=10; %generate grid xn=linspace(0,1,N); [X,Y]=meshgrid(xn); nod2xy=[X(:) Y(:)]; %generate triangulation/mesh el2nod=delaunay(X(:),Y(:)); %find boundary nodes geom.a=find(nod2xy(:,2)==0); %lower boundary geom.b=find(nod2xy(:,1)==1); %right boundary geom.c=find(nod2xy(:,2)==1); %upper boundary geom.d=find(nod2xy(:,1)==0); %left boundary geom.b=setdiff(geom.b,[geom.a;geom.c]); geom.d=setdiff(geom.d,[geom.a;geom.c]); %drawing mesh and gridpoints plotgrid2(nod2xy,el2nod) %plotting boundary nodes figure hold on plot(nod2xy(geom.a,1),nod2xy(geom.a,2),'.-b') plot(nod2xy(geom.b,1),nod2xy(geom.b,2),'.-r') plot(nod2xy(geom.c,1),nod2xy(geom.c,2),'.-b') plot(nod2xy(geom.d,1),nod2xy(geom.d,2),'.-r') legend('Dirichlet','Neumann',0) %generate boundary conditions bd={}; bd{1}=[geom.a zeros(N,1)]; %lower boundary (Dirichlet) bd{2}=[geom.b zeros(N-2,2)]; %right boundary (Neumann) bd{3}=[geom.c 10*ones(N,1)]; %upper boundary (Dirichlet) bd{4}=[geom.d zeros(N-2,2)]; %left boundary (Neumann) %set PDE parameter values alpha=ones(size(nod2xy,1),1); beta=zeros(size(nod2xy,1),1); s=ones(size(nod2xy,1),1); u=fem2(nod2xy,el2nod,alpha,beta,s,bd); %plot solution as points figure plot3(nod2xy(:,1),nod2xy(:,2),u,'.') rotate3d %plot solution as a surface [u x y c]=fem2(nod2xy,el2nod,alpha,beta,s,bd); figure fill3(x,y,u,c) shading flat colormap summer rotate3d |
همچنین در ادامه یک ایبوک با نام Programing the Finite Element Method with MATLAB جهت دانلود قرار گرفته است. این ایبوک در 45 صفحه تنظیم شده است که به بیان اصول FEM در زبان متلب می پردازد و به چند مثال همراه با کدها اشاره می کند.
دانلود ایبوک Programing the Finite Element Method with MATLAB
برچسبها: دانلود پروژه FEM در MATLAB, lمتلب, پروژه, اجزاء محدود

