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 12 nov 2010, 13:26 GMT-5
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 11 nov 2010, 14:31 GMT-5
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 11 nov 2010, 14:51 GMT-5
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 11 nov 2010, 15:18 GMT-5
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 12 nov 2010, 13:26 GMT-5
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.