{-# LANGUAGE TypeOperators #-} import Data.Metrology import Data.Metrology.Show import Data.Metrology.SI import Data.Units.US د² = sTwo د³ = sThree g = 9.81 % Metre:/Second:^د² :: Acceleration stringTension :: Length -> Mass%/Length -> Frequency -> Force stringTension l ρ ν = ρ |*| (2 *| l |*| ν)|^د² stringTension (327 % Milli:@Metre) (0.7 % Gram:/Metre) (440 % Hertz) -- Violin a-string stringTension (0.7 % Metre) (5.7 % Gram:/Metre) (98 % Hertz) -- Cello G string stringTension (25.5 % Inch) (0.00032 % Pound:/Inch) (110 % Hertz) -- Electric guitar A string type Gauge = Length -- thickness, i.e. diameter steelstring :: Gauge -> Mass%/Length steelstring d = (7.859 % Gram:/(Centi:@Metre):^د³ :: Density) |*| (pi *| (0.5*|d)|^د²) -- http://www.wolframalpha.com/input/?i=steel+density stringTension (25.5 % Inch) (steelstring $ 0.010 % Inch) (330 % Hertz) -- Electric guitar e string it |/|g#Pound -- same string, tension in pound-force