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.

Initial Values setting during parametric sweep calculation

Please login with a confirmed email address before reporting spam

Hi all,

When I was doing parametric sweep in a stationary solver, I found that once the "stationary solver" is started, the initial value for every parametric step is defined by solution of the last parametric step. But in my case, I want to custom the initial values during the parametric calculation steps using solutions i get from other solvers so that the convergence can be faster.

Is that possible in comsol ?

Thank you guys in advance!

Chen Bin

5 Replies Last Post 2017年5月3日 GMT-4 11:31
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: 9 years ago 2015年9月10日 GMT-4 01:37
Hi

You have two types of parametric sweep: the "continuous" one using last solution values as initial values for the next step, defined as a "solver continuation" (defined in the bottom of the Solver tab) and the true Parametric Sweep Solver node you add.
The latter starts again, by default, from the initial conditions, mostly all "0" by default, so for you add the Parametric Sweep if this is wanted.

By the way the behaviour of the Paramereic sweep and the "automat Continuation" detection has change in V5, and I'm still quite confused, as the doc and help, for me, has not yet fully followed.
So do your "toy-models" to check the correct behaviour

--
Good luck
Ivar
Hi You have two types of parametric sweep: the "continuous" one using last solution values as initial values for the next step, defined as a "solver continuation" (defined in the bottom of the Solver tab) and the true Parametric Sweep Solver node you add. The latter starts again, by default, from the initial conditions, mostly all "0" by default, so for you add the Parametric Sweep if this is wanted. By the way the behaviour of the Paramereic sweep and the "automat Continuation" detection has change in V5, and I'm still quite confused, as the doc and help, for me, has not yet fully followed. So do your "toy-models" to check the correct behaviour -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年9月10日 GMT-4 04:43
Great thanks!

I have check the parametric node only finding the following 4 related taps and options:

Run continuation for (manual/no para/last para)
continuation parameter (paras I defined to choose)
Reuse solution for previous step (yes/no)
on error (stop/store)

From the reference manual, it seems all this four taps only help the solver jump from the solution for
the last user defined parametric step to the next user defined parametric step by adding more steps between them. this adaptive algorithm can not make the solver load a totally new solution dataset from other Study node as current values for variables before the start of any arbitrary step in the parametric value list when the sweep is already in progress.

I tried a for-loop calculation of normal stationary solver to do this sweep manually in Matlab, with the help of Store Solution node. And It works this time.

Bin


Great thanks! I have check the parametric node only finding the following 4 related taps and options: Run continuation for (manual/no para/last para) continuation parameter (paras I defined to choose) Reuse solution for previous step (yes/no) on error (stop/store) From the reference manual, it seems all this four taps only help the solver jump from the solution for the last user defined parametric step to the next user defined parametric step by adding more steps between them. this adaptive algorithm can not make the solver load a totally new solution dataset from other Study node as current values for variables before the start of any arbitrary step in the parametric value list when the sweep is already in progress. I tried a for-loop calculation of normal stationary solver to do this sweep manually in Matlab, with the help of Store Solution node. And It works this time. Bin

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: 9 years ago 2015年9月10日 GMT-4 08:18
Hi

I'm sure this was discusseed perhaps 6-12 months ago on the Forum, try a (several) search(es)

I know I run sometimes a first series of solver steps (i.e. stationary with continuation) and then I have a separate parametric study with some add-on physics and i.e. time series, and that allows me to extract initial conditions from the first study, it works.

a) you need to define the source of the initial conditions from the Dependent variable Solver sub node.
b) you might need an at() or with() or withsol() operator to interpolate into the first series, all depending on your parameter and the settings of both sovler sequences.

--
Good luck
Ivar
Hi I'm sure this was discusseed perhaps 6-12 months ago on the Forum, try a (several) search(es) I know I run sometimes a first series of solver steps (i.e. stationary with continuation) and then I have a separate parametric study with some add-on physics and i.e. time series, and that allows me to extract initial conditions from the first study, it works. a) you need to define the source of the initial conditions from the Dependent variable Solver sub node. b) you might need an at() or with() or withsol() operator to interpolate into the first series, all depending on your parameter and the settings of both sovler sequences. -- Good luck Ivar

Sven Friedel COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年9月10日 GMT-4 12:17
Hi Bin,


a) you need to define the source of the initial conditions from the Dependent variable Solver sub node.

This is the correct way to proceed. We distinguish two groups of variables, those solved for in the current step, and those not solved for in the current step, For both you can set individual sources for initial values.


b) you might need an at() or with() or withsol() operator to interpolate into the first series, all depending on your parameter and the settings of both sovler sequences.

at() and with() will not work, as they are mere postprocessing opeartors and cannot be called within solutions or to inherit solutions. withsol() is a new oparator that can be used to refer to solutions of other study steps within a calculation. However, if only initial values are concerned, the startegy a) is the better approach.

Best regards,
Sven

Hi Bin, [QUOTE] a) you need to define the source of the initial conditions from the Dependent variable Solver sub node. [/QUOTE] This is the correct way to proceed. We distinguish two groups of variables, those solved for in the current step, and those not solved for in the current step, For both you can set individual sources for initial values. [QUOTE] b) you might need an at() or with() or withsol() operator to interpolate into the first series, all depending on your parameter and the settings of both sovler sequences. [/QUOTE] at() and with() will not work, as they are mere postprocessing opeartors and cannot be called within solutions or to inherit solutions. withsol() is a new oparator that can be used to refer to solutions of other study steps within a calculation. However, if only initial values are concerned, the startegy a) is the better approach. Best regards, Sven

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 2017年5月3日 GMT-4 11:31
I have two parameters (defined as global parameters) which are used in initial value and boundary value of the problem. Now in the Parametric sweep, one variable changes values as expected. But the other parameter which is used in the initial value for coefficient form PDE is using only first value supplied in the sweep list for calculations. In the log file, it records all the values supplied but these values are not used in calculations. Not using continuation mode. Not using solution from the previous step.

In older version 5.0 this was working as expected.
What is the issue (Using Comsol 5.3)?
I have two parameters (defined as global parameters) which are used in initial value and boundary value of the problem. Now in the Parametric sweep, one variable changes values as expected. But the other parameter which is used in the initial value for coefficient form PDE is using only first value supplied in the sweep list for calculations. In the log file, it records all the values supplied but these values are not used in calculations. Not using continuation mode. Not using solution from the previous step. In older version 5.0 this was working as expected. What is the issue (Using Comsol 5.3)?

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.