Skip to content

Commit 3ecf6fc

Browse files
author
Oskar Lundström
committed
2 parents 504a563 + de3a301 commit 3ecf6fc

File tree

5 files changed

+58
-37
lines changed

5 files changed

+58
-37
lines changed

Book/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ def build_index(sources):
129129
("Single particle mechanics", "Physics/src/NewtonianMechanics/SingleParticle.lhs")
130130
]),
131131
("Examples", [
132-
("Box on an incline", "Physics/src/Examples/Box_incline.lhs"),
133132
("Teeter", "Physics/src/Examples/Teeter.lhs"),
133+
("Box on an incline", "Physics/src/Examples/Box_incline.lhs"),
134134
])
135135
]
136136

Physics/src/Examples/Box_incline.lhs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,31 @@ Box on an incline
66

77
All vectors are in newton.
88

9-
109
![Incline](incline.png){.float-img-left}
1110

11+
Notation:
12+
fg = gravitational accelleration
13+
m = mass of box
14+
1215
> fg = V2 0 (-10)
1316
> m = 2
14-
> alpha = 30
15-
>
17+
1618
> unit_normal :: Double -> Vector2 Double
1719
> unit_normal a = V2 (cos a) (sin a)
18-
>
20+
21+
Force against the incline from the box:
22+
1923
> f_l_ :: Vector2 Double -> Angle -> Vector2 Double
2024
> f_l_ fa a = scale ((magnitude fa) * (cos a)) (unit_normal (a-(pi/2)))
21-
>
25+
26+
The normal against the incline:
27+
2228
> fn :: Vector2 Double -> Angle -> Vector2 Double
2329
> fn fa a = negate (f_l_ fa a)
2430

2531
Frictionfree incline:
2632

33+
Force resultant:
2734

2835
> fr :: Vector2 Double -> Angle -> Vector2 Double
2936
> fr fa a = (fn fa a) + fa
@@ -52,24 +59,14 @@ Odd: Motsatt gravitation ger något underligt? Vi säger fortfarande att norm
5259

5360
Good: 90* lutning - faller med G.
5461

55-
5662
*Main> fr (V2 0 10) (pi/3)
5763

5864
(-4.330127018922194 x, 7.499999999999999 y)
5965

60-
6166
*Main> fr (V2 0 10) (pi/4)
6267

6368
(-5.0 x, 4.999999999999999 y)
6469

65-
Good: 45* lutning - 5N både i x och y led. Pyth: 5^2 + 5^2 =/= 10^2
66-
67-
det borde bli: 100 = a^2 + a^2
68-
50 = a^2
69-
5*sqrt(2) = a
70-
71-
och det är det ju. xD
72-
7370
*Main> fr (V2 0 10) (pi/6)
7471

7572
(-4.330127018922193 x, 2.499999999999999 y)

Physics/src/Examples/Teeter.lhs

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,72 @@ Exam excercise 3, 2017-01-13
66
> import Dimensions.Quantity
77
> import Prelude hiding (length)
88

9-
> balk_M = 1.0 # mass
9+
10+
Two boxes, m1 and m2, rests on a beam in balance.
11+
12+
Known values:
13+
14+
> beam_M = 1.0 # mass
1015
> m1 = 2.0 # mass
1116
> m2 = 5.0 # mass
1217
> d = 0.75 # length
13-
> balk_L = 5.0 # length
18+
> beam_L = 5.0 # length
1419
> two = 2.0 # one
1520

1621
![Teeter](teeter.png){.float-img-left}
1722

1823
Direct implication:
1924

20-
$$ f(x) = \frac{a}{b}$$
25+
> beam_left_L = (beam_L /# two) +# d
26+
> beam_right_L = beam_L -# beam_left_L
2127

22-
> balk_left_L = (balk_L /# two) +# d
23-
> balk_right_L = balk_L -# balk_left_L
28+
We want to be able to represenet the torques.
2429

25-
We want to be able to represenet the angular momentums.
26-
Here are some propositions.
30+
A torque (sv. vridmoment) is defined as:
2731

28-
> m1_vrid = m1 *# balk_left_L
32+
$$ \tau = distance\ from\ turning\ point \cdot force $$
2933

30-
> balk_L_vrid = ((balk_left_L /# balk_L) *# balk_M) *# (balk_left_L /# two)
34+
Since all force values will be composited of a mass and the gravitation, we can ignore the gravitation.
3135

36+
$$ \tau = distance\ from\ turning\ point \cdot mass $$
3237

33-
> balk_H_vrid = ((balk_right_L /# balk_L) *# balk_M) *# (balk_right_L /# two)
3438

39+
> m1_torq = m1 *# beam_left_L
3540

36-
m2_vrid = m2 * x
41+
To get the beams torque on one side, we need to divide by 2 because the beam's torque is spread out linearly (the density of the beam is equal everywhere), which means the left parts mass centrum is \emph{half the distance} of the left parts total length.
3742

38-
VL = HL
43+
$$ beamL_{\tau} = beamL_{M} \cdot \frac{distance}{2} $$
3944

40-
m1_vrid + balk_L_vrid = m2_vrid + balk_H_vrid
45+
$$ beamL_{\tau} = \frac{beam\ left\ length}{beam\ length} \cdot beam_M \cdot \frac{beam\ left\ length}{2} $$
4146

42-
m1_vrid + balk_L_vrid - balk_H_vrid = m2_vrid
47+
> beamL_torq = ((beam_left_L /# beam_L) *# beam_M) *# (beam_left_L /# two)
4348

44-
(m1_vrid + balk_L_vrid - balk_H_vrid) / m2 = x
49+
> beamR_torq = ((beam_right_L /# beam_L) *# beam_M) *# (beam_right_L /# two)
4550

46-
> x = (m1_vrid +# balk_L_vrid -# balk_H_vrid) /# m2
51+
We make an expression for $m2_{\tau}$, which involves our unknown distance x.
4752

48-
Security check:
53+
$$ m2_{\tau} = m2 \cdot x $$
54+
55+
For the teeter to be in balance, both sides torques should be equal.
56+
57+
$$ Left\ side\ torque = Right\ side\ angular\ torque $$
58+
59+
We try to break out $m2_{\tau}$ and then x.
4960

50-
> m2_vrid = m2 *# x
61+
$$ m1_{\tau} + beamL_{\tau} = m2_{\tau} + beamR_{\tau} $$
62+
63+
$$ m1_{\tau} + beamL_{\tau} - beamR_{\tau} = m2_{\tau} $$
64+
65+
$$ \frac{m1_{\tau} + beamL_{\tau} - beamR_{\tau}}{m2} = x $$
66+
67+
Our solution:
68+
69+
> x = (m1_torq +# beamL_torq -# beamR_torq) /# m2
70+
71+
Security check:
5172

52-
> vL = m1_vrid +# balk_L_vrid
53-
> hL = m2_vrid +# balk_H_vrid
73+
> m2_torq = m2 *# x
5474

75+
> left_side_torque = m1_torq +# beamL_torq
76+
> right_side_torque = m2_torq +# beamR_torq
5577

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Medlemmar: Oskar, Erik, ~~Daniel~~, Björn, Johan
44

55
[Projektbeskrivning](DSLsofMath_andra_kurser.md)
66

7+
[Homepage](https://dslsofmath.github.io/BScProj2018/index.html)
8+
79

810
## Deadlines
911
* 9/2 : Inlämning av Planeringsrapport.

Redovisningar/Slutredovisning/Innehåll.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ Förmedla ett budskap;
6262

6363
sammanfattning?
6464

65-
* Ett projekt som vi valt att kalla "LYAP" och som utfördes av [NAMN]
6665
* Projektbeskrivning: [...] Ta fram DSLsofMath-inspirerat kompletterande material för andra närliggande kurser [...]
66+
* Ett projekt som vi valt att kalla "LYAP" och som utfördes av [NAMN]
6767
* Att lära ut fysik mha DSL
6868
* Ett läromaterial anpassat till datastudenter
6969
* Resultatet blev en hemsida/bok i stil med LYAH

0 commit comments

Comments
 (0)