Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Convolution on a line

Please login with a confirmed email address before reporting spam

Hello everybody,

In my 2D problem (Basically its a rectangle with results from a prior simulation) I want to calculate a convolution integral on a line through the rectangle and not the entire rectangle since it is very time consuming.

The way I did it was with a integration model coupling operator intop1 defined on the rectangle and a pde model with solves

u-intop1(sz*gauTF(sigma, dest(x)-x ,dest(y)-y))

where gauTF is a gaussian transfer function for the convolution (sigma is a parameter and u is the desired value. since everything eles in the general form PDE is 0 Comsol solves the problem. Then I introduce a 2D cutline and take the convoluted data. However the data on the rest of the rectanlge is also calculated by comsol which I want to avoid.

So I think of a mapping the 2D problem to a 1D problem and defining there the integration coupling operator, but I fear that it won't be possible to access the right area.

Any other suggestions?

Bye
Robert


7 Replies Last Post Jan 1, 2012, 3:34 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 Dec 23, 2011, 4:07 a.m. EST
Hi

if you define a integration coupling operator on a recangle (domain in 2D) you are integrating over the domain of your operand *dx*dy, you need to define it over a line/edge along x or y or "r" to get a 1 dimensional operator

--
Good luck
Ivar
Hi if you define a integration coupling operator on a recangle (domain in 2D) you are integrating over the domain of your operand *dx*dy, you need to define it over a line/edge along x or y or "r" to get a 1 dimensional operator -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 23, 2011, 8:24 a.m. EST
Hi Ivar,

I really have to integrate over that rectangle. The problem is the convolution with the 2D gaussian function. Right now Comsol is calculating the result everywhere on that rectangle (and this takes too long), but I only need the results on a line in the middle of the rectangle.

(Replacing dest(y) with -0.5[um] lets Comsol calculate the right thing but there is no gain in performance since it is still calculated for every point on that rectangle the result is however independant of the y cordinate of course).

Happy holidays
Robert
Hi Ivar, I really have to integrate over that rectangle. The problem is the convolution with the 2D gaussian function. Right now Comsol is calculating the result everywhere on that rectangle (and this takes too long), but I only need the results on a line in the middle of the rectangle. (Replacing dest(y) with -0.5[um] lets Comsol calculate the right thing but there is no gain in performance since it is still calculated for every point on that rectangle the result is however independant of the y cordinate of course). Happy holidays Robert

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 23, 2011, 8:29 a.m. EST
Application Error
Sorry, the application encountered an unexpected problem.

The application encountered an unexpected problem, and were not able to process your request. An error report has been generated and sent to us. Should this problem persist, please don't hesitate to contact us at webmaster@comsol.com for personal assistance.
Application Error Sorry, the application encountered an unexpected problem. The application encountered an unexpected problem, and were not able to process your request. An error report has been generated and sent to us. Should this problem persist, please don't hesitate to contact us at webmaster@comsol.com for personal assistance.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 23, 2011, 8:29 a.m. EST
application error but posted
application error but posted

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 Dec 23, 2011, 9:15 a.m. EST
Hi

can you apply it to a data set - cut line ? or add an interior boundary ?

(many App error today from my side too, COMSOL must have some disk or network issues to solve, nice for the Xmas time ;)

--
Good luck
Ivar
Hi can you apply it to a data set - cut line ? or add an interior boundary ? (many App error today from my side too, COMSOL must have some disk or network issues to solve, nice for the Xmas time ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 30, 2011, 11:51 a.m. EST
Hi,

putting a dataset cutline is the way it is done in the file right now.
However the data for the entire 2d area is still calculated - so Comsol is doing some bonus work which is time consuming.
I can not imagine how an interior boundary can solve the problem. The integration coupling operator really needs to be defined on the entire area. But the calculated datapoints need only to be on a line.

The way I think it can be done is by solving the problem on a 2nd 1D model where just a line is defined. Then I need to access the solution of the 2D model and the integration coupling operator of the first model but Comsol is then infact solving the problem on the line.

I have seen an example
www.comsol.com/showroom/documentation/model/699/
and perhaps I can connect different models somewhat like there.

Bye
Robert
Hi, putting a dataset cutline is the way it is done in the file right now. However the data for the entire 2d area is still calculated - so Comsol is doing some bonus work which is time consuming. I can not imagine how an interior boundary can solve the problem. The integration coupling operator really needs to be defined on the entire area. But the calculated datapoints need only to be on a line. The way I think it can be done is by solving the problem on a 2nd 1D model where just a line is defined. Then I need to access the solution of the 2D model and the integration coupling operator of the first model but Comsol is then infact solving the problem on the line. I have seen an example http://www.comsol.com/showroom/documentation/model/699/ and perhaps I can connect different models somewhat like there. Bye Robert

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 Jan 1, 2012, 3:34 p.m. EST
Hi

I do have some problems to follow you, as I'm not fully understanding your model, but I agree your "u" needs to be calculated on the 2D domain, the way you define it, but you want to evaluate "u" only along a line. I'm not sure if there is any other way around

Now for your model, the time needed does not seem significant for me, OK if you consider another mdel with 100x higher mesh density it can be an issue.

By the way be careful with the variable naming, most single lettres are already used by COMSOL, "u" by default is used as dependent vairable in solid, so you can get strange results depending on how you mix a few physics that way

Form your original model I get factor 2 difference between the two solution methods, otherwise they look very similar

--
Good luck
Ivar
Hi I do have some problems to follow you, as I'm not fully understanding your model, but I agree your "u" needs to be calculated on the 2D domain, the way you define it, but you want to evaluate "u" only along a line. I'm not sure if there is any other way around Now for your model, the time needed does not seem significant for me, OK if you consider another mdel with 100x higher mesh density it can be an issue. By the way be careful with the variable naming, most single lettres are already used by COMSOL, "u" by default is used as dependent vairable in solid, so you can get strange results depending on how you mix a few physics that way Form your original model I get factor 2 difference between the two solution methods, otherwise they look very similar -- Good luck Ivar

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.