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.

Eigenvalues from different study steps

Please login with a confirmed email address before reporting spam

Hi everyone,

I am trying to calculate an overlap integral between two modes of different origin -- a common problem of electrooptics or optomechanics. So I have two physics interfaces (say electromagnetic and structural mechanics) and I need to solve them and compute overlap integrals between all modes.

If I use two distinct studies (one for electric eigenvalues and other for mechanic eigenvalues) I get two different solutions (data sets) that cannot be brought together.
If I use two study steps in one study I again get two data sets. Though the first one has one of the modes of first problem, it looks like there is only one of them. I tried to use the with() operator but I still can't address to other modes.

Is there any way to do the thing?
Thanks.

6 Replies Last Post Jul 27, 2015, 3:56 a.m. EDT
Sergei Yushanov Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jul 28, 2014, 7:58 a.m. EDT
Nikita,

Have you seen this blog?

www.comsol.com/blogs/join-solutions-comsol-multiphysics/

Regards,
Sergei
Nikita, Have you seen this blog? http://www.comsol.com/blogs/join-solutions-comsol-multiphysics/ Regards, Sergei

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 6, 2014, 10:56 a.m. EDT
Sergei,

Thanks for your reply. Unfortunately this new feature looks like having a lot of bugs, making it useless for me:
with() operator doesn't work with data2
intop(data2(u)) gives out an error
The worst is that you can't join two data sets of eigenvalue problem solutions (probably any data sets with more than one solution):
if you try to join both with all solutions it just gives out an error
if you join first dataset with "all" and the second one with "one", you can't get to other solutions from second dataset
if you join first dataset with "one" and the second one with "all", Comsol gives out errors while making tables

The problem is that it also can not join more then two datasets. Well, you can join a data set with join, but again you will loose access to some eigenfunctions and probably get a lot of errors.

Meanwhile, I need to calculate something like intop(u*v*h), where u, v, h are solutions of three different eigenvalue problems, for all combinations of eigenfunctions.
Sergei, Thanks for your reply. Unfortunately this new feature looks like having a lot of bugs, making it useless for me: with() operator doesn't work with data2 intop(data2(u)) gives out an error The worst is that you can't join two data sets of eigenvalue problem solutions (probably any data sets with more than one solution): if you try to join both with all solutions it just gives out an error if you join first dataset with "all" and the second one with "one", you can't get to other solutions from second dataset if you join first dataset with "one" and the second one with "all", Comsol gives out errors while making tables The problem is that it also can not join more then two datasets. Well, you can join a data set with join, but again you will loose access to some eigenfunctions and probably get a lot of errors. Meanwhile, I need to calculate something like intop(u*v*h), where u, v, h are solutions of three different eigenvalue problems, for all combinations of eigenfunctions.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 1, 2014, 1:09 p.m. EDT
You can use one study with two solvers. In the first solver, you'd solve for one physics, in the second solver you'd solve for the second physics. In the second solver, however, under the "Values of Dependent Variables", go to "Variables not solved for" and change the method to Solution. This way the second solver will save the solution of the first solver and you will have access to both solutions at the same time.
You can use one study with two solvers. In the first solver, you'd solve for one physics, in the second solver you'd solve for the second physics. In the second solver, however, under the "Values of Dependent Variables", go to "Variables not solved for" and change the method to Solution. This way the second solver will save the solution of the first solver and you will have access to both solutions at the same time.

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Jul 24, 2015, 4:01 p.m. EDT
Hossein,

yes, probably it should work like that. But unfortunately in this case you also loose access to the eigenvalues of the first solution. There is an option ``All'' in the menu for eigenfrequencies under variables not solved for, but it doesn't work (the effect is as you choose ``first''). Probably it's a bug.
Hossein, yes, probably it should work like that. But unfortunately in this case you also loose access to the eigenvalues of the first solution. There is an option ``All'' in the menu for eigenfrequencies under variables not solved for, but it doesn't work (the effect is as you choose ``first''). Probably it's a bug.

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: 9 years ago Jul 26, 2015, 3:21 p.m. EDT
Hi

You have the built-in operators (see Help) :

"with(index_into_current_solution,variable)" and
"at(time_step_of_urrent_solution,variable)

but also the new v5 operator (not sure it's in v4) :

"withsol('solution_tag',variable)"

to index into a given (of many) Data Sets.

Else you are probably better off using the link to Matlab to perform such operations.

You can have different eigenfrequency Solver Nodes under the same Study, but I do not see what that would help, i.e. a combination stationary+eigenfrequncy is typically what COMSOL uses for a pre-stressed loaded eigenfrequency study, in which case it adds a "Store Solution" sub-node between the two solver sequences to force COMSOL to store the first solver results to the file, and to be able to reuse these results as initial values, but this is not what I understand you are doing here. You might always add y Store solution manually in the solver sequence, if COMSOL does not add it by itself. One caveat: COMSOL notes that you are messing with the default solver settings, therefore if you later update the physics, COMSOL will not update the solver settings automatically, since once you edit them COMSOL considers you will continue to edit them at best ! Then its better to make a new solver sequence, or to reset the solver sequence.

--
Good luck
Ivar
Hi You have the built-in operators (see Help) : "with(index_into_current_solution,variable)" and "at(time_step_of_urrent_solution,variable) but also the new v5 operator (not sure it's in v4) : "withsol('solution_tag',variable)" to index into a given (of many) Data Sets. Else you are probably better off using the link to Matlab to perform such operations. You can have different eigenfrequency Solver Nodes under the same Study, but I do not see what that would help, i.e. a combination stationary+eigenfrequncy is typically what COMSOL uses for a pre-stressed loaded eigenfrequency study, in which case it adds a "Store Solution" sub-node between the two solver sequences to force COMSOL to store the first solver results to the file, and to be able to reuse these results as initial values, but this is not what I understand you are doing here. You might always add y Store solution manually in the solver sequence, if COMSOL does not add it by itself. One caveat: COMSOL notes that you are messing with the default solver settings, therefore if you later update the physics, COMSOL will not update the solver settings automatically, since once you edit them COMSOL considers you will continue to edit them at best ! Then its better to make a new solver sequence, or to reset the solver sequence. -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Jul 27, 2015, 3:56 a.m. EDT
Ivar, thanks for your answer.

The "with" and "at" operators have been already discussed and showed no use in this situation as they work only inside given solution (or data set).

Till now I have been using MatLab for the problem, but it was not efficient as involved data export.

However, the new "withsol" function is exactly what I need. So finally they made it in version 5, good news :- )

Thank you for the precise answer again.
Ivar, thanks for your answer. The "with" and "at" operators have been already discussed and showed no use in this situation as they work only inside given solution (or data set). Till now I have been using MatLab for the problem, but it was not efficient as involved data export. However, the new "withsol" function is exactly what I need. So finally they made it in version 5, good news :- ) Thank you for the precise answer again.

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.