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.

Range of values for a variable gives different results than single value

Please login with a confirmed email address before reporting spam

In the frequency study step of my model, I noticed when I specify a range of values for a variable (in this case, the frequency of the incident wave), I get a different solution than if I pick one value and simulate only that value. I have no idea why this is the case?


2 Replies Last Post May 24, 2020, 1:07 p.m. EDT
Robert Koslover Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 4 years ago May 23, 2020, 7:20 p.m. EDT
Updated: 4 years ago May 23, 2020, 7:21 p.m. EDT

I presume that you are comparing a frequency that was one of the ones in the range with the same one specified invidividually.

If the differences are fairly small, it is probably the mesh that is causing this. I would bet that you have it presently configured to mesh automatically depending on the physics, and the software is probably meshing it in accordance with what it thinks is a good fit to your first frequency in the list in the range? Instead, try meshing your problem based on user-specified conditions instead. Take charge of the mesh yourself. I'm guessing that once you have identical meshes, you will get identical answers. If not, then there is something else that is different (or also different) between the two cases.

-------------------
Scientific Applications & Research Associates (SARA) Inc.
www.comsol.com/partners-consultants/certified-consultants/sara
I presume that you are comparing a frequency that was one of the ones in the range with the same one specified invidividually. If the differences are fairly small, it is probably the mesh that is causing this. I would bet that you have it presently configured to mesh automatically depending on the physics, and the software is probably meshing it in accordance with what it thinks is a good fit to your first frequency in the list in the range? Instead, try meshing your problem based on user-specified conditions instead. Take charge of the mesh yourself. I'm guessing that once you have identical meshes, you will get identical answers. If not, then there is something else that is different (or also different) between the two cases.

Please login with a confirmed email address before reporting spam

Posted: 4 years ago May 24, 2020, 1:07 p.m. EDT

Yes, that seems to have solved it! It is correct that I first calculate the background field from a range of values, then rerun over the same range of values to get the near field solution. The closer I make the ending value of the range to the starting value, the solution converges on the correct solution, so your explanation makes sense. I changed the mesh to user-controlled, and this seems to give much more reasonable results. Thanks!

Yes, that seems to have solved it! It is correct that I first calculate the background field from a range of values, then rerun over the same range of values to get the near field solution. The closer I make the ending value of the range to the starting value, the solution converges on the correct solution, so your explanation makes sense. I changed the mesh to user-controlled, and this seems to give much more reasonable results. Thanks!

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.