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 conditions Set As Step Dependent

Please login with a confirmed email address before reporting spam

In a study with step 1 stationary+step 2 time dependent, I hope to use different initial conditions, i.e. in step 1 with u=0 and in step 2 with u=1. If the above can be achieved, all steps can be run in one go during the same study. Can the above steps be set?


9 Replies Last Post Apr 11, 2024, 3:35 a.m. EDT
Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 months ago Mar 27, 2024, 6:36 a.m. EDT

You can have two different Initial Values nodes. In the study step, you disable one using Modify model configuration for study step.

-------------------
Henrik Sönnerlind
COMSOL
You can have two different *Initial Values* nodes. In the study step, you disable one using *Modify model configuration for study step*.

Please login with a confirmed email address before reporting spam

Posted: 7 months ago Mar 31, 2024, 12:51 a.m. EDT
Updated: 7 months ago Mar 31, 2024, 1:21 a.m. EDT

Thank you Dr Sönnerlind. But it seems the default initial value node isn't allowed to be disabled. Then with 2 such initial value nodes how to enable/disable them?

If that can be done, what part of the solution does step 2 inherit from step 1? By default, if no particular treatment is done to the initial values, step 2 (no matter what initial conditions to apply) should inherit the full solution of step 1 as its initial conditions?

Thank you Dr Sönnerlind. But it seems the default initial value node isn't allowed to be disabled. Then with 2 such initial value nodes how to enable/disable them? If that can be done, what part of the solution does step 2 inherit from step 1? By default, if no particular treatment is done to the initial values, step 2 (no matter what initial conditions to apply) should inherit the full solution of step 1 as its initial conditions?

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 months ago Apr 2, 2024, 2:47 a.m. EDT

Since Initial Condition nodes override each other, you can, for example use them in the following way:

In the first (default) node, you set the initial conditions for study step 1. Then, you add another node in which you set the initial conditions for study step 2. In step 1, you disable the second Initial Condition node under Modify model configuration for study step. Due to the override properties, you do not have to make any modifications to step 2.

-------------------
Henrik Sönnerlind
COMSOL
Since *Initial Condition* nodes override each other, you can, for example use them in the following way: In the first (default) node, you set the initial conditions for study step 1. Then, you add another node in which you set the initial conditions for study step 2. In step 1, you disable the second *Initial Condition* node under *Modify model configuration for study step*. Due to the override properties, you do not have to make any modifications to step 2.

Please login with a confirmed email address before reporting spam

Posted: 7 months ago Apr 2, 2024, 10:29 p.m. EDT

Thank you Dr Sönnerlind. I strictly follow your advice (In step 1, disable the second Initial Condition node under Modify model configuration for study step) as in the attached figure. But the block never moves. It seems that the second initial condition isn't applied at all by the software.

Thank you Dr Sönnerlind. I strictly follow your advice (In step 1, disable the second Initial Condition node under Modify model configuration for study step) as in the attached figure. But the block never moves. It seems that the second initial condition isn't applied at all by the software.


Please login with a confirmed email address before reporting spam

Posted: 7 months ago Apr 4, 2024, 9:26 p.m. EDT

Will the interface of "values of dependent variables" and " Initial values of variables solved for" be relevant to this question?

Will the interface of "values of dependent variables" and " Initial values of variables solved for" be relevant to this question?

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 months ago Apr 8, 2024, 5:29 a.m. EDT

That is correct. You need to take initial values from User Controlled -> Initial Expression in the second study. The default is to use results from the previous study as initial conditions.

-------------------
Henrik Sönnerlind
COMSOL
That is correct. You need to take initial values from *User Controlled* -> *Initial Expression* in the second study. The default is to use results from the previous study as initial conditions.

Please login with a confirmed email address before reporting spam

Posted: 7 months ago Apr 9, 2024, 10:11 a.m. EDT

That is correct. You need to take initial values from User Controlled -> Initial Expression in the second study. The default is to use results from the previous study as initial conditions.

Then in such a case, the solution of the current step has nothing to do with the solution of the preceding step under the same study? This is equivalent to putting these steps in separate studies?

>That is correct. You need to take initial values from *User Controlled* -> *Initial Expression* in the second study. The default is to use results from the previous study as initial conditions. Then in such a case, the solution of the current step has nothing to do with the solution of the preceding step under the same study? This is equivalent to putting these steps in separate studies?

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 months ago Apr 10, 2024, 3:50 a.m. EDT

In most cases, it will be the same, yes. There are some subtle exceptions, for example if you don't solve for the same degrees of freedom in both study steps. But by making the appropriate settings, you can obtain the same results using either two studies or two study steps within one study. it is more a matter of convenience. Study steps within one study are mainly intended for cases where there is a chain of solutions that depend on each other.

There are some other differences, not directly related to the solution. There will, for example, be a difference in how default plots are generated when you switch between two study steps and two studies.

-------------------
Henrik Sönnerlind
COMSOL
In most cases, it will be the same, yes. There are some subtle exceptions, for example if you don't solve for the same degrees of freedom in both study steps. But by making the appropriate settings, you can obtain the same results using either two studies or two study steps within one study. it is more a matter of convenience. Study steps within one study are mainly intended for cases where there is a chain of solutions that depend on each other. There are some other differences, not directly related to the solution. There will, for example, be a difference in how default plots are generated when you switch between two study steps and two studies.

Please login with a confirmed email address before reporting spam

Posted: 7 months ago Apr 11, 2024, 3:35 a.m. EDT

Thank you so much Dr Sönnerlind

Thank you so much Dr Sönnerlind

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.