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.

Batch mode of parametric sweep analysis

Please login with a confirmed email address before reporting spam

Is there a way to use the batch mode to simulate a parametric sweep analysis without using MATLAB connection? If there is, how?

7 Replies Last Post Sep 29, 2014, 11:26 p.m. EDT
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 29, 2009, 12:09 p.m. EST
Hi

Indeed there is, if you use the "Solve Prametric Sweep" (from V3.5 probably not before), this will make a series of files for each step, if that's what you are looking for

Ivar
Hi Indeed there is, if you use the "Solve Prametric Sweep" (from V3.5 probably not before), this will make a series of files for each step, if that's what you are looking for Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 30, 2009, 3:27 a.m. EST
Thank you Ivar,

In the matter of fact, what I am trying to do is exactly the "Solve Parametric Sweep" (I am using version 3.5.603) but in batch mode, without the GUI interface. It is because the simulation I will perform lasts several hours and I don't want to keep logged in. Then I will use the nohup command in Solaris to keep the program running even if I logout. But this works only in batch mode, without the graphical interface and the "Solve Parametric Sweep" only works, from my knowledge, with the graphical interface.

I saw in the help of batch mode that there is an option -pname and -globals, in order to simulate specific parameters. But I've tried to use them without success. Moreover, in the "Solve Parametric Sweep" we can choose a file to save some variables in and I don't know what would be the equivalent to this in the batch mode.
Thank you Ivar, In the matter of fact, what I am trying to do is exactly the "Solve Parametric Sweep" (I am using version 3.5.603) but in batch mode, without the GUI interface. It is because the simulation I will perform lasts several hours and I don't want to keep logged in. Then I will use the nohup command in Solaris to keep the program running even if I logout. But this works only in batch mode, without the graphical interface and the "Solve Parametric Sweep" only works, from my knowledge, with the graphical interface. I saw in the help of batch mode that there is an option -pname and -globals, in order to simulate specific parameters. But I've tried to use them without success. Moreover, in the "Solve Parametric Sweep" we can choose a file to save some variables in and I don't know what would be the equivalent to this in the batch mode.

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 30, 2009, 5:04 a.m. EST
Hi

Sorry, but I havnt used COMSOL yet in batch mode, in this way, I have used server client, to gain RAM, but that I do not believe will help you. Usually, my runs last not more than some 15 min, when longer (8h once for a heavy model) I leave my session logged on anyhow, as I'm not working on my laptop.

But probably there are some other out there, if not you have to try "support", but I expect them too to be on "holiday" these days, perhaps not, they are probably working hard on V4 to get it out ;)

With comsol I usually set up a simple model and test out systematically the options I find, perhaps you could try it with your batch variables

Good luck anyhow
Ivar
Hi Sorry, but I havnt used COMSOL yet in batch mode, in this way, I have used server client, to gain RAM, but that I do not believe will help you. Usually, my runs last not more than some 15 min, when longer (8h once for a heavy model) I leave my session logged on anyhow, as I'm not working on my laptop. But probably there are some other out there, if not you have to try "support", but I expect them too to be on "holiday" these days, perhaps not, they are probably working hard on V4 to get it out ;) With comsol I usually set up a simple model and test out systematically the options I find, perhaps you could try it with your batch variables Good luck anyhow Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 17, 2010, 4:31 a.m. EST
I want to share what COMSOL support has written to me:

"Concerning your question about the batch mode:

Yes, it is possible to run a parametric sweep in batch mode. Use the
commandline as in the installation and operationsguide

comsol batch -input <filename> -paramfile <name of parameterfile> -pname
<name of parameter>

The parameterfile must contain the parameter values in Columns. If you
have more than one parameter it looks like

value1(parameter1) value1(parameter2)
value2(parameter1) value2(parameter2)
...

the -pname option should then look like:

parametername1, parametername2

These parameters of course, have to be set somewhere in the physics
interface (in the boundary settings for example).

Also make sure that you define the right paths to the files (This is, what
I often forgot).

> 2) I will try the procedure that you mentioned. But I would like to save
> some post-processing values (e.g. dampdB_rfwv variable) to a file just
like it is saved using the solve parameter GUI (we can choose a file name
to save some parameters). How could I do that?


It is possible to save global expressions. So you have to define it in the
global expressions Dialog box and add the argument -globals
<globalexpressionname> in the command line.

One think I want to mention is, that I work with Windows and there one
need to add also the command -psave on. Otherwise no data will be stored.

So attached you will find a little example. Please try to solve it with
the following command under Solaris:

comsol batch -input example.mph -paramfile parameter.txt -pname para,para2
-globals wholestress -psave on"

I have not tested it yet but it should work.
I want to share what COMSOL support has written to me: "Concerning your question about the batch mode: Yes, it is possible to run a parametric sweep in batch mode. Use the commandline as in the installation and operationsguide comsol batch -input -paramfile -pname The parameterfile must contain the parameter values in Columns. If you have more than one parameter it looks like value1(parameter1) value1(parameter2) value2(parameter1) value2(parameter2) ... the -pname option should then look like: parametername1, parametername2 These parameters of course, have to be set somewhere in the physics interface (in the boundary settings for example). Also make sure that you define the right paths to the files (This is, what I often forgot). > 2) I will try the procedure that you mentioned. But I would like to save > some post-processing values (e.g. dampdB_rfwv variable) to a file just like it is saved using the solve parameter GUI (we can choose a file name to save some parameters). How could I do that? It is possible to save global expressions. So you have to define it in the global expressions Dialog box and add the argument -globals in the command line. One think I want to mention is, that I work with Windows and there one need to add also the command -psave on. Otherwise no data will be stored. So attached you will find a little example. Please try to solve it with the following command under Solaris: comsol batch -input example.mph -paramfile parameter.txt -pname para,para2 -globals wholestress -psave on" I have not tested it yet but it should work.

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 Feb 18, 2010, 1:24 a.m. EST
Hi

Thanks for the info,
I haven't been using batch mode so far, but it will certaily arrive too

Good luck
Ivar
Hi Thanks for the info, I haven't been using batch mode so far, but it will certaily arrive too Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 17, 2012, 8:56 p.m. EDT
Hi folks!

Any inputs about how to perform batch processing for parametric sweep? I've got 3 parameters that I vary and have 12 sets of such variations to perform. So anything that is not batch process for this would not be helpful. I tried using the command

comsol batch -inputfile input.mph -outputfile out.mph -pname p1,p2,p3 -plist (my set of values) -pasve on.

Basically this command works as though there was not parameter sweep that was done in the model.
What am I missing in this?
Does batch processing not work in 4.2a from the command line?

Please let me know.

Thanks,
Rohini
Hi folks! Any inputs about how to perform batch processing for parametric sweep? I've got 3 parameters that I vary and have 12 sets of such variations to perform. So anything that is not batch process for this would not be helpful. I tried using the command comsol batch -inputfile input.mph -outputfile out.mph -pname p1,p2,p3 -plist (my set of values) -pasve on. Basically this command works as though there was not parameter sweep that was done in the model. What am I missing in this? Does batch processing not work in 4.2a from the command line? Please let me know. Thanks, Rohini

Please login with a confirmed email address before reporting spam

Posted: 10 years ago Sep 29, 2014, 11:26 p.m. EDT
Hi,

What if I want to get output of one node?
For example, I want to export the temperature of the node with tag pev1 in a .txt file.
What command should I type for this?


THX
Hi, What if I want to get output of one node? For example, I want to export the temperature of the node with tag pev1 in a .txt file. What command should I type for this? THX

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.