How to apply the boundary conditons to the mass and stiffness matrices?

조회 수: 11 (최근 30일)
I'm using the Partial Differential equation toolbox for getting the mass and stiffness matrices of a cube and liked to apply boundary conditions on the faces. My code looks like that:
gm = multicuboid(2,2,2);
model = createpde;
model.Geometry = gm;
specifyCoefficients(model,'m',0,'d',1,'c',1,'a',0,'f',1);
applyBoundaryCondition(model,'dirichlet','Face',1:6,'u',0);
mesh = generateMesh(model,'GeometricOrder','linear', ...
'Hmax', 2^-2);
FEM = asembleFEMatricess(model);
M = FEM.M; K = FEM.K;
How can I apply the boundary conditions to the matrices M and K. I know, that FEM also contains the matrices
FEM =
struct with fields:
K: [919×919 double]
A: [919×919 double]
F: [919×1 double]
Q: [919×919 double]
G: [919×1 double]
H: [452×919 double]
R: [452×1 double]
M: [919×919 double]
where G,H,R,M store some sort of information about the boundary conditions, but I'm not sure how to combine that with M and K. I'm also not sure if which matrices the 'nullspace' options returns.
PS: I need the matrices for solving the heat equation with a space-time-method, that is why a don't use the solve option from the model.
PPS: This should also work for quadratic meshs, thats why I can't just delete rows and columns.
  댓글 수: 6
Sravan Kumar Putta
Sravan Kumar Putta 2021년 2월 25일
I am in extreme need of help dear, can u pls look into this problem
https://in.mathworks.com/matlabcentral/answers/755649-how-to-solve-semi-discretized-pde-matrices-with-a-time-derivative-in-pde-tool-box-using-ode-solvers?s_tid=srchtitle
Sravan Kumar Putta
Sravan Kumar Putta 2021년 2월 25일
did you use nullspace or stiff-spring to impose the boundary condition?

댓글을 달려면 로그인하십시오.

채택된 답변

Ravi Kumar
Ravi Kumar 2019년 6월 18일
Use the 'nullspace' as second argument, you will get matrices with BC imposed by eleminating dirichlet DoFs.
Regards,
Ravi
  댓글 수: 3
Ravi Kumar
Ravi Kumar 2019년 6월 19일
You have found the right way, B*u should expand u to full size.
Sravan Kumar Putta
Sravan Kumar Putta 2021년 2월 25일
Once you got matrices from nullspace or stiff-spring, How did you solve it using space - time method ? If you have used ODE solvers then how did you frame the ode function?
Can any one explain me?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 General PDEs에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by