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 2024年4月11日 GMT-4 03:35
Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 months ago 2024年3月27日 GMT-4 06:36

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: 8 months ago 2024年3月31日 GMT-4 00:51
Updated: 8 months ago 2024年3月31日 GMT-4 01:21

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: 8 months ago 2024年4月2日 GMT-4 02:47

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: 8 months ago 2024年4月2日 GMT-4 22:29

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: 8 months ago 2024年4月4日 GMT-4 21:26

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: 8 months ago 2024年4月8日 GMT-4 05:29

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 2024年4月9日 GMT-4 10:11

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 2024年4月10日 GMT-4 03:50

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 2024年4月11日 GMT-4 03:35

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.