Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Plotting average values

Please login with a confirmed email address before reporting spam

I'm solving for a concentration profile, C(x,y), in a rectangular subdomain. Once I have a solution, is it possible for me to average C over y and then plot this value versus x? In other words, I'd like to first solve for the average value of C, C_avg(x), where C is averaged over the height (y) of my subdomain. This would require an integral inside the subdomain. Can Comsol v4.0a do this? Thanks - vicki

4 Replies Last Post Nov 12, 2010, 1:26 p.m. EST
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 11, 2010, 2:31 p.m. EST
Hi
normally I would say yes, as an average is the integration over a domain, boundary, or an edge, of a value, divided by the integration over the same domain, boundary or edge of "1" (the latter being the volume, area or respectively the length).

But in V4 you have directly the average operator (Definition node)) that looks after the division for you

--
Good luck
Ivar
Hi normally I would say yes, as an average is the integration over a domain, boundary, or an edge, of a value, divided by the integration over the same domain, boundary or edge of "1" (the latter being the volume, area or respectively the length). But in V4 you have directly the average operator (Definition node)) that looks after the division for you -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 11, 2010, 2:51 p.m. EST
Thanks. I'm still a little confused. I'm not sure how to even take an integral of C(x,y) over just y for various values of x. I do not want to integrate at a boundary or do a double integral over the whole subdomain. Does this make sense? thanks - vicki
Thanks. I'm still a little confused. I'm not sure how to even take an integral of C(x,y) over just y for various values of x. I do not want to integrate at a boundary or do a double integral over the whole subdomain. Does this make sense? thanks - vicki

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 11, 2010, 3:18 p.m. EST
Hi

you have the projection coupling variables to reduce the dimensions of the integration, check the doc, and try a few simple examples

--
Good luck
Ivar
Hi you have the projection coupling variables to reduce the dimensions of the integration, check the doc, and try a few simple examples -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 12, 2010, 1:26 p.m. EST
Thanks. I've spent some time trying to understand projection couplings and I think I get it. However, I'm unable to either correctly implement the projection or plot the results. I would like to plot the average value of C versus x, where C has been averaged over y. I've created a general projection, genproj1, with a source map over x, y (x-expression: x, y-expression: y) and destination map of x (x-expression: x). Then I solve the system and try to plot genproj1(C) versus x in a line graph. The resulting plot is incorrect. When I plot genproj1(1) the plot has a value at x=0 and zero for the rest of the x values. If this was done correctly, genproj(1) should give the height of the domain, right? Any idea where I am going wrong? thanks - vicki
Thanks. I've spent some time trying to understand projection couplings and I think I get it. However, I'm unable to either correctly implement the projection or plot the results. I would like to plot the average value of C versus x, where C has been averaged over y. I've created a general projection, genproj1, with a source map over x, y (x-expression: x, y-expression: y) and destination map of x (x-expression: x). Then I solve the system and try to plot genproj1(C) versus x in a line graph. The resulting plot is incorrect. When I plot genproj1(1) the plot has a value at x=0 and zero for the rest of the x values. If this was done correctly, genproj(1) should give the height of the domain, right? Any idea where I am going wrong? thanks - vicki

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.