pde toolbox: how to integrate the solution only over a subdomain?

Dear all!
I am solving the diffusion equation on a stacked geometry (rectangles on top of each other each with a different set of parameters); now I want to integrate the time-dependent solution (e.g. a particle density as function of time) in the lowest rectangle only. Can someone help me to understand how to integrate a solution that loves on [0 1 1 0] [0 0 5 5] only on the subdomain [0 1 1 0] [ 0 0 2 2]? I know that all sub-domains have their own label (face) and boundaries have edges but I am not sure how to access the solution on either of these?
Thank you in advance for your assistance (and wisdom...)!
Chris

Respuestas (1)

Alan Weiss
Alan Weiss el 28 de Nov. de 2016
Depending on your MATLAB version, you can interpolate the solution to any point you give using interpolateSolution or pdeInterpolant.
From there you can use any MATLAB integration function, such as integral2.
Alan Weiss
MATLAB mathematical toolbox documentation

1 comentario

could you please eloborate on how to do this ? tried doing this with the below code.
fun = @(x,y,z) interpolateSolution(results,x,y,z)
q = integral3(fun,0,10,0,10,0,10)
but got the below error
Error using integral2Calc>integral2t/tensor (line 241)
Integrand output size does not match the input size.

Iniciar sesión para comentar.

Productos

Preguntada:

el 28 de Nov. de 2016

Comentada:

el 3 de Jun. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by