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.

addition / subtraction of derived values

Please login with a confirmed email address before reporting spam

Dear community,

I'm facing a problem where I'm pretty sure there exists an easy solution, anyway I couldn't find it yet and it's driving me nuts:

I want to calculate line integrals over different edges and then add them together to gain the integration over the whole enclosing surface. The problem is that my integrand has different coefficients for different edges, that's why I can't simply apply the same integral on all edges.

So what I'm searching for is combining my solutions to a new variable.
Any ideas?

thank you in advance!

2 Replies Last Post 2017年7月13日 GMT-4 08:23
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 2017年6月21日 GMT-4 11:09
Updated: 7 years ago 2017年6月21日 GMT-4 14:25
Hi Martin,
One option for you is to define Component Couplings of the Integration type (Read more on this in other threads). Since you have presumably already solved your model at this point, you can avoid re-solving it while still making the components couplings available for postprocessing by using "Update Solution" (not "Solve") in the Study node. Now your integrals have names so you can do all the integrations/subtractions you want on them.

Alternatively, you could use the same name for several variables defined on the various edges by different expressions, and then use the machinery you are familiar with to compute the integral of that. Here again, if you don't want to re-solve the model but you do want variables added after you solved the model to be accessible in postprocessing, use "Update Solution".

Jeff

Edit: I am attaching a file demonstrating the second approach. myvar is defined as T on the bottom and left boundaries and as -T on the top and right boundaries. As a result the integral of myvar computes the integral of T on the bottom and left sides minus the integral of T on the right and top side.
Hi Martin, One option for you is to define Component Couplings of the Integration type (Read more on this in other threads). Since you have presumably already solved your model at this point, you can avoid re-solving it while still making the components couplings available for postprocessing by using "Update Solution" (not "Solve") in the Study node. Now your integrals have names so you can do all the integrations/subtractions you want on them. Alternatively, you could use the same name for several variables defined on the various edges by different expressions, and then use the machinery you are familiar with to compute the integral of that. Here again, if you don't want to re-solve the model but you do want variables added after you solved the model to be accessible in postprocessing, use "Update Solution". Jeff Edit: I am attaching a file demonstrating the second approach. myvar is defined as T on the bottom and left boundaries and as -T on the top and right boundaries. As a result the integral of myvar computes the integral of T on the bottom and left sides minus the integral of T on the right and top side.


Please login with a confirmed email address before reporting spam

Posted: 7 years ago 2017年7月13日 GMT-4 08:23
Thank you Jeff,
your first advice worked like a charm!

wishes, Martin
Thank you Jeff, your first advice worked like a charm! wishes, Martin

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.