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.

Managing multiple cases/variation

Please login with a confirmed email address before reporting spam

Hi all,

this is a very generic question, that might even not have a definite answer as it can depend on the specific case and on personal taste. However, as I'm struggling in finding a satisfying solution, I'd like to to hear other users' opinion.

The general question is: how do you handle the need of generating, and comparing, different solutions of the same model, but under different condition (meaning that you can still speak about the same "model")?

I'd love to discuss this at a very generic level if possible, as it is a problem I almost always encounter when modeling in COMSOL, but let's give a real-life example to make the question clearer. I have the model of a bulk cylinder, with a surrounding, non touching, concentric ring. The ring has a given temperature profile (as a function of the angle around the symmetry axis), and radiates towards the inner cylinder and the ambient. The cylinder re-radiates towards the ambient. I'm interested in the temperature pattern and mechanical distortion of the cylinder when heated by the ring.

Now, there are at least two thing in this model that I would like to change and generate a solution for each case:
- different temperature profiles of the ring (as defined above)
- maybe the presence of a "shield" to redirect towards the cylinder the heat radiated by the ring toward the ambient. Let's assume that the shape of the shield is not important (I don't want to test different geometries in this case), but i want to "enable" or "disable" it.

Now, switching among the different cases is easy: for the temperature profile, I can define different functions and then either change the T0 field in the "Temperature" node, or define several Temperature nodes and enable/disable them as needed. For the shield, I can include or exclude it from the heat transfer module.

The real problem is: how do I conveniently generate, store, and compare the solutions relative to this different cases?

My two very basic approaches so far have been:
- multiple files: once you are satisfied with the model, you save each case with a different name. The major drawbacks are that (1) you cannot compare multiple solutions within COMSOL, as they are not in the same file, and (2) if you ever need to modify the model (geometry or physics) or the way you represent the result, you have to go through each file and made the changes
- multiple studies: you create multiple studies, and run each one with the setting corresponding to a different case. Because different studies use different solvers, the solutions will be retained as independent. Major drawback is that you have no way of checking later what were the setting that generated a given solution, so you have to be very careful and keep track of what you are doing (that might be tricky and error prone for complicate models).

Does this make sense? Does anyone have the same problem, and maybe a better solution? Maybe I'm completely overlooking a functionality that COMSOL already has, or I'm indirectly submitting a feature request... :-)

Giacomo

5 Replies Last Post 16.06.2011, 14:55 GMT-4
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 14.06.2011, 00:36 GMT-4
Hi

I wouldnt call it a "problem" it's the way ;)

Today, the disable and enable is NOT linked to the solution, I have heard that COMSOL is considering this, but they have not yet found a good way, as they have not yet implemented it (they are rather good, I find, to get there software to evolve for better efficiency)

So indeed you can have several files, then dump the intersting data into files and cut/paste them easily into Excel or a txt file you read in and work on with Matlab or SciLab or Octave or ... Anyhow you need to give different file names to identify the studies.

Then you can run several solvers on the same model by manually enabling and disabling items and changing BC. I add to the solver name the "codes" for what I do (local "file=node" naming)

Then you can also make different models, inside the same COMSOL File, but often the file grows out of control (5-6 Gb files requires quite some time to save and load, and copyand ...

With COMSOL Plot nodes you can get a subplot to refer to different solutions so its rather easy to get them on a same imae for comparison.

Finally you can govern everything fro Matlab or via Java

So as you said there are many ways, up to you to find the one you prefer

--
Good luck
Ivar
Hi I wouldnt call it a "problem" it's the way ;) Today, the disable and enable is NOT linked to the solution, I have heard that COMSOL is considering this, but they have not yet found a good way, as they have not yet implemented it (they are rather good, I find, to get there software to evolve for better efficiency) So indeed you can have several files, then dump the intersting data into files and cut/paste them easily into Excel or a txt file you read in and work on with Matlab or SciLab or Octave or ... Anyhow you need to give different file names to identify the studies. Then you can run several solvers on the same model by manually enabling and disabling items and changing BC. I add to the solver name the "codes" for what I do (local "file=node" naming) Then you can also make different models, inside the same COMSOL File, but often the file grows out of control (5-6 Gb files requires quite some time to save and load, and copyand ... With COMSOL Plot nodes you can get a subplot to refer to different solutions so its rather easy to get them on a same imae for comparison. Finally you can govern everything fro Matlab or via Java So as you said there are many ways, up to you to find the one you prefer -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14.06.2011, 14:27 GMT-4
Hi Ivar,

thanks for the feedback.


Today, the disable and enable is NOT linked to the solution, I have heard that COMSOL is considering this, but they have not yet found a good way, as they have not yet implemented it (they are rather good, I find, to get there software to evolve for better efficiency)


I think (hoping that someone from the developer team is listening) that a first step could be that of including a "snapshot" of the model tree in the solution data, so that you can at least go back and check with which settings a solution was generated.


So indeed you can have several files, then dump the intersting data into files and cut/paste them easily into Excel or a txt file you read in and work on with Matlab or SciLab or Octave or ... Anyhow you need to give different file names to identify the studies.


Yes, although this has the above mentioned problem of keeping the different files synchronized when you make changes to the "common" (non case-dependent) part.


Then you can run several solvers on the same model by manually enabling and disabling items and changing BC.


What's BC?
Also, do you really mean "solvers", or do you mean "studies"? Do you find one to be better than the other for the purpose of multi-case study? Why?


With COMSOL Plot nodes you can get a subplot to refer to different solutions so its rather easy to get them on a same imae for comparison.


Right! That's another reason not to goo for different files...

Well, it looks like I'm not really overlooking any base functionality for this, but it's good to hear other user's opinion and strategies!

Thanks

Giacomo
Hi Ivar, thanks for the feedback. [QUOTE] Today, the disable and enable is NOT linked to the solution, I have heard that COMSOL is considering this, but they have not yet found a good way, as they have not yet implemented it (they are rather good, I find, to get there software to evolve for better efficiency) [/QUOTE] I think (hoping that someone from the developer team is listening) that a first step could be that of including a "snapshot" of the model tree in the solution data, so that you can at least go back and check with which settings a solution was generated. [QUOTE] So indeed you can have several files, then dump the intersting data into files and cut/paste them easily into Excel or a txt file you read in and work on with Matlab or SciLab or Octave or ... Anyhow you need to give different file names to identify the studies. [/QUOTE] Yes, although this has the above mentioned problem of keeping the different files synchronized when you make changes to the "common" (non case-dependent) part. [QUOTE] Then you can run several solvers on the same model by manually enabling and disabling items and changing BC. [/QUOTE] What's BC? Also, do you really mean "solvers", or do you mean "studies"? Do you find one to be better than the other for the purpose of multi-case study? Why? [QUOTE] With COMSOL Plot nodes you can get a subplot to refer to different solutions so its rather easy to get them on a same imae for comparison. [/QUOTE] Right! That's another reason not to goo for different files... Well, it looks like I'm not really overlooking any base functionality for this, but it's good to hear other user's opinion and strategies! Thanks Giacomo

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 14.06.2011, 16:44 GMT-4
Hi

I'm typing too quick and not clear anough I see ;) sorry for that,
BC =Boundary Conditions.
Then you are right I ment several "studies"

In V4.2 you can save better the reports and outputs, and have files generated, onyl thing when you save your model with a new file name, you need to go through all file references for you plot, as these are not linked. Here too I understand that COMSOl is studying this, not evident how to go, but they will surely find a way, we just have to deal with many files and careful hand definitions for some months still ;)

--
Good luck
Ivar
Hi I'm typing too quick and not clear anough I see ;) sorry for that, BC =Boundary Conditions. Then you are right I ment several "studies" In V4.2 you can save better the reports and outputs, and have files generated, onyl thing when you save your model with a new file name, you need to go through all file references for you plot, as these are not linked. Here too I understand that COMSOl is studying this, not evident how to go, but they will surely find a way, we just have to deal with many files and careful hand definitions for some months still ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 16.06.2011, 11:54 GMT-4
Thanks Ivar,

clearer now. I'll play with the new tools in v4.2, waiting for future improvement on this side! :-)

Giacomo
Thanks Ivar, clearer now. I'll play with the new tools in v4.2, waiting for future improvement on this side! :-) Giacomo

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 16.06.2011, 14:55 GMT-4
I'll just add that parametric sweeps are another powerful way to run through multiple scenarios.
I'll just add that parametric sweeps are another powerful way to run through multiple scenarios.

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.