wrupp / nonlinearfem Goto Github PK
View Code? Open in Web Editor NEWNon-Linear implementation of the Finite Element Method
License: GNU General Public License v3.0
Non-Linear implementation of the Finite Element Method
License: GNU General Public License v3.0
Hi,
I would like to see a Matlab code for the Dirichlet boundary condition of the evolution of the two-dimensional heat
equation by finite element method, For example
U_t - div(U)=f(x,y,t) in [0,L][0,L][0,T]
u(.,.,t)= g(.,.,t)=exp(-t)sin(pix)sin(piy) in the boundary [0,T]
U(x,y,0)=Uo [0,L][0,L]
i have code of the generate a triangular grid (mesh) and the assembly of global mass, stiffness matrices and load vector
but the dirichlet boundary conditions according to g and domain [0,L]*[0,L], It's not work in Matlab!
See what i did :
`
[M,A,b]=assembly(p,e,.....);
np=size(p,2);
x=p(1,:)'; y=p(1,:)';
bndry=unique([e(1,:) e(2,:)]);
IN= setdiff([1:np])
T=1; %final time
L=21;
dt=T/L-1;
U_fem=zeros(np,L);
for k=1:L
t(k)= (k-1)*dt;
b=b(IN)-A(IN,bndry)*g(x,y,t(k));
A=A(IN,IN);
M=M(IN,IN);
% solve for FEM solution U_fem
U_fem(:,1)=sin(pi*x).*sin(pi*y); % initial condition
U_fem(bndry,k)= exp(t(k)).*sin(pi*x).*sin(pi*y); % or =g(x,y,t(k);
U_fem(IN,k+1)= (M+dt*A)/(M*U_fem(IN,k) + dt*b);
end
figure()
pdesurf(p,t,U_fem(:,L))
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.