pde toolbox: how to integrate the solution only over a subdomain?
Show older comments
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
Answers (1)
Alan Weiss
on 28 Nov 2016
0 votes
Depending on your MATLAB version, you can interpolate the solution to any point you give using interpolateSolution or pdeInterpolant.
Alan Weiss
MATLAB mathematical toolbox documentation
1 Comment
Lalson Vincent
on 3 Jun 2020
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.
Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!