Calculating discrete mean

32 Views Asked by At

I am not sure if a distinction "discrete" and "continuous" mean exists, but it's the best way to describe my problem: I have solved a partial differential equation $f(u^{'}(t),u(t),t)=c$ on a domain $\Omega$ numerically in Matlab. $u$ denotes the concentration of a chemical substance and I am interested in calculating the mean concentration over $\Omega$. Mathematically, this would be $$\frac{1}{|\Omega|}\int_{\Omega}u.$$ Since the solution in Matlab is given as discrete solutions evaluated at each finite element mesh point, I thought to evaluate the mean concentration as follows: $$\frac{\text{Sum of discrete solutions u at each mesh point}}{\text{number of mesh points}}$$ Intuitively, this seems like a correct approach, but I am not sure if the integral above can be rewritten discretely like the fraction above. Any ideas, suggestion and criticism would be very helpful, because I am very lost at this point. The answer might be very obvious, but my numerical background is not strong.