How to construct the coefficient matrix(Pentagonal matrix) of five-point difference scheme?

12 ビュー (過去 30 日間)
I want to solve an elliptic partial differential equation.
Step 1: I've the five difference scheme for this equation as follows
.
Then this scheme ends up with a linear system
, where A is a coefficient matrix.
Step 2: Construct A matrix with Matlab.
The matrix has the following form
So, how to construct the pentagonal matrix? I do not know how to write elements in pentagonal form, please give me some advice.
  10 件のコメント
darova
darova 2020 年 4 月 9 日
i can't handle it
anji yang
anji yang 2020 年 4 月 9 日
That's all right, thanks

サインインしてコメントする。

採用された回答

John D'Errico
John D'Errico 2020 年 4 月 8 日
Ok. I'll give you a hint. Constructing a pentagonal matrix STARTS with the function spdiags. A real virtue of spdiags is you will end up with a sparse pentagonal matrix, which really is what you want when you are solving problems of that class anyway.
So do some serious reading in the help for spdiags. Try out the examples. Try out a few of your own. It is easier than it looks.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by