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

1 回表示 (過去 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.

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by