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

7 ビュー (過去 30 日間)
Julian Henning
Julian Henning 2019 年 6 月 18 日
コメント済み: Sravan Kumar Putta 2021 年 2 月 25 日
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 件)

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by