# I need to scale variables to solve a 2D PDE. What are the physical considerations of scaling?

I am solving a boundary value problem in 2D via an implicit finite difference scheme. Unfortunately, although the problem is well-posed and should have a unique solution, the condition number of the matrix to solve is through the roof (~10^15 for a highly simplified version that is just the 2D Poisson eqn.; otherwise my full model has a condition number of 10^22).

Currently, the domain is $6.1e7 \le r \le 6.3e7$ and $\epsilon \le \theta \le \pi-\epsilon$.

I've found that if I reduce the radial domain to $8 \le r \le 20$, the condition number drops to ~10,000. This makes me think I need to scale my problem.

I'm not sure how to do this, however, and I need to do it right.

Would I have to apply the scale factors in both dimensions, or to physical parameters as well? That is, if I scaled my radii by a factor $L$ (e.g. $R = r/L$), would I also have to scale other physical quantities (e.g. current density $J = j L^3$, or acceleration $A = \frac{\Delta v / L}{\Delta t}$)?

I've found that if I reduce the radial domain to $$8 \leq r \leq 20$$, the condition number drops to ~10,000. This makes me think I need to scale my problem.

I'm not sure how to do this, however, and I need to do it right.

Nondimensionalization is partly repeated application of the chain rule, and partly art. The goal is to make as many quantities in your equations as close to 1 as possible. In most cases, it involves scaling both independent variables and dependent variables by "physically relevant" scale factors. Sometimes, these scale factors are obvious (e.g., there is only one length scale that matters, and that length scale is the length/half-length/etc. of the domain), sometimes, they are not (e.g., I have several reference voltages that matter, and I need to pick one).

For someone inexperienced, I'd say, focus on the mechanics of nondimensionalization. Pick reference parameters that you think have some meaning (trust your intuition here, or check the literature if you think it's useful), and then nondimensionalize your equations, solve them, and see what happens. See what physical insights you get out of the equations, and think about limiting cases.

Wikipedia is a good reference here. I also like the discussion in Deen's Analysis of Transport Phenomena.

Would I have to apply the scale factors in both dimensions, or to physical parameters as well? That is, if I scaled my radii by a factor $$L$$ (e.g. $$R = r/L$$), would I also have to scale other physical quantities (e.g. current density $$J = j L^3$$, or acceleration $$A = \frac{\Delta v / L}{\Delta t}$$)?

You don't have to. It's valid to nondimensionalize only some quantities, particularly if certain variables are difficult to nondimensionalize, or are already nondimensional. Frequently, this situation occurs in combustion applications, where species mass fractions are already nondimensional (though usually vary over several orders of magnitude), and are difficult to scale in such a way that they vary at similar rates (to within a couple orders of magnitude). The best practice is to nondimensionalize your equations as much as you possibly can, since these sorts of scalings act as a natural preconditioner.

The only counterargument that I can think of to nondimensionalization is that it does require extra work and thought, and some care to make sure that you implement the scaling factors correctly in your code. Any ill-conditioning due to poor choices of units can sometimes be overcome with judicious use of preconditioners, but usually, nondimensionalization is preferable because of the insight it provides (via the Buckingham pi theorem, nondimensionalization yields the smallest group of parameters that influence your equations).

• Would I be able to scale the equation by only scaling one variable ($r$), and not touching anything else? For example, if I had the equation $A \frac{\partial u(r)}{\partial{r}} + B(r) u(r) = C r f(r)$ (where A, B and C may have dimensions involving length), could I just scale $r$ via $R = r/L$, and then solve $\frac{A}{L} \frac{\partial u(r)}{\partial{R}} + B(r) u(r) = C (L R) f(r)$?. – jvriesem Aug 17 '15 at 17:55
• Yes, it's valid to do that, as I point out in my answer. It's usually more beneficial to nondimensionalize everything you can. – Geoff Oxberry Aug 17 '15 at 18:39