Clear Filters
Clear Filters

Applying Neumann boundary conditions to a system

17 views (last 30 days)
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,

Accepted Answer

Abhijeet
Abhijeet on 6 Mar 2023
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

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!