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 put the result of the first model as an initial condition (or initial value) into the second model

Please login with a confirmed email address before reporting spam

Dear COMSOL co-users, I have a question on the COMSOL setting,When using COMSOL, a slightly more complex model usually cannot get the desired result in one operation, How to put the result of the first model as an initial condition (or initial value) into the second model, thank you very much.


3 Replies Last Post Apr 18, 2023, 2:28 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 year ago Apr 12, 2023, 3:16 a.m. EDT

You can either create a second study or a second study step within the original study. The general settings for both options are shown in the attached screengrabs.

You may not want to use the "last parameter" from the initial Study (or Study Step), so you can adjust the settings to suit.

I have been advised that the following pros/cons exist for the 2 options:

- Using two study steps with two different study nodes, we need to set a manual link between the study nodes. The advantage of this approach is that we can re-use the solution from the first study step if we need to re-run the second study. - Using two study steps within the same study node, the coupling between the study steps is done automatically. However, if we only need to run the second study, we need to run the entire study node again, i.e., both study steps.

You can either create a second study or a second study step within the original study. The general settings for both options are shown in the attached screengrabs. You may not want to use the "last parameter" from the initial Study (or Study Step), so you can adjust the settings to suit. I have been advised that the following pros/cons exist for the 2 options: *- Using two study steps with two different study nodes, we need to set a manual link between the study nodes. The advantage of this approach is that we can re-use the solution from the first study step if we need to re-run the second study. - Using two study steps within the same study node, the coupling between the study steps is done automatically. However, if we only need to run the second study, we need to run the entire study node again, i.e., both study steps.*


Please login with a confirmed email address before reporting spam

Posted: 1 year ago Apr 12, 2023, 10:56 p.m. EDT

You can either create a second study or a second study step within the original study. The general settings for both options are shown in the attached screengrabs.

You may not want to use the "last parameter" from the initial Study (or Study Step), so you can adjust the settings to suit.

I have been advised that the following pros/cons exist for the 2 options:

- Using two study steps with two different study nodes, we need to set a manual link between the study nodes. The advantage of this approach is that we can re-use the solution from the first study step if we need to re-run the second study. - Using two study steps within the same study node, the coupling between the study steps is done automatically. However, if we only need to run the second study, we need to run the entire study node again, i.e., both study steps.

Thank you very much!I have following questions yet : (1)At the time of the next calculation, If I add a second study and don't want to recalculate the last model, I want to save time, just like the attached screenshot set .Is this set up correctly? (2) I calculated 0 to 0.1 seconds for the first time range(0,0.000125,0.1) s ,At the time of the next calculation, I set the time step to range(0.1,0.95,2) s, and add a second study after the first calculation, and used the last result of the first study as the initial value, but the calculation progress is still very slow, 10 hours to calculate 14%.I don't know the reason.

>You can either create a second study or a second study step within the original study. The general settings for both options are shown in the attached screengrabs. > >You may not want to use the "last parameter" from the initial Study (or Study Step), so you can adjust the settings to suit. > >I have been advised that the following pros/cons exist for the 2 options: > >*- Using two study steps with two different study nodes, we need to set a manual link between the study nodes. The advantage of this approach is that we can re-use the solution from the first study step if we need to re-run the second study. >- Using two study steps within the same study node, the coupling between the study steps is done automatically. However, if we only need to run the second study, we need to run the entire study node again, i.e., both study steps.* Thank you very much!I have following questions yet : (1)At the time of the next calculation, If I add a second study and don't want to recalculate the last model, I want to save time, just like the attached screenshot set .Is this set up correctly? (2) I calculated 0 to 0.1 seconds for the first time range(0,0.000125,0.1) s ,At the time of the next calculation, I set the time step to range(0.1,0.95,2) s, and add a second study after the first calculation, and used the last result of the first study as the initial value, but the calculation progress is still very slow, 10 hours to calculate 14%.I don't know the reason.


Please login with a confirmed email address before reporting spam

Posted: 1 year ago Apr 18, 2023, 2:28 a.m. EDT

Your screenshot looks correct. I think the problem may be the sharp change in time steps between study 1 and study 2. Your first study has very small time steps (0.000125 seconds), and your second study has 0.95 second time steps, (a factor of 76000 increase)! This significant discontinuity in timestep will be what is causing the 2nd study to take so long.

You may want to consider "smoothing" the increase in stime steps so that the large discontinuity in time steps is avoided. (Maybe use a logarithmic time step definition).

Also, in the second study, there is no need to re-solve the solution at 1 second... that solution already exists from step 1. Make the starting time slightly over 1 second (depending on the method you use to smooth the increase in time steps).

Hope this makes sense.

Your screenshot looks correct. I think the problem may be the sharp change in time steps between study 1 and study 2. Your first study has very small time steps (0.000125 seconds), and your second study has 0.95 second time steps, (a factor of 76000 increase)! This significant discontinuity in timestep will be what is causing the 2nd study to take so long. You may want to consider "smoothing" the increase in stime steps so that the large discontinuity in time steps is avoided. (Maybe use a logarithmic time step definition). Also, in the second study, there is no need to re-solve the solution at 1 second... that solution already exists from step 1. Make the starting time slightly over 1 second (depending on the method you use to smooth the increase in time steps). Hope this makes sense.

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.