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

5 次查看(过去 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

请先登录,再进行评论。

采纳的回答

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 个评论
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 个)

Community Treasure Hunt

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

Start Hunting!

Translated by