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.

Post-process two different solutions from a Parametric Sweep...

Please login with a confirmed email address before reporting spam

Hello,
I am using COMSOL 4.1 and I am facing a conceptually simple problem with no luck. Basically I have a simple 2D Eigenvalue Problem which gives me 20 eigenvalues (and 20 eigenmodes) and a Parametric Sweep with 50 parameter values. So, in a nutshell, I have 50 outer solution and 20 inner solutions.
Now I need to estimate a surface integral of a product of two variables through the derived value tab. The only problem is that I need the two variables to be picked from two different solutions (different parameter).
I have looked at the with operator but it lets you choose one inner solution (of the 20 in my case) for a FIXED outer solution (parameter of the Parametric Sweep).
Is there a way to combine these two solutions so that I can define a product like U(outersol(3))*U(outersol(10))?

Thanks very much.

Claudio

12 Replies Last Post 7 juin 2016, 14:28 UTC−4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 3 mai 2011, 20:13 UTC−4
No one able to help me?
No one able to help me?

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 4 mai 2011, 03:15 UTC−4
Hi

have you tried to generate 20 integrals of the inner solution and export them as a table, you have also table operations that integrate over the table values, and you can inverse the row-colums

But this does perhaps not allow to pick an item from each in integrate that.

via matlab you should be able though

--
Good luck
Ivar
Hi have you tried to generate 20 integrals of the inner solution and export them as a table, you have also table operations that integrate over the table values, and you can inverse the row-colums But this does perhaps not allow to pick an item from each in integrate that. via matlab you should be able though -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 4 mai 2011, 12:34 UTC−4
Hi Ivar,
first thanks very much for your response.
With the table approach you suggested I don't think I can solve the problem because inside the integrals I have a product of variables picked from two different outer solutions.

I have tried also with the Livelink for Matlab with no luck because basically the formalism there in order to define an integral is:

val=mphint(model,{'e1','e2',...},'Dataset','X','Outersolnum',Y,'Solnum',Z);

so, as you can see, I can define a specific Dataset with X, a specific Outer Solution with Y and a specific Inner Solution with Z (or eventually using with(...,...) in the expression field) but the problem remains because the expressions to be integrated MUST involve variables picked from the same Outer Solution.

So, to my understanding, there is no way to develop an integral of a product of two variables (it can be also the same quantity) picked from two different outer solutions in a Parametric Sweep Eigenvalue Analysis.

I hope I am wrong because it looks ridiculous that all the solutions and all the variables are stored for each inner and outer solution, but I can't just pick the ones I want to do some post-processing, not even with the Livelink.

Claudio
Hi Ivar, first thanks very much for your response. With the table approach you suggested I don't think I can solve the problem because inside the integrals I have a product of variables picked from two different outer solutions. I have tried also with the Livelink for Matlab with no luck because basically the formalism there in order to define an integral is: val=mphint(model,{'e1','e2',...},'Dataset','X','Outersolnum',Y,'Solnum',Z); so, as you can see, I can define a specific Dataset with X, a specific Outer Solution with Y and a specific Inner Solution with Z (or eventually using with(...,...) in the expression field) but the problem remains because the expressions to be integrated MUST involve variables picked from the same Outer Solution. So, to my understanding, there is no way to develop an integral of a product of two variables (it can be also the same quantity) picked from two different outer solutions in a Parametric Sweep Eigenvalue Analysis. I hope I am wrong because it looks ridiculous that all the solutions and all the variables are stored for each inner and outer solution, but I can't just pick the ones I want to do some post-processing, not even with the Livelink. Claudio

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 5 mai 2011, 09:10 UTC−4
Hi

You have an interesting case there, and I see the potential use, but not the answer ;)

Have you tried to twickle "support" ? at least it could be considered as a "suggesion" for next release

--
Good luck
Ivar
Hi You have an interesting case there, and I see the potential use, but not the answer ;) Have you tried to twickle "support" ? at least it could be considered as a "suggesion" for next release -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 5 mai 2011, 12:38 UTC−4
Hi Ivar,
yes I have been in contact with the support for the last 2 weeks and, apparently, no one is able to handle the situation.

I hope they are gonna come out with at least a workaround because it is really embarrassing that such a big software lacks very easy post-processing task like mine.
Hi Ivar, yes I have been in contact with the support for the last 2 weeks and, apparently, no one is able to handle the situation. I hope they are gonna come out with at least a workaround because it is really embarrassing that such a big software lacks very easy post-processing task like mine.

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 5 mai 2011, 15:03 UTC−4
Hi

well the reason for matlab or java or... programming access, is really to deal with special cases, even if they look rather evident, now

--
Good luck
Ivar
Hi well the reason for matlab or java or... programming access, is really to deal with special cases, even if they look rather evident, now -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 11 sept. 2011, 18:40 UTC−4
Were you able to solve your problem? I have to do the same thing, if you solved it, please tell me how.
Were you able to solve your problem? I have to do the same thing, if you solved it, please tell me how.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 11 sept. 2011, 18:48 UTC−4
I solved it manually following a different approach. COMSOL support is awful! I spent like 4-5 weeks between completely useless phone conversations and emails and at the end they just told me that what I was asking IS IMPOSSIBLE TO BE DONE IN COMSOL...and we are just talking about a very basic post-processing procedure. Apparently a "with" operator (already implemented in COMSOL but just for inner solutions) able to pick variables from two different outer solutions is really TOO MUCH!

Good luck!
I solved it manually following a different approach. COMSOL support is awful! I spent like 4-5 weeks between completely useless phone conversations and emails and at the end they just told me that what I was asking IS IMPOSSIBLE TO BE DONE IN COMSOL...and we are just talking about a very basic post-processing procedure. Apparently a "with" operator (already implemented in COMSOL but just for inner solutions) able to pick variables from two different outer solutions is really TOO MUCH! Good luck!

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 9 févr. 2012, 14:17 UTC−5
After all this time, did anyone solve that? Can you describe the steps you did?



I have a similar problem, where my parametric solution is 225 times (outer solution).

I need to extract variables from different solutions, and integrate them.
Apparently I need comsol not to search from all the solutions. Executing any variant of the following command, keeps returning 225 numbers (all the same). Is any way to overcome that?


lala=mphint(model,' with(2,ec.Jx)-with(5,ec.Jx) ) * (with(12,ec.Jx)-with(25,ec.Jx)', 'edim',3, 'selection',2)
lala=mphint(model,' (with(2,ec.Jx)-with(5,ec.Jx) ) * (with(12,ec.Jx)-with(25,ec.Jx))', 'edim',3,'selection',2,'Outersolnum',1)
lala=mphint(model,' (with(2,ec.Jx)-with(5,ec.Jx) ) * (with(12,ec.Jx)-with(25,ec.Jx))', 'edim',3, 'selection',2,'Solnum',1)


P.S.
I did contact comsol, but support is very disappointing.
After all this time, did anyone solve that? Can you describe the steps you did? I have a similar problem, where my parametric solution is 225 times (outer solution). I need to extract variables from different solutions, and integrate them. Apparently I need comsol not to search from all the solutions. Executing any variant of the following command, keeps returning 225 numbers (all the same). Is any way to overcome that? lala=mphint(model,' with(2,ec.Jx)-with(5,ec.Jx) ) * (with(12,ec.Jx)-with(25,ec.Jx)', 'edim',3, 'selection',2) lala=mphint(model,' (with(2,ec.Jx)-with(5,ec.Jx) ) * (with(12,ec.Jx)-with(25,ec.Jx))', 'edim',3,'selection',2,'Outersolnum',1) lala=mphint(model,' (with(2,ec.Jx)-with(5,ec.Jx) ) * (with(12,ec.Jx)-with(25,ec.Jx))', 'edim',3, 'selection',2,'Solnum',1) P.S. I did contact comsol, but support is very disappointing.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 20 déc. 2012, 15:51 UTC−5
Good news: there is a solution. The answer is to use COMSOL MATLAB LiveLink. You extract all variables you need using the mphinterp() command (it interpolates some variable across a grid you give it). Then you perform whatever you need to do in MATLAB.

Bad news: you need MATLAB and Livelink, both of which cost a pretty penny, and you have to spend time writing the code.

Edit: It may also be possible to do this with the Physics Builder. In the end, no built-in way that I know of.
Good news: there is a solution. The answer is to use COMSOL MATLAB LiveLink. You extract all variables you need using the mphinterp() command (it interpolates some variable across a grid you give it). Then you perform whatever you need to do in MATLAB. Bad news: you need MATLAB and Livelink, both of which cost a pretty penny, and you have to spend time writing the code. Edit: It may also be possible to do this with the Physics Builder. In the end, no built-in way that I know of.

Polepalli Siva Krishna

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 31 janv. 2014, 00:27 UTC−5
hi
can some one tell me hw to integrate two solutions from different modes

i have to do surface integration of normal electric field of frequency at w and 2w
hi can some one tell me hw to integrate two solutions from different modes i have to do surface integration of normal electric field of frequency at w and 2w

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 7 juin 2016, 14:28 UTC−4
Apparently in 5.2 (not verified earlier versions) you can compare two solutions from a parametric sweep using Join Data Sets:

www.comsol.co.in/blogs/solution-joining-parametric-eigenfrequency-time-dependent-problems/
Apparently in 5.2 (not verified earlier versions) you can compare two solutions from a parametric sweep using Join Data Sets: https://www.comsol.co.in/blogs/solution-joining-parametric-eigenfrequency-time-dependent-problems/

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.