フィルターのクリア

Applying Neumann boundary conditions to a system

17 ビュー (過去 30 日間)
John Bach
John Bach 2023 年 3 月 2 日
回答済み: Abhijeet 2023 年 3 月 6 日
Hi there,
My system comprises a 2D rectangular plate of legnth 1 unit and width 2 units. I am currently trying to apply Neumann boundary conditions to this system.
So far, I have formed a discrete Laplaican using the delsq function and now want to impose Neumann boundary conditions at all sides of the plane although I am struggling to work out how I can do this.
Any suggestions as to how I could go about doing this would be greatly appreciated.
Best regards,

採用された回答

Abhijeet
Abhijeet 2023 年 3 月 6 日
Hi,
To impose Neumann boundary conditions, modify the Laplacian matrix to account for the boundary conditions. The Laplacian matrix is formed using the delsq function, which discretizes the Laplacian operator.
To impose Neumann boundary conditions, modify the Laplacian matrix by adjusting the rows and columns corresponding to the boundary nodes. Here is some sample code that demonstrates how to modify the Laplacian matrix to impose Neumann boundary conditions on a rectangular plate with a length of 1 unit and a width of 2 units:
% Let nx be the number of grid points in x direction
% Lap be the Laplacian Matrix formed by the delsq function
% Modify the Laplacian matrix to impose Neumann boundary conditions on all sides of the plate
for i = 1:nx
% Modify the top and bottom rows
Lap(i,:) = Lap(i,:) - Lap(i,1);
Lap(i,:) = Lap(i,:) - Lap(i,end);
% Modify the left and right columns
Lap(:,i) = Lap(:,i) - Lap(1,i);
Lap(:,i) = Lap(:,i) - Lap(end,i);
end
Thanks

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by