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.

Will the increase of the relative tolerance reduce the solving time ?

Please login with a confirmed email address before reporting spam

Dear all,

as mentioned in the title, I would know if the change (specifically an increase) of the relative tolerance in Time Dependent solver (but also in Stationary solver, why not) will reduce the time simulation. To be more precise, if I can get or not a decrease of the reciprocal of the step size faster and much linear than with lower tolerances (I have seen that a linear decrease of reciprocal of step size reduces drastically the solving time).

I would expect that an increase of relative tolerance will produce results more or less different than the real solution, but sometime one just need an order of magnitude of the results (especially at the beginning), thus it's more interesting reducing time solving than get very accurate results.

Thank you in advance!

Kind regards

6 Replies Last Post Oct 10, 2013, 6:21 a.m. EDT
Sven Friedel COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 11, 2013, 5:31 p.m. EDT
Dear Fabio,

increasing the relative tolarence can indeed reduce the solution time.
Please read in the help how both the absolute and relative tolerance will dtermine, if a certain time step for in the time-dependent solver will be accepted. Revising the fomula will tell you that you may want to adjust the absolute tolerance, too. In case of a solution coming locally close to zero or oscillating around zero, the relative error alone may not be sufficient, setting a larger absolute tolerance instead, may help you further.

Search for: "time-dependent solver" in the help to read the details.

Best regards,

Sven
Dear Fabio, increasing the relative tolarence can indeed reduce the solution time. Please read in the help how both the absolute and relative tolerance will dtermine, if a certain time step for in the time-dependent solver will be accepted. Revising the fomula will tell you that you may want to adjust the absolute tolerance, too. In case of a solution coming locally close to zero or oscillating around zero, the relative error alone may not be sufficient, setting a larger absolute tolerance instead, may help you further. Search for: "time-dependent solver" in the help to read the details. Best regards, Sven

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 28, 2013, 5:29 p.m. EDT
Dear Sven,

thank you for your reply and your reference! Now the use of absolute and relative tolerance is much clearer.

I would be interested to know how the parameters in the solver work, specifically in Fully Coupled: from the reference manual I saw that the "Tolerance factor" works as a multiplier of the Relative tolerance: for example setting rel. tol. to 1e-2 and tol. fact. to 1e-3, the relative tolerance R as stated in the formula of the step error in the time dependent solver becomes equal to 1e-5, is it right?

In addition, in the reference manual I did not find any detail about how Fully Coupled solves time dependent studies, it is described the Double Dogleg Method but is related only to stationary solving. What is the method for time dependent solving in Fully Coupled? Could you give me some references about it (or if I missed it somewhere in the manual)?

Thank you once again,

Fabio
Dear Sven, thank you for your reply and your reference! Now the use of absolute and relative tolerance is much clearer. I would be interested to know how the parameters in the solver work, specifically in Fully Coupled: from the reference manual I saw that the "Tolerance factor" works as a multiplier of the Relative tolerance: for example setting rel. tol. to 1e-2 and tol. fact. to 1e-3, the relative tolerance R as stated in the formula of the step error in the time dependent solver becomes equal to 1e-5, is it right? In addition, in the reference manual I did not find any detail about how Fully Coupled solves time dependent studies, it is described the Double Dogleg Method but is related only to stationary solving. What is the method for time dependent solving in Fully Coupled? Could you give me some references about it (or if I missed it somewhere in the manual)? Thank you once again, Fabio

Sven Friedel COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 29, 2013, 4:22 a.m. EDT
Dear Fabio


I would be interested to know how the parameters in the solver work, specifically in Fully Coupled: from the reference manual I saw that the "Tolerance factor" works as a multiplier of the Relative tolerance: for example setting rel. tol. to 1e-2 and tol. fact. to 1e-3, the relative tolerance R as stated in the formula of the step error in the time dependent solver becomes equal to 1e-5, is it right?


If you select "Fully coupled" all equations are placed in one big system which is solved simultaneously.
Setting a tolerance factor there would apply to all variables equally, which is quite the same as changing the tolerance in general. On the other hand, if you use the tolrenca factor in Segregated steps, you would be able to apply individual tolerances to different sets of variables, e.g. if you solve a thermomechnaical problem you could use a different tolerance for displacement variables (u,v,w) and for temperature T if you like.

Best regards,

Sven Friedel

Dear Fabio [QUOTE] I would be interested to know how the parameters in the solver work, specifically in Fully Coupled: from the reference manual I saw that the "Tolerance factor" works as a multiplier of the Relative tolerance: for example setting rel. tol. to 1e-2 and tol. fact. to 1e-3, the relative tolerance R as stated in the formula of the step error in the time dependent solver becomes equal to 1e-5, is it right? [/QUOTE] If you select "Fully coupled" all equations are placed in one big system which is solved simultaneously. Setting a tolerance factor there would apply to all variables equally, which is quite the same as changing the tolerance in general. On the other hand, if you use the tolrenca factor in Segregated steps, you would be able to apply individual tolerances to different sets of variables, e.g. if you solve a thermomechnaical problem you could use a different tolerance for displacement variables (u,v,w) and for temperature T if you like. Best regards, Sven Friedel

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 9, 2013, 2:08 p.m. EDT
Dear Dr. Friedel,

I resume this thread since I have a further question correlated to the use/change of tolerances. The question now is concerning the tolerances (relative, absolute and tolerance factor) that should be used dealing with non-linear models, e.g. creep and plasticity in Solid Mechanics.
According to KB_1127 for non-linear models the tolerance factor should be reduced from 1 to 1e-3. In addition, in the tutorials about creep in the model library the relative tolerance is always set to 1e-3, so reduced from the default value 1e-2. Again, in the tutorial e-core transformer (AC/DC) both the relative tolerance and the aforementioned tolerance factor are reduced. And this is also a non-linear model.

Therefore, why does the relative tolerance is set to lower values (especially for non-linear models)? Or to be more precise: these settings will avoid/reduce convergence errors, but they will also lengthen the computing time, is it right?

Thank you again

Kind regards
Fabio
Dear Dr. Friedel, I resume this thread since I have a further question correlated to the use/change of tolerances. The question now is concerning the tolerances (relative, absolute and tolerance factor) that should be used dealing with non-linear models, e.g. creep and plasticity in Solid Mechanics. According to KB_1127 for non-linear models the tolerance factor should be reduced from 1 to 1e-3. In addition, in the tutorials about creep in the model library the relative tolerance is always set to 1e-3, so reduced from the default value 1e-2. Again, in the tutorial e-core transformer (AC/DC) both the relative tolerance and the aforementioned tolerance factor are reduced. And this is also a non-linear model. Therefore, why does the relative tolerance is set to lower values (especially for non-linear models)? Or to be more precise: these settings will avoid/reduce convergence errors, but they will also lengthen the computing time, is it right? Thank you again Kind regards Fabio

Sven Friedel COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 10, 2013, 2:47 a.m. EDT
Dear Fabio,

KB 1127 gives some guidance regarding nonlinear time-dependent models. You have to imagine the solution of such a problem as to contain two "loops". The outer loop is the time-stepping that is marching forward and is controlled by the solver settings for the time stepping, in each time step a non-linear solver is called that iteratively solves the nonlinear substep.
You could now argue, if the time-step is only small enough advancing in time should "almost" involve only a "linear" sub-problem to be solved, on the other hand, if the nonlinear solver is forced to work more accurately (e.g. by forcing Jacobian recalculations or lowering the tolerance) then the time-steps can be made possibly a bit larger.

In fact the last option is what we suggest in KB1127. Shifting the workload a bit from the time-stepping algorithm to the nonlinear solver has proven to be a more successful strategy, although the nonlinear steps may take a bit longer time, the time-dependent solver shows a better convergence which may overall result in a shorter solution time.

Note that those are general recommendations and depending on the type of your nonlinearity the settings can be optimized further, which should be tested

The decision on the trade-off between solution quality, calculation time and memory consumption will always contain a subjective component.

Sven Friedel
Dear Fabio, KB 1127 gives some guidance regarding nonlinear time-dependent models. You have to imagine the solution of such a problem as to contain two "loops". The outer loop is the time-stepping that is marching forward and is controlled by the solver settings for the time stepping, in each time step a non-linear solver is called that iteratively solves the nonlinear substep. You could now argue, if the time-step is only small enough advancing in time should "almost" involve only a "linear" sub-problem to be solved, on the other hand, if the nonlinear solver is forced to work more accurately (e.g. by forcing Jacobian recalculations or lowering the tolerance) then the time-steps can be made possibly a bit larger. In fact the last option is what we suggest in KB1127. Shifting the workload a bit from the time-stepping algorithm to the nonlinear solver has proven to be a more successful strategy, although the nonlinear steps may take a bit longer time, the time-dependent solver shows a better convergence which may overall result in a shorter solution time. Note that those are general recommendations and depending on the type of your nonlinearity the settings can be optimized further, which should be tested The decision on the trade-off between solution quality, calculation time and memory consumption will always contain a subjective component. Sven Friedel

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 10, 2013, 6:21 a.m. EDT
Dear Dr. Friedel,

thank you for your thorough answer!

Bests
Dear Dr. Friedel, thank you for your thorough answer! Bests

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.