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.

Monitoring dependent variables residuals while solving

Please login with a confirmed email address before reporting spam

The below post is related to an archived discussion


[start here]

Hello everyone,

I'm referring to this old post beacuse I had the same problem. I solved it partially, as I managed to plot the error vs iterations during my time-dependent computation: I found that, if you go under Study -> Solver Configurations -> Solution1 -> Time-Dependent Solver -> Advanced and you choose the option "Detailed" in the "Solver Log" menu, Comsol will display two convergence plots, one showing the reciprocal of step size vs time step, and another showing the error vs the iterations. Of course, to make the above setting visible, you first have to right-click on your Study and hit the "Show default solver" button.

However, I still have some questions:

1) How is defined the Error showed by Comsol in the convergence plot? Does it correspond to the global residual of the modeling equations?

2) How Comsol scale residuals? Can I customize the way residuals are scaled and normalized? (for example, I'd like to scale the residuals with the highest calculated residual after N iterations)

3) How can I plot the scaled residuals of each variable during the solving process, instead of the global residual?

Many thanks to anybody who can provide some help, I'd really appreciate it. Kind regards


2 Replies Last Post 02.10.2020, 05:58 GMT-4
Fanlong Meng COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 30.09.2020, 02:20 GMT-4

Hi Daniele,

  1. The error showed in the convergence plot in COMSOL are corresponding to either solution error and/or residual. In the segregate or fully coupled solver node, you could select termination criterion which will be the error in the ocnvergence plot. Note that the residual here is referring to the algebric residual which is error associated with solving the algebraic equations instead of the modeling equation (PDE) residual which is the overall residual to the PDE including algebraic error, truncation error, geometry approximation error etc.
  2. Residual scales either automatically or manually, which you can select in Residual Scaling settings in Dependent Variables node and its subnodes for individual fields. For 'automatic' scaling, the scale for each field is determined by the magnitude of the residual and updated along time-stepping. You can scale with mannual scaling, note that the scale will affect your error termination.
  3. From version 5.5, COMSOL provides an extra convergence plot when detailed log is enabled which shows the error of each dependent variable in every iterations.
Hi Daniele, 1. The error showed in the convergence plot in COMSOL are corresponding to either solution error and/or residual. In the segregate or fully coupled solver node, you could select termination criterion which will be the error in the ocnvergence plot. Note that the residual here is referring to the algebric residual which is error associated with solving the algebraic equations instead of the modeling equation (PDE) residual which is the overall residual to the PDE including algebraic error, truncation error, geometry approximation error etc. 2. Residual scales either automatically or manually, which you can select in Residual Scaling settings in Dependent Variables node and its subnodes for individual fields. For 'automatic' scaling, the scale for each field is determined by the magnitude of the residual and updated along time-stepping. You can scale with mannual scaling, note that the scale will affect your error termination. 3. From version 5.5, COMSOL provides an extra convergence plot when detailed log is enabled which shows the error of each dependent variable in every iterations.

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 02.10.2020, 05:58 GMT-4

Hello Fanlong, thank you very much for your reply, very clear. Kind regards

Hello Fanlong, thank you very much for your reply, very clear. Kind regards

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.