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.

How to use parametric sweep by loading parameter values?

Please login with a confirmed email address before reporting spam

Hi,

I have several parameters to add in study settings, as below:

parameter: a1 a2 a3 a4 a5
first set: 1 3 4 5 7
second set: 2 1 3 6 4
...etc.

There are many sets, so I don't want to key in step by step.

My question is how to edit the parameter values file(*.txt form) to load into comsol model?

8 Replies Last Post 2016年7月19日 GMT-4 17:23
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 2012年6月7日 GMT-4 07:16
Hi

in v4.2a there is only the way: {{a1_1 a2_1 a3_1 ...}, {a1_2 a2_2 a3_3 ....}, {a1_3 a2_3 a3_3 ...}}
AND the a1 must be a monotone increasing or decreasing series without 2 identical step values

You might add a dummy variabble in fron for the step increase

In V4.3 I have heard there are improved ways, quicker to set up, but I'm still waiting for the CD, promished for next week :)

--
Good luck
Ivar
Hi in v4.2a there is only the way: {{a1_1 a2_1 a3_1 ...}, {a1_2 a2_2 a3_3 ....}, {a1_3 a2_3 a3_3 ...}} AND the a1 must be a monotone increasing or decreasing series without 2 identical step values You might add a dummy variabble in fron for the step increase In V4.3 I have heard there are improved ways, quicker to set up, but I'm still waiting for the CD, promished for next week :) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年6月7日 GMT-4 22:08
Thank you for your reply, Ivar~

I solve my problem~~
Thank you for your reply, Ivar~ I solve my problem~~

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年10月12日 GMT-4 05:00
Hi,

I have a similar question.

I have two sets of parameters : length and width.
I do not want to have a step function but only for specific values : Length- 10,20,40,60,90
Width - 1,2,5,10
I do not want to use a step function as this is extremely time consuming and takes a very long time for values that i do not need.

I have added two differernt parametric sweeps one for each parameter.

Would you please tell me how to add these specific values.

Thanks.

Hi, I have a similar question. I have two sets of parameters : length and width. I do not want to have a step function but only for specific values : Length- 10,20,40,60,90 Width - 1,2,5,10 I do not want to use a step function as this is extremely time consuming and takes a very long time for values that i do not need. I have added two differernt parametric sweeps one for each parameter. Would you please tell me how to add these specific values. Thanks.

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 2012年10月13日 GMT-4 12:21
Hi

there is something I do not fully understand in your demand. That you want as "output" a certain set of values I do follow, that you do not want COMSOL to do any "intermediate steps" because that takes time, in principle yes, but in practice this might NOT be possible !

the way COMSOl is set up is to get, in average to THE solution, in the best way, for that it takes into considerations many issues (I expect only "support" could give a full list). If you define a "Parametric Sweep" with two parameters and give your values as range, then COMSOL will try to use these, but it might not manage to make the solution converge.

If you define a ramp or step function and allow for a more continuous range, then COMSOL can try intermediate steps, if not no, it might fail in some cases.

From my experience, when you have only small geometrical changes, then mostly COMSOl converges nicely (without need fo any intermediate steps), if you give good initial conditions.
One way is to solve the case once and then rerun the parametric sweep by using values from the first solution. But by default COMSOL starts with the model initial conditions, wich are "all 0" except if you have adapted them manually (which highly suggested that you do)

--
Good luck
Ivar
Hi there is something I do not fully understand in your demand. That you want as "output" a certain set of values I do follow, that you do not want COMSOL to do any "intermediate steps" because that takes time, in principle yes, but in practice this might NOT be possible ! the way COMSOl is set up is to get, in average to THE solution, in the best way, for that it takes into considerations many issues (I expect only "support" could give a full list). If you define a "Parametric Sweep" with two parameters and give your values as range, then COMSOL will try to use these, but it might not manage to make the solution converge. If you define a ramp or step function and allow for a more continuous range, then COMSOL can try intermediate steps, if not no, it might fail in some cases. From my experience, when you have only small geometrical changes, then mostly COMSOl converges nicely (without need fo any intermediate steps), if you give good initial conditions. One way is to solve the case once and then rerun the parametric sweep by using values from the first solution. But by default COMSOL starts with the model initial conditions, wich are "all 0" except if you have adapted them manually (which highly suggested that you do) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年10月18日 GMT-4 07:12
Hi Ivar,

Thanks for your reply.
However, I do not fully understand about convergence of the solutions. I read some more discussion forum topics and familiarized myself to taking the solution of an output and then making it the initial conditions for the next set of runs.
However, I have not done this.

For example, I have two parametric Sweeps, one for length and one for width of a rectangle for instance.
Length - 1,7,70,93 m
Width - 1,7,13,17 m

When I run the parametric sweep, I have a solution say for these particular values
{Length, width}={70,13}

Now if i use this same combination of parameters, only this time without using a parametric sweep, the solution converges.
Could you please tell me what is the difference between these two situations. I may have confused myself with the two things together, but it would be very helpful if you explain.

Thanks.
Sahana

Hi Ivar, Thanks for your reply. However, I do not fully understand about convergence of the solutions. I read some more discussion forum topics and familiarized myself to taking the solution of an output and then making it the initial conditions for the next set of runs. However, I have not done this. For example, I have two parametric Sweeps, one for length and one for width of a rectangle for instance. Length - 1,7,70,93 m Width - 1,7,13,17 m When I run the parametric sweep, I have a solution say for these particular values {Length, width}={70,13} Now if i use this same combination of parameters, only this time without using a parametric sweep, the solution converges. Could you please tell me what is the difference between these two situations. I may have confused myself with the two things together, but it would be very helpful if you explain. Thanks. Sahana

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年7月31日 GMT-4 15:28
Hello,
I try to use parametric sweep for more than one parameter, foe example I enter several parameters with different ranges in parameter name, when I push study to compute it, this problem pops up:
"Parameter lists do not have equal length for Specified combination Sweep type."
what should I do?
Thanks.
Hello, I try to use parametric sweep for more than one parameter, foe example I enter several parameters with different ranges in parameter name, when I push study to compute it, this problem pops up: "Parameter lists do not have equal length for Specified combination Sweep type." what should I do? Thanks.

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年11月9日 GMT-5 12:47
Try to match the number of values of two different parameters.

In my experience, when I set the following, the COMSOL generated the same error message saying
"Parameter lists do not have equal length for Specified combination Sweep type."
a=(5,5,15) --> 5, 10, 15 therefore '3' values
b=(1,1,2) --> 1, 2 therefore '2' values

However, when I matched the number of values as follows, it worked out well.
a=(5,5,15) --> 5, 10, 15 therefore '3' values
b=(1,1,3) --> 1,2,3 therefore '3' values
Try to match the number of values of two different parameters. In my experience, when I set the following, the COMSOL generated the same error message saying "Parameter lists do not have equal length for Specified combination Sweep type." a=(5,5,15) --> 5, 10, 15 therefore '3' values b=(1,1,2) --> 1, 2 therefore '2' values However, when I matched the number of values as follows, it worked out well. a=(5,5,15) --> 5, 10, 15 therefore '3' values b=(1,1,3) --> 1,2,3 therefore '3' values

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年7月19日 GMT-4 17:23
In the Parametric Sweep node, under "Sweep Type" you have two choices (at least I do in version 5.2). You can select "All combinations" to run with all possible combinations of the two or more sweep parameters. Alternatively, you can select "Specified combinations" where the different parameters are taken as sets (all of the first values, all of the second values, etc.) so the number of values in the various parameter sweeps must be the same.

Sounds like you have the "Specified combinations" selected when you may have wanted "All combinations".
In the Parametric Sweep node, under "Sweep Type" you have two choices (at least I do in version 5.2). You can select "All combinations" to run with all possible combinations of the two or more sweep parameters. Alternatively, you can select "Specified combinations" where the different parameters are taken as sets (all of the first values, all of the second values, etc.) so the number of values in the various parameter sweeps must be the same. Sounds like you have the "Specified combinations" selected when you may have wanted "All combinations".

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.