필터 지우기
필터 지우기

Non-constant Numerical coefficients (m,d,a,c,f)

조회 수: 2 (최근 30일)
Sattik Basu
Sattik Basu 2022년 5월 12일
답변: Avni Agrawal 2023년 10월 5일
The pdetoolbox is equipped to solve a PDE with non-constant coefficients. However, from what i read in the manuals, the coefficients need to be a function of location (x,y) or state (u,ux,uy,t). However, if I know the coefficient distribution across the entire geometry (ie, i have a matrix of for a rectangular domain), how can I input them as coefficients to the toolbox?
  댓글 수: 2
Prakhar Sharma
Prakhar Sharma 2022년 6월 14일
I have the same question
Torsten
Torsten 2022년 6월 14일
As a function handle:
f = @(x,y) interp2(X,Y,Coefficient,x,y)

댓글을 달려면 로그인하십시오.

답변 (1개)

Avni Agrawal
Avni Agrawal 2023년 10월 5일
I understand that you are trying to find how to pass input arguments to function handle for non-constant numerical co-efficients.
The function must accept two input arguments, location and state. The solvers automatically compute and populate the data in the location and state structure arrays and pass this data to your function. Specify the PDE coefficients using the function you wrote.
This can be understood by the following example :
specifyCoefficients(model,"m",0,"d",0,"c",1,"a",0,"f",@fcoefffunc);
function fcoeff = fcoefffunc(location,state)
fcoeff = location.x.^2.*sin(location.y);
scatter(location.x,location.y,".","black");
hold on
end
Please refer to the following documentations to learn more about non-const numerical co-efficients:
I Hope this helps.

카테고리

Help CenterFile Exchange에서 Geometry and Mesh에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by