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 19.01.2015, 04:12 GMT-5

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 30.06.2014, 15:47 GMT-4
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 01.07.2014, 09:39 GMT-4
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: 9 years ago 17.01.2015, 11:01 GMT-5
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: 9 years ago 19.01.2015, 04:12 GMT-5
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.