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 11.04.2024, 03:35 GMT-4
Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 months ago 27.03.2024, 06:36 GMT-4

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: 9 months ago 31.03.2024, 00:51 GMT-4
Updated: 9 months ago 31.03.2024, 01:21 GMT-4

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: 9 months ago 02.04.2024, 02:47 GMT-4

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: 9 months ago 02.04.2024, 22:29 GMT-4

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: 9 months ago 04.04.2024, 21:26 GMT-4

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: 9 months ago 08.04.2024, 05:29 GMT-4

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: 9 months ago 09.04.2024, 10:11 GMT-4

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: 9 months ago 10.04.2024, 03:50 GMT-4

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: 9 months ago 11.04.2024, 03:35 GMT-4

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.