|
1 | | -Improvmenet: |
2 | | - notation |
3 | | - formulas |
4 | | - tests |
5 | | - english |
6 | | - |
7 | 1 | Box on an incline |
8 | 2 | ================= |
9 | 3 |
|
10 | 4 | > import Vector.Vector |
11 | 5 |
|
12 | | -All vectors are in newton. |
| 6 | +All forces are represented in the form of a vector in this example. |
13 | 7 |
|
14 | 8 | {.float-img-left} |
15 | 9 |
|
16 | 10 | Notation: |
17 | | -fg = gravitational accelleration |
| 11 | +$$ fg = gravitational\ accelleration $$ |
18 | 12 |
|
19 | | -m = mass of box |
| 13 | +$$ m = mass\ of\ box $$ |
20 | 14 |
|
21 | 15 | > fg = V2 0 (-10) |
22 | 16 | > m = 2 |
23 | 17 |
|
24 | | -> unit_normal :: Double -> Vector2 Double |
25 | | -> unit_normal a = V2 (cos a) (sin a) |
| 18 | +A unit vector that we get from a degree $a$. |
| 19 | + |
| 20 | +> unit_normal :: Angle -> Vector2 Double |
| 21 | +> unit_normal angle = V2 (cos angle) (sin angle) |
26 | 22 |
|
27 | | -Force against the incline from the box: |
| 23 | +Force against the incline $F_{\perp}$ from the box (negative in y-axis). |
28 | 24 |
|
29 | 25 | > f_l_ :: Vector2 Double -> Angle -> Vector2 Double |
30 | | -> f_l_ fa a = scale ((magnitude fa) * (cos a)) (unit_normal (a-(pi/2))) |
| 26 | +> f_l_ fa angle = scale ((magnitude fa) * (cos angle)) (unit_normal (angle-(pi/2))) |
31 | 27 |
|
32 | | -The normal against the incline: |
| 28 | +The normal force $F_{n} = - F_{\perp}$ supporting the box from the incline (positive in y-axis): |
33 | 29 |
|
34 | 30 | > fn :: Vector2 Double -> Angle -> Vector2 Double |
35 | | -> fn fa a = negate (f_l_ fa a) |
36 | | - |
37 | | -Friction free incline: |
| 31 | +> fn fa angle = negate (f_l_ fa angle) |
38 | 32 |
|
39 | | -Resulting force: |
| 33 | +The resulting force is then the normal force from the incline plus the gravitational force. |
| 34 | +$$ F_{r} = F_{n} + F_{g} $$ |
40 | 35 |
|
41 | 36 | > fr :: Vector2 Double -> Angle -> Vector2 Double |
42 | | -> fr fa a = (fn fa a) + fa |
| 37 | +> fr fa angle = (fn fa angle) + fa |
43 | 38 |
|
44 | 39 | With friction: |
45 | 40 |
|
46 | 41 | $$ F_{friction} = \mu * F_{normal} \iff \mu = \frac{F_{friction}}{F_{normal}} $$ |
47 | 42 |
|
48 | | -> us = 0.5 |
49 | | -> uk = 0.4 |
50 | | - |
51 | | -Add image how friction depends if there is movement. |
52 | | - |
53 | | -{.float-img-left} |
54 | | - |
55 | | -> type FricConst = Double |
| 43 | +There are two different kinds of friction. One where the object is standing still on the surface, and the other where the object is sliding on the surface. In the case where the object is standing still, it remains still until the force applied on the object is greater than the maximum possible friction between the object and the surface. Once that level is surpassed, the object starts to slide. |
56 | 44 |
|
57 | | -Friction: |
| 45 | +When the object is sliding the maximum friction between the surface and the object is slightly less, as illustrated in the figure below. |
58 | 46 |
|
59 | | - friks = Fn * us, us = friction static |
| 47 | +{.float-img-left} |
60 | 48 |
|
61 | | - frikk = Fn * uk, uk = friction kinetic |
| 49 | +$$ F_{static\ friction} = \mu_{static} \cdot F_{normal} $$ |
| 50 | +$$ F_{kinetic\ friction} = \mu_{kinetic} \cdot F_{normal} $$ |
62 | 51 |
|
| 52 | +We have the normal force against the incline and only need example constants. |
63 | 53 |
|
64 | | -We have the normal force and only needs the constants. |
65 | | - |
66 | | -The current speed does not affect the friction. |
67 | | - |
68 | | -> motscalar :: FricConst -> Vector2 Double -> Scalar |
69 | | -> motscalar u f = u * (magnitude f) |
| 54 | +> type FricConst = Double |
| 55 | +> us = 0.5 |
| 56 | +> uk = 0.4 |
70 | 57 |
|
71 | 58 | Från en rörelse eller vekt, fixa komplementet |
72 | 59 |
|
73 | | - |
74 | | -> enh_vekt :: Vector2 Double -> Vector2 Double |
75 | | -> enh_vekt v | magnitude v == 0 = (V2 0 0) |
| 60 | +> unit_vec :: Vector2 Double -> Vector2 Double |
| 61 | +> unit_vec v | magnitude v == 0 = (V2 0 0) |
76 | 62 | > | otherwise = scale (1 / (magnitude v)) v |
77 | | -> |
78 | | -> |
| 63 | + |
79 | 64 | > motkrafts :: FricConst -> Scalar -> Vector2 Double -> Vector2 Double |
80 | | -> motkrafts u s v = scale (u * s) (negate (enh_vekt v)) |
81 | | -> |
| 65 | +> motkrafts u s v = scale (u * s) (negate (unit_vec v)) |
| 66 | + |
82 | 67 | > motkraftv :: FricConst -> Vector2 Double -> Vector2 Double -> Vector2 Double |
83 | | -> motkraftv u n v = scale (u * (magnitude n)) (negate (enh_vekt v)) |
| 68 | +> motkraftv u normal v = scale (u * (magnitude normal)) (negate (unit_vec v)) |
84 | 69 |
|
85 | | -Now we just need to sum the force vectors: |
| 70 | +Now we just need to sum the force vectors into $F_{r}$: |
86 | 71 |
|
87 | 72 | > fru :: Vector2 Double -> Angle -> FricConst -> Vector2 Double |
88 | 73 | > fru fa a u = (fr fa a) + (motkraftv u (fn fa a) (fr fa a)) |
89 | | -> |
90 | | -> fru' :: Vector2 Double -> Angle -> FricConst -> Vector2 Double |
91 | | -> fru' fa a u = (motkraftv u (fn fa a) (fr fa a)) |
92 | 74 |
|
93 | 75 |
|
0 commit comments