How to integrate over the entire bounds of a solution to a PDE at a given time step using PDEPE
    4 views (last 30 days)
  
       Show older comments
    
    Joshua Ferrigno
 on 14 Feb 2023
  
    
    
    
    
    Commented: Joshua Ferrigno
 on 15 Feb 2023
            I have a diffusion problem, solving for concentration over a spherical volume given diffusion and source terms. I'm interested in calculating the total concentraion over the entire geometry at each time step, which will then be fed into the diffusion parameter, which will then influence the next iteration. 
How can I integrate over the entire geometry to find the total concentration at each time step? Do I have use PDEPE for small steps, output the solution, integrate, and restart PDEPE (similar to ODE event functions). 
0 Comments
Accepted Answer
  Torsten
      
      
 on 14 Feb 2023
        
      Edited: Torsten
      
      
 on 14 Feb 2023
  
      How can I integrate over the entire geometry to find the total concentration at each time step? Do I have use PDEPE for small steps, output the solution, integrate, and restart PDEPE (similar to ODE event functions).
Yes.
Or use
As far as I remember, if you define a coupling between the PDE and an artificial ODE in this code for all grid points, you get the values of the PDE in all grid points for each time step. This offers the possibility to get the total concentration.
Or assume total concentration over time, integrate, evaluate results, integrate again with the results for total concentration from the first integration, evaluate results,... and so on until convergence.
But if you have a simple 1d pde, why not discretizing in space and use ode15s to solve the resulting system of ODEs in the grid points (method-of-lines) ? Here, you have maximum flexibility.
3 Comments
  Torsten
      
      
 on 15 Feb 2023
				
      Edited: Torsten
      
      
 on 15 Feb 2023
  
			If the diffusion parameter was a function of differential of the concentration at the right boundary condition, this cannot be solved alone with pdepe correct?
Correct, this information is not available inside the PDE function of "pdepe". But how can the diffusion coefficient depend on the concentration gradient at another position in space ? Or do you want to deduce the total concentration by the fluxes over the boundaries ?
More Answers (0)
See Also
Categories
				Find more on Eigenvalue Problems in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!