Sequence of linear sistem

1 回表示 (過去 30 日間)
Eduardo Fornazieri
Eduardo Fornazieri 2021 年 5 月 26 日
Hi guys!
I'm working on to solve a PDE by Euler's method, the implicit one. I have a matrix A, which is fixed and I also have a vector of constants. I know that's pretty easy to solve it using the function linsolve. The problem is that the solution of the first linear sistem will be the verctor of contants for the second linear sistem with the same matriz A and so go on...
for exemple:
Given A and b the first linear sistem will be AX_1=b
the second AX_2=X_1
the third AX_3=X_2
How can I write this algorithm?

採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 5 月 26 日
Hi,
you can solve this exercise in a relatively simple way:
A = ..
b = ..
x(:,1) = linsolve(A, b);
for ii = 2:N
x(:,ii) = linsolve(A, x(:,ii-1));
end
  2 件のコメント
Eduardo Fornazieri
Eduardo Fornazieri 2021 年 5 月 26 日
Thank you so much! that's all that I needed.
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 5 月 26 日
Most welcome!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBoundary Conditions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by