-
Notifications
You must be signed in to change notification settings - Fork 0
/
Math.elm
36 lines (29 loc) · 993 Bytes
/
Math.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
module Math exposing (..)
type MetalType = Cu | Al
-- даны фи и киловатты найти амперы
type VType = OnePhase | ThreePhase
wt2Amp : Float -> Float -> VType -> Float
wt2Amp phi kwt vtype =
let
k = if vtype == OnePhase then 1 else sqrt 3
in
kwt / ( k * 220 * phi)
amp2Wt : Float -> Float -> VType -> Float
amp2Wt phi amp vtype =
let
k = if vtype == OnePhase then 1 else sqrt 3
in
k * amp * 220 * phi
deltaU : Float -> Int -> MetalType -> VType -> Float -> Float -> Maybe (Float, Float) -> Float
deltaU amp l mtype vtype crossSection cosf diameters =
let
k = if vtype == OnePhase then 2 else sqrt 3
g = if mtype == Cu then 53 else 31.7
r = 1000 / ( g * crossSection )
( betweenLines, diameter ) =
case diameters of
Just a -> a
Nothing -> (1, 1)
x = 0.1145 * logBase 10 (2 * betweenLines / diameter) + 0.016
in
k * amp * ( r * cosf + x * sqrt (1 - cosf*cosf)) * toFloat l