
Why does first work without a conversion and second doesn't? Also, how do I get second to work? I assume this will require some type of explicit conversion, but wrapping the right-hand side with quantity<velocity>(...) doesn't work.
quantity<velocity> nextVelocity(quantity<velocity> old) { quantity<velocity> first = (pi / 6.0 * pow<3>(particleDiameter) * gravity * (densityWater - densityGold)) * deltaTime / particleMass; quantity<velocity> second = (pi / 8.0 * densityWater * dragCoefficient * old * root<2>(pow<2>(old))) * deltaTime / particleMass; ... }
The second equation is dimensionally incorrect; i.e. the library is doing what it should be doing : telling you that you've made a mistake in your equation. In particular, the first equation gives m^3 (m s^-2) (kg m^-3) s kg^-1 -> m s^-1 while the second gives (kg m^-3) (m s^-1)^2 s kg^-1 -> m^-1 s^-1 Matthias