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

4 visualizzazioni (ultimi 30 giorni)
Sattik Basu
Sattik Basu il 12 Mag 2022
Risposto: Avni Agrawal il 5 Ott 2023
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?

Risposte (1)

Avni Agrawal
Avni Agrawal il 5 Ott 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