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.

Automatize Simulations and Changing Parameters

Please login with a confirmed email address before reporting spam

Hello,
I have a very simple model of two thin cylinders which are separated by a certain distance and each have a certain diameter. I then measure the voltage inside a volume, where each cylinder plays the role of an electrode.

I want to run multiple simulations, where I do the following:
- Change the diameter of the cylinders
- Change the distance between the two cylinders
- Run a simulation where the voltage is computed
- Export the results (voltage, current density, and voltage gradients) in a txt file with a filename containing the distance between the two cylinders and their diameter.

For the moment, I do this manually, but I have the impression it would be easy to automatize this, as I need to test about 10 different diameters and 10 different distances between the cylinders (so 100 simulations to test all combinations). How can I automatize that?

I read that liveLink can help, or use a batch script... I am not sure what's the best and how to use either of those for my problem.

Thank you in advance for your help.

4 Replies Last Post 2015年1月19日 GMT-5 04:12

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2014年6月30日 GMT-4 15:47
Hello,
So I decided to go with the Matlab LiveLink interface to solve my problem.

Everything seems to work fine, but I have a problem when exporting the data. I want to sample my data in a custom grid:
x: range(-0.0010,2.0e-5,0)
y: range(-0.001,2.0e-5,0.001)
z: range(-0.001,2.0e-5,0.001)

How can I set these options with the LiveLink on Matlab? I was only able to change the exported variables and the filename until now.

Thank you in advance for your help.
Hello, So I decided to go with the Matlab LiveLink interface to solve my problem. Everything seems to work fine, but I have a problem when exporting the data. I want to sample my data in a custom grid: x: range(-0.0010,2.0e-5,0) y: range(-0.001,2.0e-5,0.001) z: range(-0.001,2.0e-5,0.001) How can I set these options with the LiveLink on Matlab? I was only able to change the exported variables and the filename until now. Thank you in advance for your help.

Sven Friedel COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2014年7月1日 GMT-4 09:39
Hello Julien,

the probably by far better option for a simple geometrical parameterization is
to use a parametric sweep within the COMSOL GUI. This can be added with few
mouse clicks and the outputs can be customized easily - no need to resort
to programming for that one.

Best regards,
Sven Friedel
Hello Julien, the probably by far better option for a simple geometrical parameterization is to use a parametric sweep within the COMSOL GUI. This can be added with few mouse clicks and the outputs can be customized easily - no need to resort to programming for that one. Best regards, Sven Friedel

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 2015年1月17日 GMT-5 11:01
Hello Sven,

I face a similar problem, I would like to automate exporting data tables, (probe table), in batch mode. I have 22 files in total . I set up comsol to store the table in model and in file giving the appropriate path and I have also set export node under results to export the same table using either the same name as in store table option or a different name but after the batch file has finished there is no output *.csv file as expected.
I read somewhere in the forum that if i enable the parametric sweep it should work unfortunately it didn't.
I use a two study simulation where the steady state results are used as an initialization to a transient simulation.

Any help would be deeply appreciated,

Panos
Hello Sven, I face a similar problem, I would like to automate exporting data tables, (probe table), in batch mode. I have 22 files in total . I set up comsol to store the table in model and in file giving the appropriate path and I have also set export node under results to export the same table using either the same name as in store table option or a different name but after the batch file has finished there is no output *.csv file as expected. I read somewhere in the forum that if i enable the parametric sweep it should work unfortunately it didn't. I use a two study simulation where the steady state results are used as an initialization to a transient simulation. Any help would be deeply appreciated, Panos

Sven Friedel COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 2015年1月19日 GMT-5 04:12
Hi Panos,

Please feel free to submit here or through support@comsol.com
a suitably toyified version of your file. Most likely we can help you.

Best regards,
Sven
Hi Panos, Please feel free to submit here or through support@comsol.com a suitably toyified version of your file. Most likely we can help you. Best regards, Sven

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.