Non-constant Numerical coefficients (m,d,a,c,f)
1 回表示 (過去 30 日間)
古いコメントを表示
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?
回答 (1 件)
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.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!