Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

scaling of variables

Please login with a confirmed email address before reporting spam

What is scaling of variables and how does this influence the final solution?

What should be chosen for scaling of variables from "manual, initial value based, automatic, none"?

Thanks for the help.
Sirisha.

7 Replies Last Post 2015年5月14日 GMT-4 09:28
Lechoslaw Krolikowski

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年10月11日 GMT-4 07:53

See COMSOL Multiphysics Reference Guide, Version 4.2, pages 449, 452-453.
See COMSOL Multiphysics Reference Guide, Version 4.2, pages 449, 452-453.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年10月11日 GMT-4 07:59
Hi

in 99.9% of the cases I use the default settings of Comsol, it's only when I add my own physics that I analyse fist once coarsly, then apply a manual scale to get the items down to around 1

In general, for me, >90% of the time COMSOL, all defaults are OK

--
Good luck
Ivar
Hi in 99.9% of the cases I use the default settings of Comsol, it's only when I add my own physics that I analyse fist once coarsly, then apply a manual scale to get the items down to around 1 In general, for me, >90% of the time COMSOL, all defaults are OK -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2014年5月13日 GMT-4 04:54
For anyone reading this: the method for setting the scaling appropriately is to enter the typical value you expect the variable to take into the "Scale" field. (And not its reciprocal, which is the other natural guess.)

For example, if V is of the order of 1 nanovolt across the model, then I would enter 1e-9.

(However, I just tried a simple model, and set the scales to 1e100 or 1e-100, and this didn't affect the solution at all. Maybe because it is such a small model...)

(I happened to notice that Comsol guesses scales very poorly in some cases, so decided to investigate whether this was the source of the problems with my model.)
For anyone reading this: the method for setting the scaling appropriately is to enter the [b]typical value you expect the variable to take[/b] into the "Scale" field. (And not its reciprocal, which is the other natural guess.) For example, if V is of the order of 1 nanovolt across the model, then I would enter 1e-9. (However, I just tried a simple model, and set the scales to 1e100 or 1e-100, and this didn't affect the solution at all. Maybe because it is such a small model...) (I happened to notice that Comsol guesses scales very poorly in some cases, so decided to investigate whether this was the source of the problems with my model.)

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年5月9日 GMT-4 10:34
Hi Sergeev,

What you posted is really helpful. I just have a question, how does this manual scaling method compares with dimensionless method(i.e. I define a characteristic time and length and then make the all variables units to 1 )?
Any reply is appreciated!

Best Regards,
Leo
Hi Sergeev, What you posted is really helpful. I just have a question, how does this manual scaling method compares with dimensionless method(i.e. I define a characteristic time and length and then make the all variables units to 1 )? Any reply is appreciated! Best Regards, Leo

Jim Freels mechanical side of nuclear engineering, multiphysics analysis, COMSOL specialist

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年5月9日 GMT-4 14:56
While I agree that the scaling value does not affect the final result, I have also found that a good scaling value can dramatically affect the convergence rate, and in come cases, whether you can get a solution at all due to divergence of the solution for bad scaling values.

I typically use the COMSOL default value for a model that I do not expect to solve repeatedly or to help me determine what scaling factor I may want to choose. However, if I solve a model routinely, I want to manually adjust the scaling factor in order to help on convergence rates, and solve the model quicker. I do not know the exact algorithm that COMSOL uses to determine the scaling factors automatically, but it appears to use the maximum value of the variable over the 1st iteration, then adjust for the 2nd iteration. Perhaps I should read the manual and learn more about the automatic method.

I look at scaling as a lot like the choice of values to use when you non-dimensionalize the equation system. I like to use values that I might use as boundary conditions for a starting point. For example, a good scaling for Navier-Stokes equations is the inlet velocity, and exit pressure, and inlet temperature. The idea being to scale the variables to a nominal range where the absolute value is 0-1.

Some variables are tougher to scale than others; particularly if they rely on a length scale. There are sometimes multiple length scales in a problem.

Hope this helps.
While I agree that the scaling value does not affect the final result, I have also found that a good scaling value can dramatically affect the convergence rate, and in come cases, whether you can get a solution at all due to divergence of the solution for bad scaling values. I typically use the COMSOL default value for a model that I do not expect to solve repeatedly or to help me determine what scaling factor I may want to choose. However, if I solve a model routinely, I want to manually adjust the scaling factor in order to help on convergence rates, and solve the model quicker. I do not know the exact algorithm that COMSOL uses to determine the scaling factors automatically, but it appears to use the maximum value of the variable over the 1st iteration, then adjust for the 2nd iteration. Perhaps I should read the manual and learn more about the automatic method. I look at scaling as a lot like the choice of values to use when you non-dimensionalize the equation system. I like to use values that I might use as boundary conditions for a starting point. For example, a good scaling for Navier-Stokes equations is the inlet velocity, and exit pressure, and inlet temperature. The idea being to scale the variables to a nominal range where the absolute value is 0-1. Some variables are tougher to scale than others; particularly if they rely on a length scale. There are sometimes multiple length scales in a problem. Hope this helps.

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年5月10日 GMT-4 08:28
Dear James ,

Thank you so much for your reply!
I also found an interesting thing when using scaling: when the variable changes its sign over time like from
-10^(-9) to 10^(-9), the scaling value 10^(-9) seems can handle this problem.
I really agree that scaling is important in convergence. In my mind, the default setting of comsol often can not give you a satisfactory convergence...

Best Regards,
Leo
Dear James , Thank you so much for your reply! I also found an interesting thing when using scaling: when the variable changes its sign over time like from -10^(-9) to 10^(-9), the scaling value 10^(-9) seems can handle this problem. I really agree that scaling is important in convergence. In my mind, the default setting of comsol often can not give you a satisfactory convergence... Best Regards, Leo

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年5月14日 GMT-4 09:28
Hi James,

I recently tested an example, its results show that by only change the manual scaling value could change both the divergence and the solution.
Could you please advice?
Many thanks!

Best Regards,
Leo
Hi James, I recently tested an example, its results show that by only change the manual scaling value could change both the divergence and the solution. Could you please advice? Many thanks! Best Regards, Leo

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.