Set Neumann Boundary Conditions to PDEModel
10 ビュー (過去 30 日間)
古いコメントを表示
Hello, I want to solve the Laplace equation on a 2-D rectangular grid. I'm using the "applyBoundaryCondition" function to determine the boundaries.
On one side I have a constant Dirichlet boundary, applyBoundaryCondition(model,'Edge',3,'u',v);, and on the other two sides I have constant Neumann boundaries, applyBoundaryCondition(model,'Edge',[1,4],'q',0,'g',0);.
On the fourth side I want to use a Neumann boundary but instead of g=constant I have a vector that represents the value at each boundary point applyBoundaryCondition(model,'Edge',[1,4],'q',0,'g',[1:100]);. Is it possible to define 'g' as a vector like this and if not how can I do it?
0 件のコメント
採用された回答
Alan Weiss
2015 年 8 月 24 日
For your case, you probably need to interpolate the g value as a function of x or y in order that the boundary condition is defined everywhere. You can use interp1 or any other interpolation method you like.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
5 件のコメント
Alan Weiss
2015 年 8 月 27 日
Oh, I didn't realize that you were using the PDE app. I don't think that the PDE app uses functions in this syntax. Instead, I think that it uses functions in a syntax described here.
IMHO, it is much easier to use command-line functions with a PDEModel object.
Alan Weiss
MATLAB mathematical toolbox documentation
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で General PDEs についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!