Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
Sattik Basu
Sattik Basu le 12 Mai 2022
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 commentaires
Prakhar Sharma
Prakhar Sharma le 14 Juin 2022
I have the same question
Torsten
Torsten le 14 Juin 2022
As a function handle:
f = @(x,y) interp2(X,Y,Coefficient,x,y)

Connectez-vous pour commenter.

Réponses (1)

Avni Agrawal
Avni Agrawal le 5 Oct 2023
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.

Community Treasure Hunt

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

Start Hunting!

Translated by