# How to nondimensionalize problems with multiple/variable scales?

**URL:** <https://discourse.julialang.org/t/how-to-nondimensionalize-problems-with-multiple-variable-scales/119624>\
**Category:** Offtopic\
**Tags:** physics, dimensional-analysis\
**Created:** [September 19, 2024, 3:48pm UTC](https://discourse.julialang.org/t/how-to-nondimensionalize-problems-with-multiple-variable-scales/119624 "2024-09-19T15:48:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Post date:** [September 19, 2024, 3:48pm UTC](https://discourse.julialang.org/t/how-to-nondimensionalize-problems-with-multiple-variable-scales/119624/1 "2024-09-19T15:48:27Z")

</div>

> [@History of \`isapprox\` in languages](https://discourse.julialang.org/t/history-of-isapprox-in-languages/119347/17):
>
> in most problems one of the first steps we should be doing is creating a dimensionless version of the problem,

Even in those purely theoretical-physical problems you are referring to, the own scale of a subsystem may have some arbitrary relations with the “outer” scales. But enter material world, and applying Buckingham’s theorem is getting difficult. Let’s take your example.

> the spring has spring constant k

which is not _constant_ at all, but depends on temperature (and probably other factors). So let’s assume the dependence `k(T)` is known, and we are building a thermometer out our oscillator. The `T(k)` is empirically approximated by some polynomial of temperature. What should I take for natural units?

Just off the top of the internal package I’m working on right now: The pressure of saturated water vapor.

> **Dirty formula**
>
> ```julia
> function buck_eq(temp::T) where T<:Unitful.Temperature
> Tc = temp |> u"°C" |> ustrip
> 
> aw = 6.1121 
> bw = 18.678 
> cw = 257.14 
> dw = 234.5
>     
> return aw * exp((bw - Tc/dw) * Tc/(Tc + cw)) * u"hPa"
> end
> 
> ```

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [September 19, 2024, 4:27pm UTC](https://discourse.julialang.org/t/how-to-nondimensionalize-problems-with-multiple-variable-scales/119624/2 "2024-09-19T16:27:36Z")

</div>

> [@Eben60](#):
>
> What should I take for natural units?
> 
> Just off the top of the internal package I’m working on right now: The pressure of saturated water vapor.

LOL! If you look in the history of the wikipedia article on the Arden Buck equation you’ll find that I wrote the initial article in 2007! blast from the past. I needed something for looking at water vapor in building materials and did some research then summarized it on the wiki page. Small world!

Ideally, Buck would have expressed his model in a more explicitly nondimensional form. I’m happy to show how dimensionless form for such things could work well but it’s offtopic, if a moderator wants to split this thread to a new offtopic one we could continue there? Otherwise maybe send me a DM?

The short version is you’re working with conditions not far from freezing at atmospheric pressure so you’d probably use dimensionless temp T’ = T/T\_ice and Pressure as P’ = P/P\_atm and then do the algebra to rearrange his equation a little. You might also choose P’ = P/P\_0 where P\_0 is the vapor pressure of water in equilibrium with ice at 0 C and atmospheric pressure.

For his equation this would put T’ in the range about [0.7, 1.18] and the P’ would also be in unit type ranges.

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [September 19, 2024, 9:07pm UTC](https://discourse.julialang.org/t/how-to-nondimensionalize-problems-with-multiple-variable-scales/119624/3 "2024-09-19T21:07:30Z")

</div>

Oh nice, they split off our topic, so I can say here what I said in DM, which is basically that YES you want to nondimensionalize everything, but NO you don’t usually do that in a separate way for every subsystem of a complex problem.

When things have multiple scales it’s definitely possible to find that in dimensionless terms, some of the values are by design near 1, and others are “small parameters” or “large parameters”.

When you’re just taking a published correlation equation and using it, of course it’s not necessarily great to rewrite the published equations, but you can still do things like:

```julia
function buck_eq_ND(tempND)
   tC = NDtoC(tempND)
... Published Celsius buck equation stuff here ...
   press_hPa ...
   press_ND = hPatoND(press_hPa)
end

```

So that you can use the temperature scales appropriate for your real problem (dimensionless) while invoking the published equation which only works in units of C.
