Compare commits
229 Commits
e8c154d43b
...
main
Author | SHA1 | Date | |
---|---|---|---|
474050ff6d
|
|||
1b95f46544 | |||
a4b13fb71e
|
|||
d512ff1c73
|
|||
b7c38ddc89
|
|||
9d602fede7
|
|||
a21898048c
|
|||
5e3bdbe2f6
|
|||
1e90d6c8a9
|
|||
b6c9129fa5
|
|||
00b08276a2
|
|||
47bfb4ac20
|
|||
1055f83d3a
|
|||
a9cb29989d
|
|||
ce04f5dd57
|
|||
ef43740721
|
|||
b94dba3163
|
|||
816896537d
|
|||
ad7096bca2
|
|||
37618fe7eb
|
|||
8c16a0d537
|
|||
e203b294c5
|
|||
91e7c9701a
|
|||
9e12734c5f
|
|||
524465453a
|
|||
dec593c503
|
|||
56d55a6617
|
|||
15cec82789
|
|||
8185cd14e4
|
|||
e4a0ef25e1
|
|||
5f5e43e54e
|
|||
a24eb028a9
|
|||
996700bec9
|
|||
4369e246bd
|
|||
a42bfcc814
|
|||
3de79c2111
|
|||
da516f5160
|
|||
0489963eda
|
|||
8981e9b9c4
|
|||
dd35b48def
|
|||
0ceb20bcf1
|
|||
f266085c4e
|
|||
5b64235c97
|
|||
b3d42c30d9
|
|||
a84913e3f5
|
|||
557bad8387
|
|||
0f29002415
|
|||
11cd8df774
|
|||
a92f99dae8
|
|||
7f7955fc4f
|
|||
a4d8d95d74
|
|||
bec5809694
|
|||
4e51f23dca
|
|||
212cfd6e4c
|
|||
c58e7b2f94
|
|||
307c4f366d
|
|||
3b0d086ea0
|
|||
4b59dcaa8b
|
|||
55b75039bf
|
|||
cde7a3c7f9
|
|||
b0f8043db0
|
|||
6e748d46b2
|
|||
f2e94c592f
|
|||
f8785c4fd2
|
|||
56282d75af
|
|||
ed7af09a55
|
|||
917a47caf9
|
|||
57507d4c34
|
|||
d61c94880c
|
|||
9b694732bd
|
|||
160418816f
|
|||
d505de5ac1
|
|||
868fac25cf
|
|||
c90147635a
|
|||
c0c565a104
|
|||
fb21e1012f
|
|||
015149b341
|
|||
bc73ac4e09
|
|||
6357ba4fdb
|
|||
b262977263
|
|||
486774e0d6
|
|||
3eed68e1b3
|
|||
826ea4690f
|
|||
07466ce8a9
|
|||
9b1346f8f0
|
|||
6ec65bd5ec
|
|||
519d3e37f0
|
|||
5d580557ec
|
|||
bb4ba0ff66
|
|||
249a2f30d2
|
|||
a07f63de81
|
|||
f3580ea182
|
|||
572d86e60f
|
|||
7d9ad8cbf0
|
|||
7166aecc6f
|
|||
274c643b09
|
|||
5d4ec5ab36
|
|||
acb42fb8c6
|
|||
ebb8ad0350
|
|||
b2ff21cd12
|
|||
73d39c8744
|
|||
d0496e79d8
|
|||
485ca3ca66
|
|||
11bc9c6c0d
|
|||
044a898557
|
|||
ec195bbe66
|
|||
5a807f15ac
|
|||
96891f53ba
|
|||
5f109d2843
|
|||
0a4b93d33b
|
|||
e14699c5ef
|
|||
3880dc3c5c
|
|||
2fb7818e20
|
|||
f04625d539
|
|||
5a788e0eed
|
|||
414d4b1183
|
|||
1bf9a50a93
|
|||
a2e60d3eea
|
|||
b35404bc42
|
|||
b994350970
|
|||
4959ea926b
|
|||
9ef91509e7
|
|||
4494ba74b9
|
|||
aa7650c78f
|
|||
468b4a22cd
|
|||
998a08633e
|
|||
d584420e0f
|
|||
5c27d1a91c
|
|||
81fe971662
|
|||
027f5dfb89
|
|||
6c0d1020a7
|
|||
5202768589
|
|||
7b2ed927b4
|
|||
3eb6fe9d56
|
|||
829beab997
|
|||
8f18918c05
|
|||
6150bb4707
|
|||
23d7364485
|
|||
1f8a5382d8
|
|||
2033c7524e
|
|||
b7ef6c914b
|
|||
83cd3ad585
|
|||
00d1758c35
|
|||
5ac0e81f5a
|
|||
fb07f79fb0
|
|||
9904aaa68d
|
|||
58476ad943
|
|||
9baa4abeb7
|
|||
ba3430236c
|
|||
d7e2c77140
|
|||
d938b19869
|
|||
cda5056661
|
|||
9396acbe81
|
|||
4f2fff1d71
|
|||
98f161b927
|
|||
19bb008d18
|
|||
199c488cb3
|
|||
aa163ccbf1
|
|||
e4fc38feaa
|
|||
50721f0bcd
|
|||
14f4fc0fa9
|
|||
1d226d9503
|
|||
1ffbca756c
|
|||
e263656e60
|
|||
78946e25e4
|
|||
2c14c31e93
|
|||
187337d789
|
|||
1e42fd59b4
|
|||
d0fd9f5ed4
|
|||
44ccde2294
|
|||
1b4b7faf38
|
|||
476976a4de
|
|||
93809b624f
|
|||
388a08aaf0
|
|||
7172f29183
|
|||
4cc230ceee
|
|||
21482ff439
|
|||
24634aae51
|
|||
8b27c853f4
|
|||
7388bbe104
|
|||
b4b6f8b54d
|
|||
355fddb665
|
|||
bcba31b8a0
|
|||
a455671a65
|
|||
554caccd4b
|
|||
c453e4fcd4
|
|||
e3fcbdf7cc
|
|||
1acef81bb7
|
|||
70308e2285
|
|||
053a3530b5
|
|||
a1cf6996cf
|
|||
c3a47c46b3
|
|||
21e4474341
|
|||
f875f32177
|
|||
506984b69c
|
|||
fe8a7209b3
|
|||
35a4e42433
|
|||
86896fdc2c
|
|||
422cedff86
|
|||
a085632759
|
|||
6029a95698
|
|||
a8de6477af
|
|||
f6ce1dedd6
|
|||
99aaf75110
|
|||
c327b62aa4
|
|||
48d6ea286c
|
|||
a5e865c29d
|
|||
9c8de3928e
|
|||
d845161287
|
|||
a8305e1b38
|
|||
fb6a1797a7
|
|||
620370f52b
|
|||
68996291d8
|
|||
6ace5534bf
|
|||
42d8101a92
|
|||
0ffbf781ed
|
|||
6f1e5e6fe6
|
|||
f60e983788
|
|||
7fe78254b3
|
|||
cef225ae95
|
|||
b05441973e
|
|||
c075bea216
|
|||
02a98be18e
|
|||
2a32037e1c
|
|||
e983d37e81
|
|||
e680e2d3c1
|
|||
98ee2b861a
|
|||
a31107dced
|
|||
6bc5bf97b1
|
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
*.md.pdf
|
||||
pdfimages
|
||||
|
11
blog/first_post.md
Executable file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
author: Akbar Rahman
|
||||
pub_date: Fri, 31 Jul 2020 19:52:52 +0100
|
||||
title: first post
|
||||
tags: []
|
||||
uuid: fd338dc9-ae5f-48f4-9fc6-e02e88ab4ce5
|
||||
---
|
||||
|
||||
# first post
|
||||
|
||||
this is my first post
|
182
blog/g27_pedals.md
Executable file
@@ -0,0 +1,182 @@
|
||||
---
|
||||
author: Akbar Rahman
|
||||
pub_date: Tue, 04 Aug 2020 15:20:13 +0100
|
||||
title: Repurposing Racing Wheel Pedals
|
||||
tags: [ g27, sim_racing ]
|
||||
uuid: 0f09200e-fd50-451b-aae1-1117a8a704db
|
||||
---
|
||||
|
||||
<h1>Repurposing Racing Wheel Pedals</h1>
|
||||
<p>I have a Logitech G27 I don't use much. I wondered if I could use it for anything else. I could. </p>
|
||||
|
||||
<h2> The Pinout of the Connector </h2>
|
||||
|
||||
<p>The first thing I had to do was figure out what each pin did on the DE-9 connector, and which
|
||||
ones I should care about.
|
||||
This was done easily after I took off the top plastic casing thing by poking the three 100k Ohm
|
||||
potentiometers and the connector in the right places at the right times:
|
||||
</p>
|
||||
|
||||
<style> #pinout_table tr td:first-child { text-align: right } </style>
|
||||
<img src="./images/repurposing-racing-wheel-pedals-g27-pinout.svg" class="centered" style="width: 10em;">
|
||||
<table id="pinout_table">
|
||||
<tr> <th>pin</th> <th>function</th></tr>
|
||||
<tr> <td>1,4</td> <td>ground</td></tr>
|
||||
<tr> <td>6</td> <td>clutch pedal</td></tr>
|
||||
<tr> <td>7</td> <td>brake pedal</td></tr>
|
||||
<tr> <td>8</td> <td>accelerator pedal</td></tr>
|
||||
<tr> <td>9</td> <td>voltage in</td></tr>
|
||||
</table>
|
||||
|
||||
<h2> Reading the Values of the Pots </h2>
|
||||
|
||||
I'm using an Arduino to read the pots and then do something with the values.
|
||||
I very dirtily wired pin 4 on the pedals to GND on a Arduino Uno, pin 9 to 5V, and
|
||||
pins 6,7,8 to A0, A1, and A2.
|
||||
I used a basic sketch to check that everything is good:
|
||||
|
||||
<details>
|
||||
<summary> Show/hide test_sketch.ino </summary>
|
||||
<pre><code> void setup() {
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Serial.println(analogRead(A2));
|
||||
delay(20);
|
||||
}
|
||||
</code></pre>
|
||||
</details>
|
||||
|
||||
I noticed that the minimum and maximum values read by the Uno were quite far off 0 and 1024, like
|
||||
they should be, and voltage was being lost on the way to and from the potentiometers.
|
||||
Since the pedals have to be calibrated every time you plug them in, I assume this is normal and
|
||||
spat out this code:
|
||||
|
||||
<details>
|
||||
<summary> Show/hide sketch_aug02a.ino </summary>
|
||||
<pre><code>// sensor pins
|
||||
int sa = A0;
|
||||
int sb = A1;
|
||||
int sc = A2;
|
||||
|
||||
// minimum values detected by the sensors
|
||||
int mina = 1025;
|
||||
int minb = 1025;
|
||||
int minc = 1025;
|
||||
|
||||
// maximum values detected by the sensors
|
||||
int maxa = 512;
|
||||
int maxb = 512;
|
||||
int maxc = 512;
|
||||
|
||||
// raw values of the sensors
|
||||
int rva, rvb, rvc;
|
||||
|
||||
// calculated values of the sensors (between 0 and 1, this is the value sent to computer)
|
||||
float cva, cvb, cvc;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
rva = analogRead(sa);
|
||||
rvb = analogRead(sb);
|
||||
rvc = analogRead(sc);
|
||||
|
||||
if (rva < mina) mina = rva;
|
||||
if (rvb < minb) minb = rvb;
|
||||
if (rvc < minc) minc = rvc;
|
||||
|
||||
if (rva > maxa) maxa = rva;
|
||||
if (rvb > maxb) maxb = rvb;
|
||||
if (rvc > maxc) maxc = rvc;
|
||||
|
||||
cva = (float)(rva-mina)/(float)(maxa-mina);
|
||||
cvb = (float)(rvb-minb)/(float)(maxb-minb);
|
||||
cvc = (float)(rvc-minc)/(float)(maxc-minc);
|
||||
|
||||
Serial.print('[');
|
||||
Serial.print(cva); Serial.print(',');
|
||||
Serial.print(cvb); Serial.print(',');
|
||||
Serial.print(cvc);
|
||||
Serial.print(']');
|
||||
Serial.println();
|
||||
delay(20);
|
||||
}
|
||||
</code></pre>
|
||||
</details>
|
||||
|
||||
<h2> Actually Making the Numbers Do Something </h2>
|
||||
|
||||
This is where you can make the pedals do fun things.
|
||||
I reworked another piece of code I wrote to do a similar thing to quickly create a script that
|
||||
reads the values sent by the Arduino, and then simulate pressing a key combination.
|
||||
The only thing I've done with this is set push-to-talk to ctrl-shift-alt-1.
|
||||
I don't know what else I could use this for, maybe temporarily muting particular things, like music.
|
||||
|
||||
<details>
|
||||
<summary> Show/hide pedalboard.py </summary>
|
||||
<pre><code> #!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import json
|
||||
import time
|
||||
from enum import Enum
|
||||
|
||||
import keyboard
|
||||
import serial
|
||||
|
||||
class KeyState(Enum):
|
||||
UP = 0
|
||||
DOWN = 1
|
||||
|
||||
STATES = [KeyState.UP] * 3
|
||||
THRESHOLD = 0.8
|
||||
MACROS = ['ctrl+shift+alt+1', 'ctrl+shift+alt+2', 'ctrl+shift+alt+3']
|
||||
|
||||
def get_args():
|
||||
""" Get command line arguments """
|
||||
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('device')
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main(args):
|
||||
""" Entry point for script """
|
||||
while True:
|
||||
try:
|
||||
kb = serial.Serial(port=args.device, baudrate=9600)
|
||||
while True:
|
||||
handle(json.loads(kb.readline()))
|
||||
except serial.serialutil.SerialException as e:
|
||||
print(e)
|
||||
print("Failed to connect to device... trying again")
|
||||
time.sleep(1)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return 0
|
||||
|
||||
def handle(data):
|
||||
global STATES
|
||||
|
||||
states = [KeyState.DOWN if value > THRESHOLD else KeyState.UP for value in data]
|
||||
r = [handle_state_change(i, states[i]) if states[i] != STATES[i] else None for i in range(len(STATES))]
|
||||
STATES = states
|
||||
return r
|
||||
|
||||
def handle_state_change(key, newstate):
|
||||
print(f"{key} {newstate}")
|
||||
return keyboard.press(MACROS[key]) if newstate == KeyState.DOWN else keyboard.release(MACROS[key])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
sys.exit(main(get_args()))
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(0)
|
||||
</code></pre>
|
||||
</details>
|
226
blog/images/repurposing-racing-wheel-pedals-g27-pinout.svg
Normal file
@@ -0,0 +1,226 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.0"
|
||||
width="68.148842"
|
||||
height="34.400002"
|
||||
viewBox="-138.624 -137.291 68.14884 34.400003"
|
||||
id="Layer_1"
|
||||
xml:space="preserve"
|
||||
sodipodi:docname="repurposing-racing-wheel-pedals-g27-pinout.svg"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"><title
|
||||
id="title1416">DE-9 Connector with numbers</title><metadata
|
||||
id="metadata1308"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title>DE-9 Connector with numbers</dc:title><dc:date>2020-08-02</dc:date><dc:creator><cc:Agent><dc:title>alvierahman90</dc:title></cc:Agent></dc:creator><cc:license
|
||||
rdf:resource="" /><dc:contributor><cc:Agent><dc:title>Original drawing from Mobius (maybe): https://commons.wikimedia.org/wiki/File:DSubminiatures.svg</dc:title></cc:Agent></dc:contributor></cc:Work></rdf:RDF></metadata><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1722"
|
||||
inkscape:window-height="1060"
|
||||
id="namedview1306"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:zoom="10.44492"
|
||||
inkscape:cx="27.994898"
|
||||
inkscape:cy="11.731109"
|
||||
inkscape:window-x="1056"
|
||||
inkscape:window-y="1094"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="Layer_1" /><defs
|
||||
id="defs2584">
|
||||
|
||||
|
||||
|
||||
|
||||
</defs>
|
||||
|
||||
<g
|
||||
id="g1336"
|
||||
transform="rotate(180,-104.54958,-120.091)"
|
||||
style="stroke:#454545;stroke-opacity:1"><g
|
||||
transform="translate(-193.19312,-267.013)"
|
||||
id="g2241"
|
||||
style="stroke:#454545;stroke-opacity:1">
|
||||
<circle
|
||||
cx="66.588997"
|
||||
cy="141.351"
|
||||
r="2.2409999"
|
||||
style="fill:none;stroke:#454545;stroke-opacity:1"
|
||||
id="circle2243" />
|
||||
<circle
|
||||
cx="77.617996"
|
||||
cy="141.351"
|
||||
r="2.2409999"
|
||||
style="fill:none;stroke:#454545;stroke-opacity:1"
|
||||
id="circle2245" />
|
||||
<circle
|
||||
cx="88.643997"
|
||||
cy="141.351"
|
||||
r="2.2379999"
|
||||
style="fill:none;stroke:#454545;stroke-opacity:1"
|
||||
id="circle2247" />
|
||||
<path
|
||||
d="m 99.668,139.11 c 1.238,0 2.242,1.004 2.242,2.241 0,1.237 -1.004,2.24 -2.242,2.24 -1.233,0 -2.237,-1.003 -2.237,-2.24 0,-1.237 1.004,-2.241 2.237,-2.241 z"
|
||||
style="fill:none;stroke:#454545;stroke-opacity:1"
|
||||
id="path2249"
|
||||
inkscape:connector-curvature="0" />
|
||||
<circle
|
||||
cx="110.697"
|
||||
cy="141.351"
|
||||
r="2.2409999"
|
||||
style="fill:none;stroke:#454545;stroke-opacity:1"
|
||||
id="circle2251" />
|
||||
<circle
|
||||
cx="72.102997"
|
||||
cy="152.491"
|
||||
r="2.2390001"
|
||||
style="fill:none;stroke:#454545;stroke-opacity:1"
|
||||
id="circle2253" />
|
||||
<circle
|
||||
cx="83.130997"
|
||||
cy="152.491"
|
||||
r="2.2390001"
|
||||
style="fill:none;stroke:#454545;stroke-opacity:1"
|
||||
id="circle2255" />
|
||||
<path
|
||||
d="m 94.156,150.252 c 1.237,0 2.238,1.003 2.238,2.237 0,1.237 -1.001,2.241 -2.238,2.241 -1.238,0 -2.242,-1.004 -2.242,-2.241 0,-1.234 1.004,-2.237 2.242,-2.237 z"
|
||||
style="fill:none;stroke:#454545;stroke-opacity:1"
|
||||
id="path2257"
|
||||
inkscape:connector-curvature="0" />
|
||||
<circle
|
||||
cx="105.185"
|
||||
cy="152.491"
|
||||
r="2.2390001"
|
||||
style="fill:none;stroke:#454545;stroke-opacity:1"
|
||||
id="circle2259" />
|
||||
</g><path
|
||||
d="m -129.54912,-136.791 c -5.609,0 -9.4,4.518 -8.425,10.042 l 2.354,13.309 c 0.976,5.525 6.366,10.049 11.975,10.049 h 38.191005 c 5.608,0 10.996,-4.523 11.975,-10.049 l 2.354,-13.309 c 0.975,-5.524 -2.813,-10.042 -8.425,-10.042 z"
|
||||
style="fill:none;stroke:#454545;stroke-opacity:1"
|
||||
id="path2261"
|
||||
inkscape:connector-curvature="0" /></g>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:6.98580647px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#454545;fill-opacity:1;stroke:none;stroke-width:0.17464516;stroke-opacity:1;"
|
||||
x="-123.37334"
|
||||
y="-129.7538"
|
||||
id="text1340"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1338"
|
||||
x="-123.37334"
|
||||
y="-129.7538"
|
||||
style="stroke-width:0.17464516;stroke:none;stroke-opacity:1;fill:#454545;fill-opacity:1;">1</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:6.98580647px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#454545;fill-opacity:1;stroke:none;stroke-width:0.17464516;stroke-opacity:1;"
|
||||
x="-112.29854"
|
||||
y="-129.7538"
|
||||
id="text1340-3"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1338-7"
|
||||
x="-112.29854"
|
||||
y="-129.7538"
|
||||
style="stroke-width:0.17464516;stroke:none;stroke-opacity:1;fill:#454545;fill-opacity:1;">2</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:6.98580647px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#454545;fill-opacity:1;stroke:none;stroke-width:0.17464516;stroke-opacity:1;"
|
||||
x="-101.2884"
|
||||
y="-129.7538"
|
||||
id="text1340-9"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1338-8"
|
||||
x="-101.2884"
|
||||
y="-129.7538"
|
||||
style="stroke-width:0.17464516;stroke:none;stroke-opacity:1;fill:#454545;fill-opacity:1;">3</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:6.98580647px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#454545;fill-opacity:1;stroke:none;stroke-width:0.17464516;stroke-opacity:1;"
|
||||
x="-90.565475"
|
||||
y="-129.7538"
|
||||
id="text1340-6"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1338-70"
|
||||
x="-90.565475"
|
||||
y="-129.7538"
|
||||
style="stroke-width:0.17464516;stroke:none;stroke-opacity:1;fill:#454545;fill-opacity:1;">4</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:6.98580647px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#454545;fill-opacity:1;stroke:none;stroke-width:0.17464516;stroke-opacity:1;"
|
||||
x="-129.24457"
|
||||
y="-105.27687"
|
||||
id="text1340-4"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1338-84"
|
||||
x="-129.24457"
|
||||
y="-105.27687"
|
||||
style="stroke-width:0.17464516;stroke:none;stroke-opacity:1;fill:#454545;fill-opacity:1;">5</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:6.98580647px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#454545;fill-opacity:1;stroke:none;stroke-width:0.17464516;stroke-opacity:1;"
|
||||
x="-117.9472"
|
||||
y="-105.27687"
|
||||
id="text1340-8"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1338-1"
|
||||
x="-117.9472"
|
||||
y="-105.27687"
|
||||
style="stroke-width:0.17464516;stroke:none;stroke-opacity:1;fill:#454545;fill-opacity:1;">6</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:6.98580647px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#454545;fill-opacity:1;stroke:none;stroke-width:0.17464516;stroke-opacity:1;"
|
||||
x="-106.88921"
|
||||
y="-105.27687"
|
||||
id="text1340-68"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1338-5"
|
||||
x="-106.88921"
|
||||
y="-105.27687"
|
||||
style="stroke-width:0.17464516;stroke:none;stroke-opacity:1;fill:#454545;fill-opacity:1;">7</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:6.98580647px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#454545;fill-opacity:1;stroke:none;stroke-width:0.17464516;stroke-opacity:1;"
|
||||
x="-94.538704"
|
||||
y="-105.27687"
|
||||
id="text1340-2"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1338-19"
|
||||
x="-94.538704"
|
||||
y="-105.27687"
|
||||
style="stroke-width:0.17464516;stroke:none;stroke-opacity:1;fill:#454545;fill-opacity:1;">8</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:6.98580647px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#454545;fill-opacity:1;stroke:none;stroke-width:0.17464516;stroke-opacity:1;"
|
||||
x="-83.91153"
|
||||
y="-105.27687"
|
||||
id="text1340-96"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1338-0"
|
||||
x="-83.91153"
|
||||
y="-105.27687"
|
||||
style="stroke-width:0.17464516;stroke:none;stroke-opacity:1;fill:#454545;fill-opacity:1;">9</tspan></text>
|
||||
</svg>
|
After Width: | Height: | Size: 8.6 KiB |
63
blog/lastfm_bookmarklets.md
Executable file
@@ -0,0 +1,63 @@
|
||||
---
|
||||
author: Akbar Rahman
|
||||
pub_date: Mon, 18 Sep 2023 16:25:48 +0100
|
||||
title: last.fm bookmarklets
|
||||
tags: [ last.fm, scripts ]
|
||||
uuid: e54ebf58-4033-4dae-81db-91db344f1311
|
||||
---
|
||||
|
||||
# last.fm bookmarklets
|
||||
|
||||
last.fm doesn't let you see how many scrobbled you've made in one day particularly easily.
|
||||
Here is a bookmarklet to solve that.
|
||||
|
||||
<label for="days"> Number of days to view: </label>
|
||||
<input type="number" value="1" id="days" placeholder="Days"/><br><br>
|
||||
<label for="offset"> Offset (e.g. 0 to include today, 7 to look at last week): </label>
|
||||
<input type="number" value="0" id="offset" placeholder="Offset (Days)" /><br><br>
|
||||
<label for="username"> last.fm username </label>
|
||||
<input type="text" value="" id="username" placeholder="Username" /><br><br>
|
||||
<input type="button" id="button" value="Generate bookmarklet"><br>
|
||||
|
||||
<p><a style="display: none" href="" id="scriptLink">Bookmark this link</a></p>
|
||||
|
||||
When you press generate bookmarklet, the values `OFFSET`, `DAYS`, `USERNAME` will be
|
||||
subsituted and put into the link above.
|
||||
It's always best to inspect bookmarklets though.
|
||||
Inspect the page to view the script used to generate the bookmarklet.
|
||||
|
||||
<textarea cols="109" rows="15" readonly id="scriptText">
|
||||
javascript: (() => {
|
||||
const MILLESECONDS_PER_DAY = 1000 * 24 * 60 * 60;
|
||||
const OFFSET;
|
||||
const DAYS;
|
||||
const USERNAME;
|
||||
|
||||
const currentDate = new Date();
|
||||
const to = new Date(currentDate - (OFFSET * MILLESECONDS_PER_DAY));
|
||||
const from = new Date(to - ((DAYS-1) * MILLESECONDS_PER_DAY));
|
||||
const toDate = to.getFullYear() + "-" + (to.getMonth()+1) + "-" + to.getDate();
|
||||
const fromDate = from.getFullYear() + "-" + (from.getMonth()+1) + "-" + from.getDate();
|
||||
|
||||
document.location = "https://www.last.fm/user/" + USERNAME + "/library?from=" + fromDate + "&to=" + toDate;
|
||||
})();
|
||||
</textarea>
|
||||
|
||||
<script>
|
||||
document.getElementById("button").addEventListener("click", () => {
|
||||
scriptText = document.getElementById("scriptText").value;
|
||||
offset = document.getElementById("offset").value;
|
||||
days = document.getElementById("days").value;
|
||||
username = document.getElementById("username").value;
|
||||
|
||||
newscript = scriptText.replace(
|
||||
"OFFSET", "OFFSET = " + offset
|
||||
).replace(
|
||||
"DAYS", "DAYS = " + days
|
||||
).replace(
|
||||
"USERNAME", "USERNAME = '" + username + "'"
|
||||
);
|
||||
document.getElementById("scriptLink").href = newscript;
|
||||
document.getElementById("scriptLink").style = "";
|
||||
});
|
||||
</script>
|
13
blog/readme.md
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
title: alv's blog
|
||||
author: Akbar Rahman
|
||||
pub_date: Fri, 31 Jul 2020 19:50:51 +0100
|
||||
blog: true
|
||||
tags: [ alvs_blog, blog ]
|
||||
uuid: 2d03893a-eb9b-4923-8024-a223ecbe72f7
|
||||
---
|
||||
|
||||
# alv's blog
|
||||
|
||||
this is my blog.
|
||||
i promise i will try to keep things posted here interesting.
|
@@ -2,7 +2,11 @@
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: Bash
|
||||
tags: [ linux, shell, programming ]
|
||||
tags:
|
||||
- linux
|
||||
- shell
|
||||
- programming
|
||||
uuid: a436d67a-1f07-45fb-9241-5dbaa69b4667
|
||||
---
|
||||
|
||||
# `set` builtin[^gnuset]
|
||||
|
57
computery_stuff/cadence_license_manager_null_parameter.md
Executable file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
author: Akbar Rahman
|
||||
date: \today
|
||||
title: "Cadence License Manager Install - `java.lang.IllegalArgumentException: :locationICompSelected: Null parameter - InstallComponent ID`"
|
||||
tags: [ cadence, license_manager, flexlm, java, errors ]
|
||||
uuid: a5f46736-1ab8-4da1-8737-95de51c95d50
|
||||
---
|
||||
|
||||
# Error
|
||||
|
||||
```
|
||||
[root@host Downloads]# iscape/bin/iscape.sh -batch majorAction=InstallFromArchive archiveDirectory=$(realpath LCU04.30.000_lnx86.Base) installDirectory=$(realpath target)
|
||||
Initializing InstallScape using JVM at /home/alvi/Downloads/iscape.04.23-s012/runtime/LNX86/bin/java. This might take some time...
|
||||
|
||||
WARNING: The DISPLAY environment variable has not been set.
|
||||
InstallScape might not initialize.
|
||||
|
||||
|
||||
InstallScape Installer (Batch Mode) - 04.23.s12
|
||||
|
||||
:locationICompSelected: Null parameter - InstallComponent ID
|
||||
java.lang.IllegalArgumentException: :locationICompSelected: Null parameter - InstallComponent ID
|
||||
at com.khanpur.installerng.ArchiveLocationManager.locationICompSelected(ArchiveLocationManager.java:143)
|
||||
at com.khanpur.installerng.Installer.archiveLocationICompSelected(Installer.java:1156)
|
||||
at com.khanpur.installer.gui.batch.BatchInstallfromarchive.execute(BatchInstallfromarchive.java:86)
|
||||
at com.khanpur.installer.gui.batch.BatchView.initialize(BatchView.java:329)
|
||||
at com.khanpur.installer.gui.batch.BatchView.<init>(BatchView.java:90)
|
||||
at com.khanpur.installer.gui.InstallerUINoSplash.showBatch(InstallerUINoSplash.java:325)
|
||||
at com.khanpur.installer.gui.BatchCommand.execute(BatchCommand.java:78)
|
||||
at com.khanpur.util.TransactionCommand.execute(TransactionCommand.java:74)
|
||||
at com.khanpur.util.Commandline.runCommands(Commandline.java:223)
|
||||
at com.khanpur.installer.gui.InstallerUINoSplash.processCommandLine(InstallerUINoSplash.java:340)
|
||||
at com.khanpur.installer.gui.InstallerUINoSplash.main(InstallerUINoSplash.java:372)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
|
||||
at java.lang.reflect.Method.invoke(Unknown Source)
|
||||
at com.khanpur.installer.gui.InstallerUI.main(InstallerUI.java:123)
|
||||
Failed with InstallScape JVM.
|
||||
Now loading System JVM...
|
||||
iscape/bin/iscape.sh: line 222: java: command not found
|
||||
Error:
|
||||
/usr/bin/which: no java in (/usr/local/bin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin)
|
||||
Could not use JVM packaged with Installcape. The Java in your path did not work or could not find Java in your path. Ensure that Java 1.6 or later is in your PATH environment variable and restart InstallScape.
|
||||
```
|
||||
|
||||
# Cause
|
||||
|
||||
Using the wrong filepath.
|
||||
The Cadence archives have subfolders to split the software between multiple CDs (a relic of the
|
||||
past perhaps).
|
||||
The actual folder to use is the CDs.
|
||||
|
||||
# Solution
|
||||
|
||||
Use the folder that contains the `.sdx` files (in my case, add `/CDROM1` onto end of
|
||||
`archiveDirectory`).
|
81
computery_stuff/cloudwatch_event_rule_lambda_ansible.md
Executable file
@@ -0,0 +1,81 @@
|
||||
---
|
||||
author: Akbar Rahman
|
||||
date: \today
|
||||
title: Eventbridge Rule (Cloudwatch Rule) Does Not Invoke Lambda When Configured Through Ansible
|
||||
tags:
|
||||
- ansible
|
||||
- aws
|
||||
- aws_eventbridge
|
||||
- aws_lambda
|
||||
- cloudwatch
|
||||
- eventbridge
|
||||
- lambda
|
||||
- permissions
|
||||
uuid: df3ca083-b6ae-4e35-bb1c-8b3978117c57
|
||||
---
|
||||
|
||||
# Eventbridge Rule (formerly Cloudwatch Rule) Does Not Invoke Lambda When Configured Through Ansible
|
||||
|
||||
## Problem
|
||||
|
||||
After creating an Eventbridge rule to run a Lambda function with the Ansible module
|
||||
[`amazon.aws.cloudwatchevent_rule`](https://docs.ansible.com/ansible/latest/collections/amazon/aws/cloudwatchevent_rule_module.html),
|
||||
the rule does not run Lambda function when it should:
|
||||
|
||||
```yaml
|
||||
- name: "Create lambda function"
|
||||
register: create_lambda
|
||||
amazon.aws.lambda:
|
||||
region: "{{ aws_ec2_region }}"
|
||||
description: "My Lambda function"
|
||||
name: "{{ lambda_name }}"
|
||||
role: "{{ iam_role.iam_role.arn }}"
|
||||
state: "present"
|
||||
timeout: 120
|
||||
vpc_security_group_ids: "{{ sec_group.group_id }}"
|
||||
vpc_subnet_ids: "{{ subnet_ids }}"
|
||||
image_uri: "{{ ecr.repository.repositoryUri }}:latest"
|
||||
- name: "Schedule my Lambda function"
|
||||
register: lambda_schedule_rule
|
||||
amazon.aws.cloudwatchevent_rule:
|
||||
name: "a_unique_rule_name"
|
||||
region: "{{ aws_ec2_region }}"
|
||||
schedule_expression: "rate(1 minute)"
|
||||
state: "present"
|
||||
targets:
|
||||
- arn: "{{ create_lambda.configuration.function_arn }}"
|
||||
id: "a_unique_id"
|
||||
input: "{{ eventbridge_rule_lambda_event_input }}"
|
||||
```
|
||||
|
||||
Even though creating a seemingly identical setup through the AWS console works fine.
|
||||
|
||||
## Cause
|
||||
|
||||
The Eventbridge rule is not allowed to invoke this Lambda, as it is not in the Lambda's policy.
|
||||
|
||||
## Solution
|
||||
|
||||
Use the
|
||||
[`amazon.aws.lambda_policy`](https://docs.ansible.com/ansible/latest/collections/amazon/aws/lambda_policy_module.html)
|
||||
module to allow the Eventbridge rule to invoke the Lambda.
|
||||
Note that, if specifying the Lambda function name to `function_name` (as opposed to the ARN of the
|
||||
Lambda function), you must specify `version` or otherwise the Lambda function still won't be run!
|
||||
|
||||
|
||||
```yaml
|
||||
- name: "Allow Eventbridge (Cloudwatch) Rules to invoke lambda"
|
||||
amazon.aws.lambda_policy:
|
||||
action: "lambda:InvokeFunction"
|
||||
function_name: "{{ lambda_name }}"
|
||||
state: "present"
|
||||
statement_id: "a_unique_statement_id"
|
||||
region: "{{ aws_ec2_region }}"
|
||||
principal: "events.amazonaws.com"
|
||||
source_arn: "{{ lambda_schedule_rule.rule.arn }}"
|
||||
version: "{{ create_lambda.configuration.version }}"
|
||||
```
|
||||
|
||||
|
||||
Solution found thanks to @david-kretch's answer to the same question at
|
||||
<https://stackoverflow.com/questions/45282939/cloudwatch-event-rule-creation-via-ansible-succeeds-but-not-invoked>.
|
@@ -2,7 +2,11 @@
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: Setting Up Nginx and Let's Encrypt in Docker
|
||||
tags: [ linux, docker, programming ]
|
||||
tags:
|
||||
- linux
|
||||
- docker
|
||||
- programming
|
||||
uuid: 2abad576-9921-463b-928d-2381f91488e0
|
||||
---
|
||||
|
||||
# Setting Up Nginx and Let's Encrypt in Docker
|
||||
|
12
computery_stuff/flask.md
Executable file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
author: Akbar Rahman
|
||||
date: \today
|
||||
title: Flask
|
||||
tags: [ python, flask, programming, docker ]
|
||||
uuid: e513ed96-cb19-4d4c-9894-e337c54659e5
|
||||
---
|
||||
|
||||
# Examples
|
||||
|
||||
- [alv.cx-glass](https://git.alv.cx/alvierahman90/alv.cx-glass) --- a pretty minimal example, probably not very production ready but has example of how to use in Docker
|
||||
- <https://flask.palletsprojects.com/> --- official documentation for Flask
|
@@ -2,7 +2,11 @@
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: Git
|
||||
tags: [ linux, programming, git ]
|
||||
tags:
|
||||
- linux
|
||||
- programming
|
||||
- git
|
||||
uuid: 8eb93ba5-72e8-4c25-b1f5-02e25408a14d
|
||||
---
|
||||
|
||||
|
||||
|
@@ -2,7 +2,11 @@
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: GNOME is a Whole Mess
|
||||
tags: [ gnome, linux, troubleshooting ]
|
||||
tags:
|
||||
- gnome
|
||||
- linux
|
||||
- troubleshooting
|
||||
uuid: 635199f2-f2c6-4f94-840f-8f729bde0c13
|
||||
---
|
||||
|
||||
Gnome is, like, a whole mess. These are the weird issues I had to solve.
|
||||
|
@@ -2,7 +2,10 @@
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: Go (golang)
|
||||
tags: [ golang, programming ]
|
||||
tags:
|
||||
- golang
|
||||
- programming
|
||||
uuid: 70d24c2e-25f6-4a46-9756-659d13b5149f
|
||||
---
|
||||
|
||||
# Getting Up to Speed With Go
|
||||
|
17
computery_stuff/jetson_nano.md
Executable file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
author: Akbar Rahman
|
||||
date: \today
|
||||
title: Jetson Nano
|
||||
tags: [ nvidia, jetson, jetson_nano, droidcam ]
|
||||
uuid: f312451a-2cd4-468a-9eef-ca9859c7cd1e
|
||||
---
|
||||
|
||||
|
||||
# installing Droidcam
|
||||
|
||||
figured out with help from <https://hizzely.hashnode.dev/instalasi-droidcam-cli-di-jetson-nano> :pray:
|
||||
|
||||
0. build and install libjpeg-turbo version 2.1.2 from github (cmake, make, make install)
|
||||
0. build droidcam (2.1.3 confirmed working) from source (make) and install (./install-client) (may need to set `PKG_CONFIG_PATH` environment varible to whatever libjpeg turbo installed at (for me, `/opt/libjpeg-turbo/lib64/pkgconfig`))
|
||||
0. install v4l2loopback-dkms with apt
|
||||
0. run droidcam (you may need to set `LD_LIBRARY_PATH` environment variable to wherever libjpeg-turbo installed to (for me, `/opt/libjpeg-turbo/lib64`))
|
@@ -2,7 +2,10 @@
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: libvirt
|
||||
tags: [ linux, virtualisation ]
|
||||
tags:
|
||||
- linux
|
||||
- virtualisation
|
||||
uuid: 62c2f458-f701-4075-8e12-d9b9a59efd1f
|
||||
---
|
||||
|
||||
# issues
|
||||
|
@@ -2,7 +2,9 @@
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: Linux
|
||||
tags: [ linux ]
|
||||
tags:
|
||||
- linux
|
||||
uuid: 8ef11516-4afd-4f80-abb8-bdce045e8b65
|
||||
---
|
||||
|
||||
# user stuff
|
||||
@@ -18,3 +20,47 @@ usermod -a -G group user
|
||||
```bash
|
||||
usermod -g group user
|
||||
```
|
||||
|
||||
# help i think my device shut down after deleting the current kernel and before installing the second (no entries in systemd-boot/grub/<bootloader>)
|
||||
|
||||
0. boot into a live usb of current disto
|
||||
1. mount the root partition to `/mnt` and the boot partition to the appropriate folder (check
|
||||
fstab which should be in `/mnt/etc/fstab`, if it says `/efi`, mount it to `/mnt/efi`)
|
||||
2. chroot into the mounted filesystem:
|
||||
|
||||
on arch based systems you can simply run:
|
||||
|
||||
```
|
||||
arch-chroot /mnt
|
||||
```
|
||||
|
||||
on non arch based systems[^1]:
|
||||
|
||||
```
|
||||
mount -t proc /proc /mnt/proc/
|
||||
mount -t sysfs /sys /mnt/ys/
|
||||
mount --rbind /dev /mnt/dev/
|
||||
# only if using uefi
|
||||
mount --rbind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars/
|
||||
# for internet access
|
||||
cp /etc/resolv.conf /mnt/etc/resolv.conf
|
||||
chroot /mnt /bin/bash
|
||||
```
|
||||
3. the system can now be force updated/kernel images can be generated
|
||||
|
||||
on arch based systems[^2]:
|
||||
|
||||
```
|
||||
# reinstall all current packages
|
||||
pacman -Qqen > /root/pkgs.txt # list all installed packages
|
||||
pacman -S $(< /root/pkgs.txt) # reinstall all installed packages
|
||||
rm /root/pkgs.txt # clean up
|
||||
|
||||
# reinstall dependencies (if there are issues)
|
||||
pacman -Qqdn > /root/deps.txt # list all installed dependencies
|
||||
pacman -S $(< /root/deps.txt) # reinstall all installed dependencies
|
||||
rm /root/deps.txt # clean up
|
||||
```
|
||||
|
||||
[^1]: https://wiki.archlinux.org/title/Chroot [wayback machine](https://web.archive.org/web/20240121115548/https://wiki.archlinux.org/title/Chroot)
|
||||
[^2]: https://bbs.archlinux.org/viewtopic.php?id=193174 [wayback machine](https://web.archive.org/web/20240129153400/https://bbs.archlinux.org/viewtopic.php?id=193174)
|
||||
|
30
computery_stuff/namecheap.md
Executable file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
author: Akbar Rahman
|
||||
date: \today
|
||||
title: Namecheap DNS
|
||||
tags: []
|
||||
uuid: d4d9fa2b-3d4c-44f7-a44d-12b0410be633
|
||||
---
|
||||
|
||||
# SRV Records not Showing up on DNS Servers
|
||||
|
||||
> There is a bug on Namecheap's DNS configuration interface.
|
||||
> When defining a SRV Record you must write the subdomain in the protocol box aswell.
|
||||
> After you save that entry, a visual bug kicks in and the protocol box now only shows the protocol
|
||||
> itself, but in the backend it's saved as protocol+subdomain, as it should be.
|
||||
>
|
||||
> ~ [exore13](https://www.spigotmc.org/threads/solved-multiple-servers-namecheap-srv-record-config.517697/)
|
||||
|
||||
|
||||
So say your SRV record looks something like this:
|
||||
|
||||
```
|
||||
_minecraft _tcp 0 5 25566 peen.mc.alv.cx.
|
||||
```
|
||||
|
||||
You'll have to enter this instead:
|
||||
|
||||
```
|
||||
_minecraft _tcp.peen.mc 0 5 25566 peen.mc.alv.cx.
|
||||
```
|
||||
|
19
computery_stuff/pdfs.md
Executable file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
author: Akbar Rahman
|
||||
date: \today
|
||||
title: PDFs
|
||||
tags: [ pdf, concatenate ]
|
||||
uuid: a43eac87-cb19-4c58-a285-cff04c494847
|
||||
---
|
||||
|
||||
# Concatenate PDFs from the Command Line
|
||||
|
||||
```
|
||||
qpdf t1.pdf --pages t1.pdf 1-z t2.pdf 1-z t3.pdf 1-z -- t.pdf
|
||||
```
|
||||
|
||||
```
|
||||
pdftk t1.pdf t2.pdf t3.pdf cat output t.pdf
|
||||
```
|
||||
|
||||
Original answer by pts [here](https://superuser.com/a/458188)
|
@@ -2,7 +2,9 @@
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: Postgres
|
||||
tags: [ programming ]
|
||||
tags:
|
||||
- programming
|
||||
uuid: 7e44b054-4b6e-4f8c-b9af-9d4c4bf77878
|
||||
---
|
||||
|
||||
\tableofcontents
|
||||
|
@@ -2,7 +2,14 @@
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: Pulseaudio
|
||||
tags: [ pulseaudio, linux, audio, mixing, microphone, sink ]
|
||||
tags:
|
||||
- pulseaudio
|
||||
- linux
|
||||
- audio
|
||||
- mixing
|
||||
- microphone
|
||||
- sink
|
||||
uuid: 4e251354-9afb-49fd-abd9-fedc9b280a25
|
||||
---
|
||||
|
||||
# Collect and Mix Sound Input From Different Sources {#paMixer}
|
||||
@@ -41,7 +48,7 @@ From <https://www.pclinuxos.com/forum/index.php/topic,119695.msg1159936.html#msg
|
||||
|
||||
This will unload _all_ loopback and null-sink modules.
|
||||
|
||||
### Destroy Specific Modules {#destsroyMixerSpecific}
|
||||
### Destroy Specific Modules {#destroyMixerSpecific}
|
||||
|
||||
>
|
||||
> pactl unload-module <module number>
|
||||
|
@@ -2,7 +2,12 @@
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: Python
|
||||
tags: [ docker, python, programming, io ]
|
||||
tags:
|
||||
- docker
|
||||
- python
|
||||
- programming
|
||||
- io
|
||||
uuid: cd5c50f9-66f4-4a3b-b89a-04a20ecd642b
|
||||
---
|
||||
|
||||
# Issues
|
||||
|
14
computery_stuff/uo_nottingham.md
Executable file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
author: Akbar Rahman
|
||||
date: \today
|
||||
title: University of Nottingham
|
||||
tags: [ uni ]
|
||||
uuid: d1b03938-c5b4-48ad-a258-78f96880aa4b
|
||||
---
|
||||
|
||||
### Trying to log into Microsoft 365 sends me to a different organisation's login page
|
||||
|
||||
Try one of these links:
|
||||
|
||||
- <https://pls.cx/uon_email> (a redirect to the link below)
|
||||
- <https://outlook.office.com/owa/nottingham.ac.uk>
|
25
computery_stuff/xps_15_9570.md
Executable file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: Dell XPS 15 (9570)
|
||||
tags:
|
||||
- dell
|
||||
- xps
|
||||
- xps_15
|
||||
- windows
|
||||
- drivers
|
||||
uuid: 489c3145-b3b8-43e0-b51c-c788977e2907
|
||||
---
|
||||
|
||||
# Installing Windows: A media driver your computer needs is missing.
|
||||
|
||||
> A media driver your computer needs is missing.
|
||||
> This could be a DVD, USB, or Hard disk driver.
|
||||
> If you have a CD, DVD, or USD flash drive with the driver on it, please insert it now.
|
||||
>
|
||||
> Note: If the installation media for Windows is in the DVD drive or on a USB you can safely remove
|
||||
> it for this step.
|
||||
|
||||
|
||||
A very misleading error indeed... turns out the issue may be that you need to use a dedicated
|
||||
[windows image flasher](https://github.com/WoeUSB/WoeUSB)...
|
@@ -6,4 +6,6 @@ cd `dirname $0`
|
||||
git pull
|
||||
cd ..
|
||||
rm -rf notes.alv.cx/*
|
||||
notes2web.py -o notes.alv.cx notes
|
||||
cd /root/gronk
|
||||
git pull
|
||||
docker compose up --build
|
||||
|
16
internal_link_checker.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
# used to alert me if i've written a bad internal link or broken one by changing a header
|
||||
|
||||
files="$(find $1 -name '*.html' -type f)"
|
||||
|
||||
for filename in $files
|
||||
do
|
||||
links="$(grep -oP '<a.*?>' -h $filename | grep -oP '(?<=href="\#).*?(?=")')"
|
||||
ids="$(grep -oP '(?<=id=").*?(?=")' -h $filename)"
|
||||
|
||||
for link in $links
|
||||
do
|
||||
[[ "$ids" == *"$link"* ]] \
|
||||
|| echo Found broken internal link in $filename: $link
|
||||
done
|
||||
done
|
10
readme.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: alv's notes
|
||||
base_url: https://notes.alv.cx
|
||||
---
|
||||
|
||||
# alv's notes
|
||||
|
||||
These are my personal notes. Correctness is not guaranteed.
|
||||
|
||||
Best viewed at [notes.alv.cx](https://notes.alv.cx).
|
12
styles.css
Normal file
@@ -0,0 +1,12 @@
|
||||
@import url("https://styles.alv.cx/fonts/comic-mono-font.css");
|
||||
@import url("https://styles.alv.cx/modules/dotgrid.css");
|
||||
@import url("https://styles.alv.cx/modules/alwaysdark.css");
|
||||
|
||||
:root {
|
||||
--dotgrid-size: 15em;
|
||||
--dotgrid-dot-size: 1px;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Comic Mono', monospace;
|
||||
}
|
1
uni/.n2w.yml
Normal file
@@ -0,0 +1 @@
|
||||
itags: [ uni ]
|
1
uni/mmme/.n2w.yml
Normal file
@@ -0,0 +1 @@
|
||||
itags: [ mmme ]
|
@@ -2,7 +2,15 @@
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: MMME1026 // Calculus
|
||||
tags: [ uni, nottingham, mechanical, engineering, mmme1026, maths, calculus ]
|
||||
tags:
|
||||
- uni
|
||||
- nottingham
|
||||
- mechanical
|
||||
- engineering
|
||||
- mmme1026
|
||||
- maths
|
||||
- calculus
|
||||
uuid: 126b21f8-e188-48f6-9151-5407f2b2b644
|
||||
---
|
||||
|
||||
# Calculus of One Variable Functions
|
||||
@@ -172,3 +180,604 @@ To draw the curve of an implicit function you have to rewrite it in the form $y
|
||||
There may be more than one $y$ value for each $x$ value.
|
||||
|
||||
</details>
|
||||
|
||||
# Differentiation
|
||||
|
||||
The derivative of the function $f(x)$ is denoted by:
|
||||
|
||||
$$f'(x) \text{ or } \frac{\mathrm{d}}{\mathrm dx} f(x)$$
|
||||
|
||||
Geometrically, the derivative is the gradient of the curve $y = f(x)$.
|
||||
|
||||
It is a measure of the rate of change of $f(x)$ as $x$ varies.
|
||||
|
||||
For example, velocity, $v$, is the rate of change of displacement, $s$, with respect to time, $t$,
|
||||
or:
|
||||
|
||||
$$v = \frac{\mathrm ds}{dt}$$
|
||||
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
#### Formal Definition
|
||||
|
||||
</summary>
|
||||
|
||||

|
||||
|
||||
As $h\rightarrow 0$, the clospe of the cord $\rightarrow$ slope of the tangent, or:
|
||||
|
||||
$$f'(x_0) = \lim_{h\rightarrow0}\frac{f(x_0+h) - f(x_0)}{h}$$
|
||||
|
||||
whenever this limit exists.
|
||||
|
||||
</details>
|
||||
|
||||
## Rules for Differentiation
|
||||
|
||||
### Powers
|
||||
|
||||
$$\frac{\mathrm d}{\mathrm dx} x^n = nx^{-1}$$
|
||||
|
||||
### Trigonometric Functions
|
||||
|
||||
$$\frac{\mathrm d}{\mathrm dx} \sin x = \cos x$$
|
||||
$$\frac{\mathrm d}{\mathrm dx} \cos x = \sin x$$
|
||||
|
||||
### Exponential Functions
|
||||
|
||||
$$\frac{\mathrm d}{\mathrm dx} e^{kx} = ke^{kx}$$
|
||||
|
||||
$$\frac{\mathrm d}{\mathrm dx} \ln kx^n = \frac n x$$
|
||||
|
||||
where $n$ and $k$ are constant.
|
||||
|
||||
### Linearity
|
||||
|
||||
$$\frac{\mathrm d}{\mathrm dx} (f + g) = \frac{\mathrm d}{\mathrm dx} f + \frac{\mathrm d}{\mathrm dx} g$$
|
||||
|
||||
### Product Rule
|
||||
|
||||
$$\frac{\mathrm d}{\mathrm dx} (fg) = \frac{\mathrm df}{\mathrm dx}g + \frac{\mathrm dg}{\mathrm dx}f$$
|
||||
|
||||
### Quotient Rule
|
||||
|
||||
$$ \frac{\mathrm d}{\mathrm dx} \frac f g = \frac 1 {g^2} \left( \frac{\mathrm df}{\mathrm dx} g - f \frac{\mathrm dg}{\mathrm dx} \right) $$
|
||||
|
||||
$$ \left( \frac f g \right)' = \frac 1 {g^2} (gf' - fg')$$
|
||||
|
||||
### Chain Rule
|
||||
|
||||
Let
|
||||
|
||||
$$f(x) = F(u(x))$$
|
||||
|
||||
$$ \frac{\mathrm df}{\mathrm dx} = \frac{\mathrm{d}F}{\mathrm du} \frac{\mathrm du}{\mathrm dx} $$
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
#### Example 1
|
||||
|
||||
Differentiate $f(x) = \cos{x^2}$.
|
||||
|
||||
</summary>
|
||||
|
||||
Let $u(x) = x^2$, $F(u) = \cos u$
|
||||
|
||||
$$ \frac{\mathrm df}{\mathrm dx} = -\sin u \cdot 2x = 2x\sin{x^2} $$
|
||||
|
||||
</details>
|
||||
|
||||
## L'Hôpital's Rule
|
||||
|
||||
l'Hôpital's rule provides a systematic way of dealing with limits of functions like
|
||||
$\frac{\sin x} x$.
|
||||
|
||||
Suppose
|
||||
|
||||
$$\lim_{x\rightarrow{a}} f(x) = 0$$
|
||||
|
||||
and
|
||||
|
||||
$$\lim_{x\rightarrow{a}} g(x) = 0$$
|
||||
|
||||
and we want $\lim_{x\rightarrow{a}} \frac{f(x)}{g(x)}$.
|
||||
|
||||
If
|
||||
|
||||
$$\lim_{x\rightarrow{a}} \frac{f'(x)}{g'(x)} = L $$
|
||||
|
||||
where any $L$ is any real number or $\pm \infty$, then
|
||||
|
||||
$$\lim_{x\rightarrow{a}} \frac{f(x)}{g(x)} = L$$
|
||||
|
||||
You can keep applying the rule until you get a sensible answer.
|
||||
|
||||
# Graphs
|
||||
|
||||
## Stationary Points
|
||||
|
||||
An important application of calculus is to find where a function is a maximum or minimum.
|
||||
|
||||

|
||||
|
||||
when these occur the gradient of the tangent to the curve, $f'(x) = 0$.
|
||||
The condition $f'(x) = 0$ alone however does not guarantee a minimum or maximum.
|
||||
It only means that point is a *stationary point*.
|
||||
|
||||
There are three main types of stationary points:
|
||||
|
||||
- maximum
|
||||
- minimum
|
||||
- point of inflection
|
||||
|
||||
### Local Maximum
|
||||
|
||||
The point $x = a$ is a local maximum if:
|
||||
|
||||
$$f'(a) = 0 \text{ and } f''(a) < 0$$
|
||||
|
||||
This is because $f'(x)$ is a decreasing function of $x$ near $x=a$.
|
||||
|
||||
### Local Minimum
|
||||
|
||||
The point $x = a$ is a local minimum if:
|
||||
|
||||
$$f'(a) = 0 \text{ and } f''(a) > 0$$
|
||||
|
||||
This is because $f'(x)$ is a increasing function of $x$ near $x=a$.
|
||||
|
||||
### Point of Inflection
|
||||
|
||||
$$f'(a) = 0 \text{ and } f''(a) = 0 \text { and } f'''(a) \ne 0$$
|
||||
|
||||
#### $f'''(a) > 0$
|
||||
|
||||

|
||||
|
||||
#### $f'''(a) < 0$
|
||||
|
||||

|
||||
|
||||
# Approximating with the Taylor series
|
||||
|
||||
The expansion
|
||||
|
||||
$$e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots$$
|
||||
|
||||
is an example of a *Taylor series*.
|
||||
These enable us to approximate a given function f(x) using a series which is often easier to
|
||||
calculate.
|
||||
Among other uses, they help us:
|
||||
|
||||
- calculate complicated function using simple arithmetic operations
|
||||
- find useful analytical approximations which work for $x$ near a given value
|
||||
(e.g. $e^x \approx 1 + x$ for $x$ near 0)
|
||||
- Understand the behaviour of a function near a stationary point
|
||||
|
||||
## Strategy
|
||||
|
||||
Suppose we know information about $f(x)$ only at the point $x=0$.
|
||||
How can we find out about $f$ for other values of $x$?
|
||||
|
||||
We could approximate the function by successive polynomials,
|
||||
each time matching more derivatives at $x=0$.
|
||||
|
||||
\begin{align*}
|
||||
g(x) = a_0 &\text{ using } f(0) \\
|
||||
g(x) = a_0 + a_1x &\text{ using } f(0), f'(0) \\
|
||||
g(x) = a_0 + a_1x + a_2x^2 &\text{ using } f(0), f'(0), f''(0) \\
|
||||
&\text{and so on...}
|
||||
\end{align*}
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
#### Example 1
|
||||
|
||||
For $x$ near 0, approximate $f(x) = \cos x$ by a quadratic.
|
||||
|
||||
</summary>
|
||||
|
||||
1. Set $f(0) = g(0$:
|
||||
|
||||
$$f(0) = 1 \rightarrow g(0) = a_0 = 1$$
|
||||
|
||||
2. Set $f'(0) = g'(0$:
|
||||
|
||||
$$f'(0) = -\sin0 = 0 \rightarrow g'(0) = a_1 = 0$$
|
||||
|
||||
3. Set $f''(0) = g''(0$:
|
||||
|
||||
$$f''(0) = -\cos = -1 \rightarrow g''(0) = 2a_2 = -1 \rightarrow a_2 = -0.5$$
|
||||
|
||||
So for $x$ near 0,
|
||||
|
||||
$$\cos x \approx 1 - \frac 1 2 x^2$$
|
||||
|
||||
Check:
|
||||
|
||||
$x$ | $\cos x$ | $1 - 0.5x^2$
|
||||
--- | -------- | ------------
|
||||
0.4 | 0.921061 | 0.920
|
||||
0.2 | 0.960066 | 0.980
|
||||
0.1 | 0.995004 | 0.995
|
||||
|
||||
</details>
|
||||
|
||||
## General Case
|
||||
|
||||
### Maclaurin Series
|
||||
|
||||
A Maclaurin series is a Taylor series expansion of a function about 0.
|
||||
|
||||
Any function $f(x)$ can be written as an infinite *Maclaurin Series*
|
||||
|
||||
$$f(x) = a_0 + a_1x + a_2x^2 + a_3x^2 + \cdots$$
|
||||
|
||||
where
|
||||
|
||||
$$a_0 = f(0) \qquad a_n = \frac 1 {n!} \frac{\mathrm d^nf}{\mathrm dx^n} \bigg|_{x=0}$$
|
||||
|
||||
($|_{x=0}$ means evaluated at $x=0$)
|
||||
|
||||
### Taylor Series
|
||||
|
||||
We may alternatively expand about any point $x=a$ to give a Taylor series:
|
||||
|
||||
\begin{align*}
|
||||
f(x) = &f(a) + (x-a)f'(a) \\
|
||||
& + \frac 1 {2!}(x-a)^2f''(a) \\
|
||||
& + \frac 1 {3!}(x-a)^3f'''(a) \\
|
||||
& + \cdots + \frac 1 {n!}(x-a)^nf^{(n)}(a)
|
||||
\end{align*}
|
||||
|
||||
a generalisation of a Maclaurin series.
|
||||
|
||||
An alternative form of Taylor series is given by setting $x = a+h$ where $h$ is small:
|
||||
|
||||
$$f(a+h) = f(a) + hf'(a) + \cdots + \frac 1 {n!}h^nf^{(n)}(a) + \cdots$$
|
||||
|
||||
|
||||
## Taylor Series at a Stationary Point
|
||||
|
||||
If f(x) has a stationary point at $x=a$, then $f'(a) = 0$ and the Taylor series begins
|
||||
|
||||
$$f(x) = f(a) + \frac 1 2 f''(a)(x-a)^2 + \cdots$$
|
||||
|
||||
- If $f''(a) > 0$ then the quadratic part makes the function increase going away from $x=a$ and we
|
||||
have a minimum
|
||||
- If $f''(a) < 0$ then the quadratic part makes the function decrease going away from $x=a$ and we
|
||||
have a maximum
|
||||
- If $f''(a) = 0$ then we must include a higer order terms to determine what happens
|
||||
have a minimum
|
||||
|
||||
# Integration
|
||||
|
||||
Integration is the reverse of [differentiation](#differentiation).
|
||||
|
||||
Take velocity and displacement as an example:
|
||||
|
||||
$$\int\! v \mathrm dt = s + c$$
|
||||
|
||||
where $c$ is the constant of integration, which is required for
|
||||
[indefinite integrals](#indefinite-integrals).A
|
||||
|
||||
## Definite Integrals
|
||||
|
||||
The definite integral of a function $f(x)$ in the range $a \le x \le b$ is denoted be:
|
||||
|
||||
$$\int^b_a \! f(x) \,\mathrm dx$$
|
||||
|
||||
If $f(x) = F'(x)$ ($f(x)$ is the derivative of $F(x)$) then
|
||||
|
||||
$$\int^b_a \! f(x) \,\mathrm dx = \left[F(x)\right]^b_a = F(b) - F(a)$$
|
||||
|
||||
## Area and Integration
|
||||
|
||||
Approximate the area under a smooth curve using a large number of narrow rectangles.
|
||||
|
||||

|
||||
|
||||
Area under curve $\approx \sum_{n} f(x_n)\Delta x_n$.
|
||||
|
||||
As the rectangles get more numerous and narrow, the approximation approaches the real area.
|
||||
|
||||
The limiting value is denoted
|
||||
|
||||
$$\approx \sum_{n} f(x_n)\Delta x_n \rightarrow \int^b_a\! f(x) \mathrm dx$$
|
||||
|
||||
This explains the notation used for integrals.
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
#### Example 1
|
||||
|
||||
Calculate the area between these two curves:
|
||||
|
||||
\begin{align*}
|
||||
y &= f_1(x) = 2 - x^2 \\
|
||||
y &= f_2(x) = x
|
||||
\end{align*}
|
||||
|
||||
</summary>
|
||||
|
||||

|
||||
|
||||
1. Find the crossing points $P$ and $Q$
|
||||
|
||||
\begin{align*}
|
||||
f_1(x) &= f_2(x) \\
|
||||
x &= 2-x^2 \\
|
||||
x &= 1 \\
|
||||
x &= -2
|
||||
\end{align*}
|
||||
|
||||
2. Since $f_1(x) \ge f_2(x)$ between $P$ and $Q$
|
||||
|
||||
\begin{align*}
|
||||
A &= \int^1_{-2}\! (f_1(x) - f_2(x)) \mathrm dx \\
|
||||
&= \int^1_{-2}\! (2 - x^2 - x) \mathrm dx \\
|
||||
&= \left[ 2x - \frac 13 x^3 - \frac 12 x^2 \right]^1_{-2} \\
|
||||
&= \left(2 - \frac 13 - \frac 12 \right) - \left( -4 + \frac 83 - \frac 42 \right) \\
|
||||
&= \frac 92
|
||||
\end{align*}
|
||||
|
||||
</details>
|
||||
|
||||
## Techniques for Integration
|
||||
|
||||
Integration requires multiple techniques and methods to do correctly because it is a PITA.
|
||||
|
||||
These are best explained by examples so try to follow those rather than expect and explanation.
|
||||
|
||||
### Integration by Substitution
|
||||
|
||||
Integration but substitution lets us integrate functions of functions.
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
#### Example 1
|
||||
|
||||
Find
|
||||
|
||||
$$I = \int\!(5x - 1)^3 \mathrm dx$$
|
||||
|
||||
</summary>
|
||||
|
||||
1. Let $w(x) = 5x - 1$
|
||||
2.
|
||||
\begin{align*}
|
||||
\frac{\mathrm d}{\mathrm dx} w &= 5 \\
|
||||
\frac 15 \mathrm dw &= \mathrm dx
|
||||
\end{align*}
|
||||
|
||||
3. The integral is then
|
||||
|
||||
\begin{align*}
|
||||
I &= \int\! w^3 \frac 15 \mathrm dw \\
|
||||
&= \frac 15 \cdot \frac 14 \cdot w^4 + c \\
|
||||
&= \frac{1}{20}w^4 + c
|
||||
\end{align*}
|
||||
|
||||
4. Finally substitute $w$ out
|
||||
|
||||
$$I = \frac{(5x-1)^4}{20} + c$$
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
#### Example 2
|
||||
|
||||
Find
|
||||
|
||||
$$I = \int\! \cos x \sqrt{\sin x + 1} \mathrm dx$$
|
||||
|
||||
</summary>
|
||||
|
||||
1. Let
|
||||
|
||||
$$w(x) = \sin x + 1$$
|
||||
|
||||
2. Then
|
||||
|
||||
\begin{align*}
|
||||
\frac{\mathrm d}{\mathrm dx} w = \cos x \\
|
||||
\mathrm dw = \cos x \mathrm dx \\
|
||||
\end{align*}
|
||||
|
||||
3. The integral is now
|
||||
|
||||
\begin{align*}
|
||||
I &= \int\! \sqrt w \,\mathrm dw \\
|
||||
&= \int\! w^{\frac12} \,\mathrm dw \\
|
||||
&= \frac23w^{\frac32} + c
|
||||
\end{align*}
|
||||
|
||||
4. Finally substitute $w$ out to get:
|
||||
|
||||
$$I = \frac23 (\sin x + 1)^{\frac32} + c$$
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
#### Example 3
|
||||
|
||||
Find
|
||||
|
||||
$$I = \int^{\frac\pi2}_0\! \cos x \sqrt{\sin x + 1} \,\mathrm dx$$
|
||||
|
||||
</summary>
|
||||
|
||||
1. Use the previous example to get to
|
||||
|
||||
$$I = \int^2_1\! \sqrt w \,\mathrm dw = \frac23w^{\frac32} + c$$
|
||||
|
||||
2. Since $w(x) = \sin x + 1$ the limits are:
|
||||
|
||||
\begin{align*}
|
||||
x = 0 &\rightarrow w = 1\\
|
||||
x = \frac\pi2 &\rightarrow w = 2
|
||||
\end{align*}
|
||||
|
||||
3. This gives us
|
||||
|
||||
$$I = \left[ \frac23w^{\frac32} \right]^2_1 = \frac23 (2^{\frac23} = 1)$$
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
#### Example 4
|
||||
|
||||
Find
|
||||
|
||||
$$I = \int^1_0\! \sqrt{1 - x^2} \,\mathrm dx$$
|
||||
|
||||
</summary>
|
||||
|
||||
1. Try a trigonmetrical substitution:
|
||||
|
||||
\begin{align*}
|
||||
x &= \sin w \\
|
||||
\\
|
||||
\frac{\mathrm dx}{\mathrm dw} = \cos w \\
|
||||
\mathrm dx = \cos 2 \,\mathrm dw \\
|
||||
\end{align*}
|
||||
|
||||
2.
|
||||
|
||||
\begin{align*}
|
||||
x=0 &\rightarrow w=0 \\
|
||||
x=1 &\rightarrow w=\frac\pi2
|
||||
\end{align*}
|
||||
|
||||
3. Therefore
|
||||
|
||||
\begin{align*}
|
||||
I &= \int^{\frac\pi2}_0\! \sqrt{1 - \sin^2 w} \cos w \,\mathrm dw \\
|
||||
&= \int^{\frac\pi2}_0\! \cos^w w \,\mathrm dw
|
||||
\end{align*}
|
||||
|
||||
But $\cos(2w) = 2\cos^2w - 1$ so:
|
||||
|
||||
$$\cos^2w = \frac12 \cos(2w) + \frac12$$
|
||||
|
||||
|
||||
Hence
|
||||
|
||||
\begin{align*}
|
||||
I &= \int^{\frac\pi2}_0\! \frac12 \cos(2w) + \frac12 \,\mathrm dw \\
|
||||
&= \left[ \frac14 \sin(2w) + \frac w2 \right]^{\frac\pi2}_0 \\
|
||||
&= \left( \frac14 \sin\pi + \frac\pi4 \right) - 0 \\
|
||||
&= \frac\pi4
|
||||
\end{align*}
|
||||
|
||||
### Integration by Parts
|
||||
|
||||
$$uv = \int\! u\frac{\mathrm dv}{\mathrm dx} \,\mathrm dx + \int\! \frac{\mathrm du}{\mathrm dx}v \,\mathrm dx$$
|
||||
|
||||
or
|
||||
|
||||
$$\int\! u\frac{\mathrm dv}{\mathrm dx} \,\mathrm dx = uv - \int\! \frac{\mathrm du}{\mathrm dx}v \,\mathrm dx$$
|
||||
|
||||
This technique is derived from integrating the product rule.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
#### Example 1
|
||||
|
||||
Find
|
||||
|
||||
$$I = \int\! \ln x \,\mathrm dx$$
|
||||
|
||||
</summary>
|
||||
|
||||
1. Use
|
||||
|
||||
$$\int\! u\frac{\mathrm dv}{\mathrm dx} \,\mathrm dx = uv - \int\! \frac{\mathrm du}{\mathrm dx}v \,\mathrm dx$$
|
||||
|
||||
2. Set $u = \ln x$
|
||||
and $v' = 1$.
|
||||
|
||||
3. This means that $u' = \frac1x$ and $v = x$.
|
||||
4.
|
||||
|
||||
\begin{align*}
|
||||
I &= x\ln x - \int\! x\cdot\frac1x \,\mathrm dx + c \\
|
||||
&= x\ln x - \int\! \,\mathrm dx + c \\
|
||||
&= x\ln x - x + c \\
|
||||
\end{align*}
|
||||
|
||||
</details>
|
||||
|
||||
# Application of Integration
|
||||
|
||||
## Differential Equations
|
||||
|
||||
Consider the equation
|
||||
|
||||
$$\frac{\mathrm dy}{\mathrm dx} = y^2$$
|
||||
|
||||
To find $y$, is not a straightforward integration:
|
||||
|
||||
$$y = \int\!y^2 \,\mathrm dx$$
|
||||
|
||||
The equation above does not solve for $y$ as we can't integrate the right until we know $y$...
|
||||
which is what we're trying to find.
|
||||
|
||||
This is an example of a first order differential equation.
|
||||
The general form is:
|
||||
|
||||
$$\frac{\mathrm dy}{\mathrm dx} = F(x, y)$$
|
||||
|
||||
### Separable Differential Equations
|
||||
|
||||
A first order diferential equation is called *separable* if it is of the form
|
||||
|
||||
$$\frac{\mathrm dy}{\mathrm dx} = f(x)g(y)$$
|
||||
|
||||
We can solve these by rearranging:
|
||||
|
||||
$$\frac1{g(y} \cdot \frac{\mathrm dy}{\mathrm dx} = f(x)$$
|
||||
|
||||
$$\int\! \frac1{g(y)} \,\mathrm dy = \int\! f(x) \,\mathrm dx + c$$
|
||||
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
#### Example 1
|
||||
|
||||
Find $y$ such that
|
||||
|
||||
$$\frac{\mathrm dy}{\mathrm dx} = ky$$
|
||||
|
||||
where $k$ is a constant.
|
||||
|
||||
</summary>
|
||||
|
||||
Rearrange to get
|
||||
|
||||
\begin{align*}
|
||||
\int\! \frac1y \,\mathrm dy &= \int\! k \mathrm dx + c \\
|
||||
\ln y &= kx + c \\
|
||||
y &= e^{kx + c} = e^ce^{kx} \\
|
||||
&= Ae^{kx}
|
||||
\end{align*}
|
||||
|
||||
where $A = e^c$ is an arbitrary constant.
|
||||
|
||||
</details>
|
||||
|
@@ -2,7 +2,15 @@
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: MMME1026 // Complex Numbers
|
||||
tags: [ uni, nottingham, mechanical, engineering, mmme1026, maths, complex_numbers ]
|
||||
tags:
|
||||
- uni
|
||||
- nottingham
|
||||
- mechanical
|
||||
- engineering
|
||||
- mmme1026
|
||||
- maths
|
||||
- complex_numbers
|
||||
uuid: b9be8780-1ab7-402f-9c67-8cc74a74f7a9
|
||||
---
|
||||
|
||||
# Complex Numbers
|
||||
@@ -30,11 +38,11 @@ tags: [ uni, nottingham, mechanical, engineering, mmme1026, maths, complex_numbe
|
||||
|
||||
Given complex number $z$:
|
||||
|
||||
$$z = z + iy$$
|
||||
$$z = x + iy$$
|
||||
|
||||
The complex conjugate of z, $\bar z$ is:
|
||||
|
||||
$$\bar{z} = z -iy$$
|
||||
$$\bar{z} = x -iy$$
|
||||
|
||||
### Division of Complex Numbers
|
||||
|
||||
|
64
uni/mmme/1026_maths_for_engineering/eigenvalues.md
Executable file
@@ -0,0 +1,64 @@
|
||||
---
|
||||
author: Akbar Rahman
|
||||
date: \today
|
||||
title: MMME1026 // Eigenvalues
|
||||
tags: [ mmme1026, maths, eigenvalues, uni ]
|
||||
uuid: f2220395-bc97-432e-a1d2-74085f16991d
|
||||
---
|
||||
|
||||
An eigenvalue problem takes the form:
|
||||
|
||||
Find all the values of $\lambda$ for which the equation
|
||||
|
||||
$$A\pmb{x} = \lambda \pmb{x}$$
|
||||
|
||||
has a nonzero solution $\pmb x$, where $A$ is an $n\times n$ matrix and
|
||||
$\pmb x$ is a column vector.
|
||||
|
||||
The equation may be written as
|
||||
|
||||
\begin{align*}
|
||||
A\pmb x &= \lambda I \pmb x \\
|
||||
\Leftrightarrow A \pmb x - \lambda I \pmb x & = 0 \\
|
||||
\Leftrightarrow (A-\lambda I)\pmb x &= 0
|
||||
\end{align*}
|
||||
|
||||
($\Leftrightarrow$ means "if and only if")
|
||||
|
||||
Non-zero solutions will exist if
|
||||
|
||||
$\det(A-\lambda I) = 0$
|
||||
|
||||
There are infinitely many eigenvectors for a given eigenvalue.
|
||||
This is because if $\pmb x$ is an eigenvector of $A$ corresponding to the
|
||||
eigenvalue $\lambda$ and $c$ is a non-zero scalar, then $c\pmb x$ is also
|
||||
an eigenvector of $A$:
|
||||
|
||||
$$A(c\pmb x) = cA\pmb x = c\lambda \pmb x = \lambda(c\pmb x)$$
|
||||
|
||||
In general, if $A$ is an $n\times n$ matrix, then $|A-\lambda I|$ is a
|
||||
polynomial of degree $n$ in $\lambda$, called the characteristic polynomial.
|
||||
The characteristic equation is:
|
||||
|
||||
$$\lambda^n + c_{n-1}\lambda^{n-1} + c_{n-2}\lambda^{n-2} + \cdots + c_0 = 0$$
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
#### Example 1 ($2\times2$ example)
|
||||
|
||||
</summary>
|
||||
|
||||
If $A$ is the matrix
|
||||
|
||||
$$A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$$
|
||||
|
||||
then
|
||||
|
||||
$$|A - \lambda I| = \lambda^2 - (a+d)\lambda + (ad-bc)$$
|
||||
|
||||
And the standard method for solving a quadratic can be used to find $\lambda$.
|
||||
|
||||
</details>
|
||||
|
||||
|
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 891 B |
After Width: | Height: | Size: 180 B |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 11 KiB |
@@ -2,7 +2,16 @@
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: MMME1026 // Systems of Equations and Matrices
|
||||
tags: [ uni, nottingham, mechanical, engineering, mmme1026, maths, systems_of_equations, matrices ]
|
||||
tags:
|
||||
- uni
|
||||
- nottingham
|
||||
- mechanical
|
||||
- engineering
|
||||
- mmme1026
|
||||
- maths
|
||||
- systems_of_equations
|
||||
- matrices
|
||||
uuid: 16edb140-9946-4759-93df-50cad510fe31
|
||||
---
|
||||
# Systems of Equations (Simultaneous Equations)
|
||||
|
||||
|
322
uni/mmme/1026_maths_for_engineering/vectors.md
Executable file
@@ -0,0 +1,322 @@
|
||||
---
|
||||
author: Akbar Rahman
|
||||
date: \today
|
||||
title: MMME1026 // Vectors
|
||||
tags:
|
||||
- uni
|
||||
- nottingham
|
||||
- mechanical
|
||||
- engineering
|
||||
- mmme1026
|
||||
- maths
|
||||
- vectors
|
||||
uuid: ef1669d9-b8c3-4813-8b33-5764a2f57a55
|
||||
---
|
||||
|
||||
Vectors have a *magnitude* (size) and *direction*.
|
||||
Examples of vectors include force, velocity, and acceleration.
|
||||
|
||||
In type, vectors are notated in **bold**: $\pmb{a}$.
|
||||
In handwriting is is \underline{underlined}.
|
||||
|
||||
# Vector Algebra
|
||||
|
||||
## Equality
|
||||
|
||||
Two vectors are said to be equal if their magnitudes and directions are equal.
|
||||
|
||||
You can also do this by checking if their vertical and horizontal components are equal.
|
||||
|
||||
## Addition
|
||||
|
||||
Two vectors, $\pmb{a}$ and $\pmb{b}$, can be summed together by summing their components.
|
||||
|
||||
You can also do this graphically by drawing $\pmb{a}$ and then $\pmb{b}$ by putting its tail on
|
||||
the tip of $\pmb{a}$.
|
||||
The sum of the vectors is from the tail of $\pmb{a}$ to the tip of $\pmb{b}$:
|
||||
|
||||

|
||||
|
||||
Vector addition is associative[^d_associative] and commutative[^d_commutative].
|
||||
|
||||
## Zero Vector
|
||||
|
||||
The *zero vector* is denoted by $\pmb{0}$ and has zero magnitude and arbitrary direction.
|
||||
|
||||
$$\pmb{a} + \pmb 0 = \pmb a$$
|
||||
|
||||
If $\pmb a + \pmb b = 0$ then it is normal to write
|
||||
|
||||
|
||||
$$\pmb b = -\pmb a$$
|
||||
|
||||
$-\pmb a$ is a vector with the same magnitude to $\pmb a$ but opposite direction.
|
||||
|
||||
## Multiplication
|
||||
|
||||
### Multiplication by a Scalar
|
||||
|
||||
Let $k$, an arbitrary scalar and $\pmb a$, an arbitrary vector.
|
||||
|
||||
- $k\pmb a$ is a vector of magnitude $|k|$ times that of $\pmb a$ and is parralel to it
|
||||
- $0\pmb a = 0$
|
||||
- $1\pmb a = a$
|
||||
- $(-k)\pmb a = -(k\pmb a)$
|
||||
- $(-1)\pmb a = -\pmb a$
|
||||
- $k(\pmb a + \pmb b) = k\pmb a + k\pmb b$
|
||||
- $(k_1 + k_2)\pmb a = k_1\pmb a + k_2\pmb a$
|
||||
- $(k_1k_2)\pmb a = k_1(k_2\pmb a)$
|
||||
|
||||
### The Scalar Product (Inner Product, Dot Product)
|
||||
|
||||
The scalar product of two vectors $\pmb a$ and $\pmb b$ is a scalar defined by
|
||||
|
||||
$$\pmb a \cdot \pmb b = |\pmb a||\pmb b|\cos\theta = a_1b_1 + a_2b_2 + a_3b_3$$
|
||||
|
||||
where $\pmb a = (a_1, a_2, a_3)$ and $\pmb b = (b_1, b_2, b_3)$
|
||||
|
||||
where $\theta$ is the angle between the two vectors (note that $\cos\theta = \cos(2\pi - \theta)$).
|
||||
This definition does not depend on a coordinate system.
|
||||
|
||||
- The dot product is commutative[^d_commutative]
|
||||
- The dot product is distributive[^d_distributive]
|
||||
- If $\pmb a$ is perpendicular to $\pmb b$, then $\pmb a \cdot \pmb b = 0$ and they are said to be
|
||||
orthogonal
|
||||
- If $\pmb a \cdot \pmb b = 0$ then either
|
||||
|
||||
i. The vectors are orthogonal
|
||||
ii. One or both of the vectorse are zero vectors
|
||||
|
||||
- $\pmb a \cdot \pmb a = |\pmb a|^2 = a^2$
|
||||
|
||||
The base vectors are said to be *orthonormal* when $\pmb i^2 = \pmb j^2 = \pmb k^2 = 1$ and
|
||||
$i\cdot j = i\cdot k = j\cdot k = 0$.
|
||||
|
||||
### The Vector Product (Cross Product)
|
||||
|
||||
The vector product between two vectors is defined by:
|
||||
|
||||
$$\pmb a \times \pmb b = |\pmb a||\pmb b|\sin\theta \hat{\pmb n}$$
|
||||
|
||||
where $0 \le \theta \le \pi$ is the angle between $\pmb a$ and $\pmb b$ and $\pmb n$ is a unit
|
||||
vector such that the three vectors from a right handed system:
|
||||
|
||||

|
||||
|
||||
- $\pmb a \times \pmb b = -\pmb b \times \pmb a$ (the vector product is anti-commutative[^d_commutative])
|
||||
- If $\pmb a \times \pmb b = 0$ then either
|
||||
|
||||
i. The vectors are parallel
|
||||
ii. One or both of the vectors are a zero vector
|
||||
|
||||
- $(k_1\pmb a)\times(k_2\pmb b) = (k_1k_2)(\pmb a \times \pmb b)$ where $k_1$, $k_2$ are scalars
|
||||
- If $\pmb a = (a_1, a_2, a_3)$ and $\pmb b = (b_1, b_2, b_3)$ then
|
||||
|
||||
$$\pmb a \times \pmb b = (a_2b_3 - a_3b_2, a_1b_3-a_3b_1, a_1b_2-a_2b_1)$$
|
||||
|
||||
- In the notation of determinants, provided we **expand by row 1**:
|
||||
|
||||
$$\pmb a \times \pmb b = \begin{vmatrix} \pmb i & \pmb j & \pmb k \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{vmatrix}$$
|
||||
|
||||
This is technically not a determinant because not all the elements are numbers but shhhhhh...
|
||||
|
||||
|
||||
### Scalar Triple Product (and co-planar vectors)
|
||||
|
||||
\begin{align*}
|
||||
[ \pmb a, \pmb b, \pmb c ] &= \pmb a \cdot (\pmb b \times \pmb c) \\
|
||||
&= \pmb b \cdot (\pmb c \times \pmb a) \\
|
||||
&= \pmb c \cdot (\pmb a \times \pmb b) \\
|
||||
&= (\pmb b \times \pmb c) \cdot \pmb a \\
|
||||
&= (\pmb c \times \pmb a) \cdot \pmb b \\
|
||||
&= (\pmb a \times \pmb b) \cdot \pmb c
|
||||
\end{align*}
|
||||
|
||||
In terms of determinants:
|
||||
|
||||
$$
|
||||
[ \pmb a, \pmb b, \pmb c ] = \begin{vmatrix}
|
||||
a_1 & a_2 & a_3 \\
|
||||
b_1 & b_2 & b_3 \\
|
||||
c_1 & c_2 & c_3
|
||||
\end{vmatrix}
|
||||
$$
|
||||
|
||||
If $[\pmb a, \pmb b, \pmb c] = 0$ then the vectors are coplanar.
|
||||
|
||||
The absolute value of the scalar triple product reperesents the volume of the parallelepiped defined
|
||||
by those vectors:
|
||||
|
||||

|
||||
|
||||
|
||||
## The Unit Vector
|
||||
|
||||
$$\hat{\pmb a}= \frac{\pmb a}{|\pmb a|}$$
|
||||
|
||||
## Components of a Vector
|
||||
|
||||
The component of a vector $\pmb a$ in the direction of the **unit vector** $\hat{\pmb n}$ is
|
||||
|
||||
$$\pmb a \cdot \hat{\pmb n}$$
|
||||
|
||||

|
||||
|
||||
Vectors are often written in terms of base vectors, such as the Cartesian system's $\pmb i$,
|
||||
$\pmb j$, and $\pmb k$ in three dimensions.
|
||||
|
||||

|
||||
|
||||
These vectors have unit magnitude, are perpendicular to each other, and are right handed.
|
||||
|
||||
If $\pmb a = a_1\pmb i + a_2\pmb j + a_3\pmb k$ then the scalars $a_1$, $a_2$, and $a_3$ are the
|
||||
*components* of the vector (relative to the base vectors).
|
||||
|
||||
### Vector Projections
|
||||
|
||||
The *vector projection* of $\pmb a$ onto $\hat{\pmb n}$ is given by
|
||||
|
||||
$$(\pmb a \cdot \hat{\pmb n})\hat{\pmb n}$$
|
||||
|
||||

|
||||
|
||||
They look like the same as [vector components](#components-of-a-vector) to me...
|
||||
no idea what the difference is but uh StackExchange says
|
||||
([permalink](https://physics.stackexchange.com/a/537690)):
|
||||
|
||||
> As pointed out, the projection and component actually refers to the same thing.
|
||||
> To solve a problem like this it useful to introduce a coordinate system, as you mentioned yourself
|
||||
> you project onto the x-axis.
|
||||
> As soon as you introduce a coordinate system you can talk about the components of some vector.
|
||||
|
||||
## Position Vectors
|
||||
|
||||
If an origin $O$ is fixed, then any point $P$ in space may be represented by the vector $\pmb r$
|
||||
which has a magnitude and direction given by the line $\overrightarrow{OP}$.
|
||||
|
||||
A point $(x, y, z)$ in Cartesian space has the position vector $r = x\pmb i + y\pmb j + z\pmb k$.
|
||||
|
||||
## Angle Between Vectors
|
||||
|
||||
By rearranging the [dot product equation](#the-scalar-product-inner-product-dot-product) you can get
|
||||
an equation to find the angle, $\theta$, between two vectors:
|
||||
|
||||
$$\cos\theta = \frac{\pmb a \cdot \pmb b}{|\pmb a||\pmb b|} = \frac{a_1b_1 + a_2b_2 + a_3b_3}{|\pmb a ||\pmb b|}$$
|
||||
|
||||
# Applications of Vectors
|
||||
|
||||
## Application of Vectors to Geometry
|
||||
|
||||
### Area of a Parallelogram
|
||||
|
||||
$$area = |\pmb a||\pmb b|\sin\theta = |\pmb a \times \pmb b|$$
|
||||
|
||||
### Volume of a Parallelepiped
|
||||
|
||||
$$volume = | [ \pmb a, \pmb, b, \pmb c ] |$$
|
||||
|
||||
### Equation of a Straight Line
|
||||
|
||||
A straight line can be specified by
|
||||
|
||||
- two points it passes
|
||||
- one point it passes and a direction
|
||||
|
||||
If $\pmb a$ and $\pmb b$ are the position vectors of two distinct points, then the position vectors
|
||||
of an arbitrary point on the line joining these points is:
|
||||
|
||||
$$\pmb r = \pmb a + \lambda(\pmb b - \pmb a)$$
|
||||
|
||||
where $\lambda \in \Re$ is a parameter.
|
||||
|
||||

|
||||
|
||||
Suppose $O$ is an origin and $\pmb a$, $\pmb b$, and $\pmb r$ are position vectors on the line such
|
||||
that
|
||||
|
||||
\begin{align*}
|
||||
\pmb a &= (x_0, y_0, z_0) \\
|
||||
\pmb b &= (x_1, y_1, z_1) \\
|
||||
\pmb r &= (x, y, z)\\
|
||||
\\
|
||||
(x, y, z) &= (x_0, y_0, z_0) + \lambda((x_1, y_1, z_1) - (x_0, y_0, z_0)) \\
|
||||
\\
|
||||
x &= x_0 + \lambda(x_1-x_0) \\
|
||||
y &= y_0 + \lambda(y_1-y_0) \\
|
||||
z &= z_0 + \lambda(z_1-z_0) \\
|
||||
\\
|
||||
\lambda &= \frac{x-x_0}{x_1-x_0} = \frac{y-y_0}{y_1-y_0} = \frac{z-z_0}{z_1-z_0}
|
||||
\end{align*}
|
||||
|
||||
In the above, the vector $\pmb b - \pmb a$ is in the direction of the line.
|
||||
Thus the equation of a line can be specified by giving a point it passes through ($\pmb a$, say) and
|
||||
the direction of the line ($\pmb d = (d_1, d_2, d_3)$, say).
|
||||
|
||||
The vector equation is then
|
||||
|
||||
$$\pmb r = \pmb a + \lambda\pmb d$$
|
||||
|
||||
#### The Cartesian Equation
|
||||
|
||||
$$\frac{x-x_0}{d_1} = \frac{y-y_0}{d_2} = \frac{z-z_0}{d_3}$$
|
||||
|
||||
### Equation of a Plane
|
||||
|
||||
A *plane* can be defined by specifying either:
|
||||
|
||||
- three points (as long as they're not in a straight line)
|
||||
- a point on the plane and two directions (useful for a parametric form)
|
||||
- specifying a point on the plane and the normal vector to the plane
|
||||
|
||||
#### Specifying a Point and a Normal Vector
|
||||
|
||||
Let $\pmb a$ be the position vector of a point on the plane, and $\pmb n$ a normal vector to the
|
||||
plane.
|
||||
|
||||
If $\pmb r$ is the position vector of an arbitrary point on the plane, then $\pmb r - \pmb a$ is a
|
||||
vector lying *in* the plane, so
|
||||
|
||||
$$(\pmb r - \pmb a) \cdot \pmb n = 0$$
|
||||
|
||||
So the *vector equation* of the plane is
|
||||
|
||||
$$\pmb r \cdot \pmb n = \pmb a \cdot \pmb n = D$$
|
||||
|
||||
where $\pmb r = (x, y, z)$ and the vectors $\pmb a$ and $\pmb n$ are known.
|
||||
|
||||
Suppose $\pmb a$, $\pmb n$, and $\pmb r$ are given by
|
||||
|
||||
\begin{align*}
|
||||
\pmb a &= (x_0, y_0, z_0) \\
|
||||
\pmb n &= (l, m, p) \\
|
||||
\pmb r &= (x, y, z)\\
|
||||
\text{then } 0 &= ((x, y, z) - (x_0, y_0, z_0))\cdot(l, m, p)
|
||||
\end{align*}
|
||||
|
||||
#### Specifying Three Points on a Plane
|
||||
|
||||
If we specify three points on a plane with position vectors $\pmb a$, $\pmb b$, and $\pmb c$ the
|
||||
vectors $\pmb c - \pmb a$ and $\pmb c - \pmb b$ lie *in* the plane.
|
||||
(The vectors $\pmb a$, $\pmb b$, and $\pmb c$ do not necessarily lie *in* the plane;
|
||||
rather they take you from $O$ **to** the plane.)
|
||||
|
||||
The normal to the plane, $\pmb n$, is then parallel to
|
||||
|
||||
$$(\pmb c - \pmb a)\times(\pmb c - \pmb b)$$
|
||||
|
||||
and so the equation of the plane is
|
||||
|
||||
$$(\pmb r - \pmb a)\cdot((\pmb c - \pmb a)\times(\pmb c - \pmb b)) = 0$$
|
||||
|
||||
|
||||
#### The Angle Between Two Planes
|
||||
|
||||
... is the same as the angle between their normal vectors
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[^d_associative]: The grouping of elements in in an operation do not matter (e.g. scalar addition: $a+(b+c) = (a+b)+c$)
|
||||
[^d_commutative]: The order of elements in an operation do not matter (e.g. scalar addition: $a+b = b+a$)
|
||||
[^d_distributive]: Easiest to explain with examples. Scalar multiplication is said to be distributive because $(a+b)c = ac + bc$
|
72
uni/mmme/1028_statics_and_dynamics/dynamics.md
Executable file
@@ -0,0 +1,72 @@
|
||||
---
|
||||
author: Akbar Rahman
|
||||
date: \today
|
||||
title: MMME1028 // Dynamics
|
||||
tags: [ uni, mmme1028, dynamics ]
|
||||
uuid: e6d3a307-b2e6-40e3-83bb-ef73512d69ad
|
||||
---
|
||||
|
||||
# Circular Motion
|
||||
|
||||
$$a_c = r\omega^2$$
|
||||
|
||||
$$a = r\alpha \hat{e}_\theta - r\omega^2\hat{e}_r$$
|
||||
|
||||
## Moment of Inertia
|
||||
|
||||
$$J = mr^2 = \frac{M}{\ddot\theta}$$
|
||||
|
||||
The unit of $J$ is kgm$^2$.
|
||||
|
||||
Consider a particle of mass $m$ attached to one end of a rigid rod of length $r$.
|
||||
The rod is pivoting at its other end about point $O$, and experiences a torque $M$.
|
||||
This torque will cause the mass and the rod to rotate about $O$ with angular velocity
|
||||
$\dot{\theta}$ an angular acceleration $\ddot{\theta}$.
|
||||
|
||||

|
||||
|
||||
What is the expression for $M$?
|
||||
|
||||
Well if break down the moment $M$ into a force, $F$, acting on the mass, we know that the
|
||||
moment $M = Fr$.
|
||||
We know $F = ma$, and this case $a = r\ddot{\theta}$ so $M = mr^2\ddot\theta$.
|
||||
|
||||
The moment of inertia is $J = mr^2$ so $M = J\ddot\theta$.
|
||||
|
||||
If multiple torques are applied to a body the *rotational equation* of the motion is
|
||||
|
||||
$$\overrightarrow{M} = \sum_i \overrightarrow{M}_i = J \overrightarrow{\ddot\theta} = J \overrightarrow{\alpha}$$
|
||||
|
||||
The moment of inertia of any object is found by considering the object to be made up of lots of
|
||||
small particles and adding the moments of inertia for each small particle.
|
||||
The moments of inertia for a body depends on the mass and its distribution about the axis in
|
||||
consideration.
|
||||
|
||||
$$J = \sum_i m_ir^2_i \rightarrow \int\! r^2 \mathrm{d}m$$
|
||||
|
||||
### Perpendicular Axis Rule
|
||||
|
||||
The perpendicular axis rule states that, for lamina object:
|
||||
|
||||
$$J_z = J_x + J_y$$
|
||||
|
||||
where $J_x$, $J_y$, and $J_z$ are the moments of inertia along their respective axes.
|
||||
|
||||
### Parallel Axes Rule (Huygens-Steiner Theorem)
|
||||
|
||||
The parallel axes rule states that:
|
||||
|
||||
$$J_A = J_G = md^2$$
|
||||
|
||||
where $d$ is the perpendicular distance between the two axes.
|
||||
|
||||

|
||||
|
||||
### Moment of a Compound Object
|
||||
|
||||
The moment of inertia for any compound object can be calculated by adding and subtracting the
|
||||
moments of inertia for its 'standard' components.
|
||||
|
||||
### Moment of Inertia of Standard Objects
|
||||
|
||||
// TODO
|
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 26 KiB |
@@ -11,6 +11,7 @@ tags:
|
||||
- statics
|
||||
- dynamics
|
||||
title: MMME1028 // Statics
|
||||
uuid: 2ddad9d0-b085-4602-aca9-c573351558ba
|
||||
---
|
||||
|
||||
# Lecture L1.1, L1.2
|
||||
@@ -127,6 +128,8 @@ This principle can be useful in determining moments.
|
||||
|
||||
## Naming Conventions
|
||||
|
||||
<div class="tableWrapper">
|
||||
|
||||
| Term | Meaning |
|
||||
|----------------------|----------------------------------------------------------|
|
||||
| light | no mass |
|
||||
@@ -138,6 +141,8 @@ This principle can be useful in determining moments.
|
||||
| rigid pin | a support only providing normal and tangential reactions |
|
||||
| built-in | a support proviting two reaction components and a moment |
|
||||
|
||||
</div>
|
||||
|
||||
## Tips to Solve (Difficult) Problems
|
||||
|
||||
1. Make good quality clear and big sketches
|
||||
|
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 103 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 324 KiB |
After Width: | Height: | Size: 415 KiB |
After Width: | Height: | Size: 128 KiB |
After Width: | Height: | Size: 319 KiB |
After Width: | Height: | Size: 239 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 220 KiB |
After Width: | Height: | Size: 152 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.5 MiB |
After Width: | Height: | Size: 418 KiB |
After Width: | Height: | Size: 142 KiB |
After Width: | Height: | Size: 63 KiB |
399
uni/mmme/1029_materials_and_manufacturing/manufacturing.md
Executable file
@@ -0,0 +1,399 @@
|
||||
---
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: MMME1029 // Manufacturing
|
||||
tags:
|
||||
- uni
|
||||
- nottingham
|
||||
- mechanical
|
||||
- engineering
|
||||
- mmme1029
|
||||
- manufacturing
|
||||
uuid: b5fae4fd-32c3-4fd8-a05a-7440d6c44f9c
|
||||
---
|
||||
|
||||
# Cost Modelling
|
||||
|
||||
Key issues in selection:
|
||||
|
||||
- Component function, including materials and shape, form, and assembly
|
||||
- Manufacturing process may greatly affect material properties, such as yield strength
|
||||
- Similarly, the material will likely decide the manufacturing process
|
||||
- Cost of a material and manufacture
|
||||
|
||||
The main requirement for a product to be viable is
|
||||
|
||||
$$cost < price < value$$
|
||||
|
||||
Cost modelling equation:
|
||||
|
||||
$$C = \frac{mC_m}{1-f} + \frac{C_t}{n} + \frac{1}{\dot n} \left[ \dot C_{oh} + \frac{C_c}{L\cdot t_{wo}} \right]$$
|
||||
|
||||
# Shaping Processes
|
||||
|
||||
## Casting
|
||||
|
||||
- Can be used for large size range
|
||||
- Molten metal poured into solid mould to give shape
|
||||
- Heat removed leads to shrinkage
|
||||
- We need to be able to melt the metal and handlethe molten metal
|
||||
- Mould degradation by the liquid metal needs to be considered
|
||||
- Heat flowing from the molten metal into the mould causes a drop in temperature so solidification
|
||||
starts from outside inwards
|
||||
- Rate of solidification depends on rate of heat flow into mould
|
||||
|
||||
### Types of Mould
|
||||
|
||||
- Expendable mould (sand, plaster, ceramic)
|
||||
|
||||
- The mould is used once, being broken to release the casting
|
||||
- Can have multiple use or single use pattern (investment and lost foam casting
|
||||
|
||||
- Multiple mold casting
|
||||
|
||||
- Die casting (pressure die casting)
|
||||
- Permanent mould casting (gravity die casting)
|
||||
|
||||
#### Sand Casting
|
||||
|
||||

|
||||
|
||||
- Wide range of metals can be cast
|
||||
- Almost no limit to size and shape of casting
|
||||
- Poorer tolerances than other proces, rough surface texture
|
||||
- Slow
|
||||
- Economic for a low number of castings
|
||||
- Applications include cylinder blocks and large pipe fittings
|
||||
|
||||
#### Investment Casting
|
||||
|
||||
- A high cost process
|
||||
- Used mostly for complex shapes, such as sculptures, jewellery, and gas turbine blades
|
||||
- Can be used for a wide range of metals
|
||||
- Very high precision and surface finish
|
||||
|
||||
1. Make a master die
|
||||
2. Make wax pattern by casting wax into master die
|
||||
3. Coat wax pattern with investment material
|
||||
|
||||
1. First with a slurry of water and fine ceramic to capture fine details
|
||||
2. Then coat with stucco, which is a thicker coating for strength
|
||||
|
||||
4. Heat mould to melt wax out, bake and preheat mould
|
||||
5. Pour in molten metal
|
||||
6. Wait for solidification, break mould when done
|
||||
|
||||
#### Permanent Mould Casting (Gravity Die Casting)
|
||||
|
||||
- Mould cavity is machined into mating metal blocks
|
||||
- Molten material poured into mould
|
||||
- Mould material is cast iron, steel, bronze, graphite
|
||||
- Mould must disassebmble without locking
|
||||
- Mould is expensive but can be reused (typically around 25k times)
|
||||
- Mould life is reduce by casting high meling point metals
|
||||
- Good surface finish and dimensional accuracy
|
||||
- Cooling is rapid therefore high production rates
|
||||
- Example use is a piston
|
||||
|
||||
#### Die Casting (High Pressure Die Casting)
|
||||
|
||||
- Dies must be able to withstand high pressure
|
||||
- 0.1 mm slits at parting lines provide escape for air
|
||||
- Dies are made of expensive tool steels
|
||||
- High volume production is necessary to justify costs
|
||||
- Generally limited to low viscosity, low melting point, non ferrous metals like Al, Zn, Mg, and Pb
|
||||
- Good surface finish
|
||||
- Precision castings with thickness between 0.75 mm and 12 mm
|
||||
|
||||
### Design of Castings
|
||||
|
||||
- Distribute castings evently around parting planes
|
||||
- Need to be able to get patterns out of moulds and casting out of moulds where applicable
|
||||
- No re-entrants (complex multi-part moulds may be able to avoid this restriction)
|
||||
- Draft angle between surfaces
|
||||
|
||||
- Need to be able to get solid patternout of mould in sand casting
|
||||
- Need to be able to get solid casting out of mould in die casting
|
||||
|
||||
- Allow for shrinkage --- dimensions of casting mould/pattern needs to be made so that part is
|
||||
desired size after shrinkage
|
||||
- Avoid rapid change in section or direction:
|
||||
|
||||

|
||||
|
||||
### Solifidification of Metals
|
||||
|
||||
- How well the liquid fills detail depends on viscosity of liquid
|
||||
- During freezing, latent heat of fusion is removed
|
||||
- During freezing, material is a solid/liquid mixture
|
||||
- There is a significant (~7 %v) shrinkage during solidification
|
||||
- Heat flows down steepest thermal gradient so usually there is an actively cooled section
|
||||
- Thin sections freeze faster than thick sections
|
||||
|
||||
### Castability
|
||||
|
||||
- Low melting point
|
||||
- Low viscosity and surface tension
|
||||
- Low solidification contraction
|
||||
- Low thermal capacity and high conductibity
|
||||
- Low solubility
|
||||
- Not contaminated by air
|
||||
|
||||
## Deformation
|
||||
|
||||
When a metal is plastically deformed, dislocations move and multiply.
|
||||
|
||||
Annealed aluminium may have a dislocatio density of around 200 m per mm$^3$.
|
||||
This is a very low amount.
|
||||
A heavily cold worked piece may have a density of up to 270 km per mm$^3$.
|
||||
|
||||
As dislocation density increases, the dislocations impede the motion of other dislocations.
|
||||
This means that to continue plastically deforming, more stress has to be applied.
|
||||
|
||||
The stress goes down towards the end of the graph due to the material necking, meaning the
|
||||
material gets thinner.
|
||||
This means that the engineering stress is lower as the true area is lower.
|
||||
The true stress, however, is going up:
|
||||
|
||||

|
||||
|
||||
### Effect of Prior Deformation (*Work Hardening*)
|
||||
|
||||

|
||||
|
||||
See
|
||||
[here](materials.html#work-hardening-and-cold-working)
|
||||
for more information
|
||||
|
||||
### Effect of Temperature (Diffusion)
|
||||
|
||||
In an alloy, atoms tend to migrate from regions of high concentration to low concentration.
|
||||
This is diffusion.
|
||||
|
||||
More information on diffusion [here](materials.html#diffusion).
|
||||
|
||||
### Annealing
|
||||
|
||||
Annealing is a process by which a component is heated to reduce work hardening.
|
||||
|
||||

|
||||
|
||||
These are diffusional processes and only occur at higher temperatures.
|
||||
|
||||
When the temperature of a material, $T > 0.55T_m$, it is said to be hot.
|
||||
A material being worked on hot has its deformations eliminated as fast as they are created.
|
||||
|
||||
A material is said to be cold when $T < 0.35T_m$.
|
||||
|
||||
# Powder Processes
|
||||
|
||||
Poweders can plowflow if forces between them are low
|
||||
|
||||
With small amounts of binder, they can form "*plastic*" materials like clay.
|
||||
|
||||
A *slurry* can be formed with a liquid carrier (where there is enough liquid to separate particles).
|
||||
In a slurry, often you want to reduce liquid content but avoid the particles touching or attracting
|
||||
each other.
|
||||
Adding a *deflocculant*[^d_deflocculant] results in the formation of a stable *slip*.
|
||||
|
||||
Making the powders is often quite expensive when you have a controlled size distribution.
|
||||
|
||||
## Clay and Ceramics
|
||||
|
||||
Clay is an abundant raw material but it needs to be milled and screen for a controlled size
|
||||
distribution.
|
||||
When mixed with water it forms a *plastic* material.
|
||||
|
||||
Structural clay products include bricks, tiles, and pipes.
|
||||
Other proucts include whitewares such as porcelain, pottery, and tableware.
|
||||
|
||||
Ways to form the clay include pressing, isostatic pressing, extrusion, and machining.
|
||||
|
||||
Engineering ceramics (e.g. silicon carbide, alumina) are shaped with small amounts of binder ---
|
||||
commonly pressed or isostatically pressed.
|
||||
|
||||
## Slip Casting
|
||||
|
||||
1. Pour slip into a mould (e.g. plaster of Paris)
|
||||
2. The mould is extremely water absorbing. This results in the remaining part developing some
|
||||
structural integrity.
|
||||
3. Remove the mould and place in the oven to reduce water content.
|
||||
4. Fire to harden
|
||||
5. Add glaze and fire again.
|
||||
|
||||
Drying leads to shrinkage and potential cracking.
|
||||
It also gives strength and allows for handling and maybe machining.
|
||||
|
||||

|
||||
|
||||
## Sintering of Metals and Ceramics
|
||||
|
||||

|
||||
|
||||
Atoms diffuse to points of contact, creating bridges and reducing the pore size.
|
||||
Diffusion is driven by a desire to reduce the surface area as surfaces are regions of high energy.
|
||||
|
||||
## Powdering Metallurgy
|
||||
|
||||
- Competitive with processes like casting, forging, machining
|
||||
- Used when the melting point is too high, a chemical reaction occurs at melting point, the part is
|
||||
too hard to machine, or a very large quantity (on the order of 100 000) of the part is needed
|
||||
- Nearly 70% of parts produced is by powder metallurgy
|
||||
- Good dimensional accuracy
|
||||
- Controlloable porosity
|
||||
- Size range from balls in ball point pens to parts weighing 50 kg
|
||||
|
||||
Basic steps of powder metallurgy:
|
||||
|
||||
1. Powder production (commonly atomization) --- this is often a costly process and you must minimize
|
||||
oxidation of the metal
|
||||
2. Blending/mixing --- add binders to keep the particles together and lubricants to reduce damage to
|
||||
dies and aid consolidation
|
||||
3. Powder consolidation
|
||||
|
||||
- Shaping in a die
|
||||
- 100-900 MPa of pressure applied
|
||||
- Fast process as no heat needs to be removed
|
||||
|
||||
4. Sintering at $0.7T_m$ to $0.9T_m$
|
||||
|
||||
Shaping equipment has no requirement to be able to withstand high temperatures and the sintering
|
||||
equipment does not have the need for complex designs.
|
||||
This separates problems, making them easier to design.
|
||||
|
||||
The pressing equipment is costly but the time spent pressing is quite small, allowing for greater
|
||||
throughput.
|
||||
Additionally, the furnace can operate continuously and is simple and cost effective.
|
||||
|
||||

|
||||
|
||||
### Green Density
|
||||
|
||||
The *green density* is a fraction of the true density.
|
||||
A low green density will result in high shrinkage on sintering.
|
||||
|
||||
## Moulding
|
||||
|
||||
Moulding is a shaping process used for viscous materials (typically polymers and glasses).
|
||||
Here the material can hold a shape unsupported but not for very long or under even small stresses.
|
||||
|
||||
In order to mould a material we must raise the temperature above the glass transition temperature,
|
||||
$T_g$.
|
||||
At this temperature, the C-C bond in the chapolymer chain are able to easily rotate around each
|
||||
other.
|
||||
|
||||
Large side chains or molecules on the main chain make it harder to rotate these bonds, making
|
||||
$T_g$ higher.
|
||||
Polar groups (e.g. chloride, cynaide, and hydroxide) have also hinder bond rotation.
|
||||
|
||||
More information about polymers
|
||||
[here](https://notes.alv.cx/notes/uni/mmme/1029_materials_and_manufacturing/materials.html#polymers-1).
|
||||
|
||||
## Extrusion
|
||||
|
||||
Extrusion produced parts of constant cross section, like pipes and rods.
|
||||
The process is used primarily with thermoplastics and 60% of polymers are prepared by extrusion.
|
||||
|
||||

|
||||
|
||||
## Blow Moulding
|
||||
|
||||
Blow moulding is a rapid process with low labour costs.
|
||||
It produces hollow components that do not require a constant thickness, such as
|
||||
bottles, petrol tanks, and drums.
|
||||
Common materials to blow mould are HDPE, LDPE, PP, PET, and PVC.
|
||||
|
||||
There are three common types of blow moulding:
|
||||
|
||||
- Extrusion blow moulding
|
||||
- Injetion blow moulding
|
||||
- Stretch-blow processes
|
||||
|
||||
However, they involve the following stages:
|
||||
|
||||
1. A tubular preform, called a *parison* (a word I haven't been able to remember since GCSE) is
|
||||
produced by either extrusion of injection moulding
|
||||
2. The *parison* is transferred into a cooled split-mould
|
||||
3. The *parison* is sealed and inflated to take up the shape of the mould
|
||||
4. The moulding is let to cool and solifidies under pressure
|
||||
5. The mould is opened and moulding is ejected
|
||||
|
||||

|
||||
|
||||
## Injection Moulding
|
||||
|
||||
1. Powder or pellets of polymer heated to liquid state (low viscosity)
|
||||
2. Under pressure, the liquid polymer is forced into a mould through a *sprue*, a small opening
|
||||
3. The pressurized material is held in the mould until it solidifies
|
||||
4. The mould is opened and the part is removed by ejector pins
|
||||
Selection was cancelled by keystroke or right-click.
|
||||
|
||||

|
||||
|
||||
Theromoplastics are most common in injection moulding.
|
||||
A very high level of detail is attainable through this process and it produced little waste.
|
||||
|
||||
Similar to [Die Casting](#die-casting-high-pressure-die-casting), you must consider corners (avoid
|
||||
sharp ones), draft angles (so you can get the part out), and section thickness (using ribs instead
|
||||
is preferable).
|
||||
|
||||
Due to the high capital cost, injection moulding is only economical at high production volumes.
|
||||
|
||||
### Co-Injection Moulding
|
||||
|
||||
There is *sequential moulding* (one after the other) and *co-injection moulding* (together).
|
||||
|
||||
These processes reduce assembly costs by integrating the parts and can use low grade recycled
|
||||
material for the inside of a component.
|
||||
It also allows for a part have to have multiple colours.
|
||||
|
||||
This process requires special attention to be payed to shrinking/cooling.
|
||||
|
||||
## Rotational Moulding
|
||||
|
||||
Rotational moulding involves coating the insides of a heated mould with a thermoplastic.
|
||||
It is a low pressure alternative to blow moulding for making hollow components and is used
|
||||
for large components such as storage tanks, boat hulls, kayaks, and cones.
|
||||
|
||||
## Moulding for Thermosetting Polymers
|
||||
|
||||
There are two types:
|
||||
|
||||
a. Compression moulding
|
||||
b. Transfer moulding
|
||||
|
||||

|
||||
|
||||
### Compression Moulding
|
||||
|
||||
For thermoplastics, the mould is cooled before removoal so the part will not lose its shape.
|
||||
Thermosets, however, may be ejected while they are hot so long as curing is complete.
|
||||
|
||||
The process is slow but the material only moves a short distance and has lower mould pressures.
|
||||
It also does minimal damage to reinforcing fibres in composites and it is possible to make large
|
||||
parts.
|
||||
|
||||
More manual labour is required and has longer cycle times than injection moulding.
|
||||
|
||||
# Machining Processes
|
||||
|
||||
## Advantages of Machining Processes
|
||||
|
||||
- High precision of geometrical dimensions, tolerances, and surface finishes
|
||||
- Is able to make one off prototypes in production grade material
|
||||
- Creates high volume production tooling
|
||||
- Increasing hard/brittle/fragile/tough materials can only be machines
|
||||
- Some designs are so complex that machining is the only realistic process to make them with
|
||||
|
||||
## Disadvantages of Machining Processes
|
||||
|
||||
- Material is wasted (as it is a subtractive process)
|
||||
- Complex parts require expensive machines to make and making them can take a long time
|
||||
- Parts need to be set up using fixtures. These fixtures get increasingly complex with the part.
|
||||
- Faster production rates and harder materials wear down the tools.
|
||||
|
||||
|
||||
|
||||
# Glossary
|
||||
|
||||
[^d_deflocculant]: a substance which, when added to scattered particles in suspension, causes a reduction in apparent viscosity. Deflocculants are substances which prevent flocculation by increasing zeta potential and therefore the repulsive forces between particles. (<https://digitalfire.com/article/deflocculants%3A+a+detailed+overview>)
|
@@ -2,13 +2,25 @@
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: MMME1029 // Materials
|
||||
tags: [ uni, nottingham, mechanical, engineering, mmme1029, materials ]
|
||||
tags:
|
||||
- uni
|
||||
- nottingham
|
||||
- mechanical
|
||||
- engineering
|
||||
- mmme1029
|
||||
- materials
|
||||
uuid: 755626f6-53ae-473a-8ff8-185ca9427bfd
|
||||
---
|
||||
|
||||
\tableofcontents
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
# Lecture 1 (2021-10-04)
|
||||
|
||||
</summary>
|
||||
|
||||
## 1A Reading Notes
|
||||
|
||||
### Classification of Energy-Related Materials
|
||||
@@ -22,17 +34,17 @@ tags: [ uni, nottingham, mechanical, engineering, mmme1029, materials ]
|
||||
usually associated wit structural and mechanical properties or long standing chemical effects like
|
||||
corrosion:
|
||||
|
||||
- fossil fuels
|
||||
- hydroelectric
|
||||
- oil from shale and tar
|
||||
- sands
|
||||
- coal gasification
|
||||
- liquefaction
|
||||
- geothermal energy
|
||||
- wind power
|
||||
- bomass conversion
|
||||
- solar cells
|
||||
- nuclear reactors
|
||||
- fossil fuels
|
||||
- hydroelectric
|
||||
- oil from shale and tar
|
||||
- sands
|
||||
- coal gasification
|
||||
- liquefaction
|
||||
- geothermal energy
|
||||
- wind power
|
||||
- bomass conversion
|
||||
- solar cells
|
||||
- nuclear reactors
|
||||
|
||||
### Applications of Energy-Related Materials
|
||||
|
||||
@@ -107,8 +119,15 @@ work:
|
||||
|
||||
> Young's modulus, specific heat, coefficient of thermal expansion
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
# Lecture 2
|
||||
|
||||
</summary>
|
||||
|
||||
## Properties of the Classes
|
||||
|
||||
### Metals
|
||||
@@ -264,6 +283,8 @@ $$\rho = \frac m v$$
|
||||
|
||||
> ~~C~~ B
|
||||
|
||||
</details>
|
||||
|
||||
# Polymers
|
||||
|
||||
## Introduction to Polymers
|
||||
@@ -304,6 +325,19 @@ They are made of long carbon-carbon chains.
|
||||
|
||||

|
||||
|
||||
## Industrially Important Polymers
|
||||
|
||||
The worldwide production of polymers in 2019 was $368\times10^6$ tonnes and the majority is from
|
||||
just 5 polymers:
|
||||
|
||||
- Polyethylene (PE) --- wire insulation, flexible tubing, squeezy bottles
|
||||
- Polypropyene (PP) --- carpet fibres, ropes, liquid containers, pipes, chairs in Shoreham Academy
|
||||
- Polyvinyl chloride (PVC) --- bottles, hoses, pipes, valves, wire insulation, toys
|
||||
- Polystyrene (PS) --- packaging foam, egg cartons, lighting panels
|
||||
- Polyethylene terephthalate (PET) --- carbonated drinks bottles
|
||||
|
||||
All of these materials are low cost.
|
||||
|
||||
## Thermoplastics
|
||||
|
||||
The simplest polymer is poly(ethene):
|
||||
@@ -624,12 +658,16 @@ bonds between the surface of the fibre and matrix.
|
||||
|
||||
Fibre composites tend to be much much weaker in transverse direction:
|
||||
|
||||
<div class="tableWrapper">
|
||||
|
||||
Composite | Longitudinal UTS | Transverse UTS
|
||||
------------ | ---------------- | --------------
|
||||
GF/PET | 700 | 20
|
||||
CF/Epoxy | 1000 | 35
|
||||
Kevlar/Epoxy | 1200 | 20
|
||||
|
||||
</div>
|
||||
|
||||
(All units in MPa)
|
||||
|
||||
# Thermal Properties of Materials
|
||||
@@ -1052,7 +1090,7 @@ As you decrease grain size, you get more grain boundaries which basically create
|
||||
to prevent slip.
|
||||
|
||||
This is because a dislocation would have to change orientation across a grain boundary and "ionic
|
||||
disorder in the grain boundary results in discontinuity of slip" (A.B Seddon University of
|
||||
disorder in the grain boundary results in discontinuity of slip" (A.B Seddon, University of
|
||||
Nottingham 2020) (I think that's repeating it but it said it on the slideshow sooo...).
|
||||
|
||||
So for any given metal, the fine grained is harder and has greater yield stress than the coarse
|
||||
@@ -1066,6 +1104,41 @@ where $d$ is the grain size and $\sigma_0$ and $k_y$ are material constants.
|
||||
|
||||
Therefore a plot of $\sigma_{yield}$ against $d^{-0.5}$ would results in a straight line.
|
||||
|
||||
## Heat Treatment of Metals
|
||||
|
||||
These processes are to change a material's mechanical properties, not change its shape.
|
||||
|
||||
### Phase Diagrams
|
||||
|
||||
Here is an example of a *two component phase diagram* with a familiar system:
|
||||
|
||||

|
||||
|
||||
The component in this case are sugar and water, but not syrup.
|
||||
|
||||
A *phase* is a chemically and physically distinct species as we can have a change in phase that goes
|
||||
from solid to solid.
|
||||
|
||||
The *solubility limit* is the maximum concentration for which only a solution occurs.
|
||||
In the case of this system, thee limit increases with temperature.
|
||||
|
||||
Here is a generic phase diagram for a generic *A-B* system:
|
||||
|
||||

|
||||
|
||||
- L - liquid
|
||||
- $\alpha$ --- a solid phase but still a solution. B can dissolve into A
|
||||
- $\beta$ --- a solid phase but still a solution. A can dissolve into B
|
||||
|
||||
### Annealing
|
||||
|
||||
Annealing is a process by which a component is heated to remove the effects of cold work.
|
||||
|
||||

|
||||
|
||||
These are diffusional processes and only occur at high temperatures.
|
||||
The driver for diffusion is the removal of high energy defects from the system.
|
||||
|
||||
# Diffusion
|
||||
|
||||
Diffusion is atomic or ionic movement down a concentration gradient.
|
||||
@@ -1122,7 +1195,74 @@ You can apply the Arrhenius equation for all thermally activated diffusion:
|
||||
|
||||
$$D = D_0 \exp{\left( - \frac{Q}{RT} \right)}$$
|
||||
|
||||
where $Q$ is the activation energy and $R$ is the ideal gas constant (8.31 J k$^{-1}$ mol$^{-1}$).
|
||||
where $D$ is the diffusion coefficient, $D_0$ is the frequency factor, $Q$ is the activation energy,
|
||||
$R$ is the ideal gas constant (8.31 J k$^{-1}$ mol$^{-1}$).
|
||||
|
||||
You can find the diffusion distance, $x$, with the following equation:
|
||||
|
||||
$$x ~ \sqrt{Dt}$$
|
||||
|
||||

|
||||
|
||||
|
||||
# Materials in Sustainable Transport
|
||||
|
||||
- Concerns over use of fossil fuels, climate change
|
||||
- Const of energy
|
||||
- Energy use in making and moving vehicles
|
||||
- Rising energy prices mean cost of fuel is comparable to cost of car
|
||||
- 1/4 of energy used in UK is to transport goods and people
|
||||
- Legislation and voluntary targets set by EU to improve fuel efficiency
|
||||
- In 2015 average CO2 emmisions as 130 g / km
|
||||
- Engine powerhas gone up significantly from 2001 to 2018 (~30%) yet engine displracement has gone
|
||||
down ~10% and CO2 emissions down ~18% while weight has gone up ~10%
|
||||
|
||||
## Is the car emissions reduction target significant?
|
||||
|
||||
Overall CO2 emissions in 2016 is 466 Megatonnes.
|
||||
|
||||
Does a reduction from 130 g / km to 95 g / km (a 35 g/km reduction) make a significant difference?
|
||||
|
||||
There are 33 million registered cars in the uk.
|
||||
|
||||
If they average around 8000 miles each (~13000 km) per year that's a ~15 Megatonne reduction,
|
||||
or about 3% of the annual C02 emmissions, a significant reduction.
|
||||
|
||||
## Materials in Cars
|
||||
|
||||
- Most of the energy used by cars is during driving (71%)
|
||||
- This means the mass of the vehicle has a great effect on its emmissions across a lifetime
|
||||
- The body, suspension, drivetrain, and interior all contribute roughly a quarter to the mass of the
|
||||
car
|
||||
- However, the mass of cars are increasing
|
||||
|
||||
### Material Substitution
|
||||
|
||||
- The material will likely have performance requirements:
|
||||
|
||||
- It may need to be a physical size
|
||||
- It may need to operate at certain temperatures
|
||||
- It may need to bear a certain load
|
||||
|
||||
- The component mustalso be designed for convenient manufacturing, assembly, servicing, disposal,
|
||||
remanufacturing and/or disassembly
|
||||
|
||||
#### Case Study --- 2012 Honda Accord
|
||||
|
||||
- Body --- opted to stay with steel --- aluminium intense and multi-material approaches were both
|
||||
rejected due to higher costs and limitations in manufacturing and assembly.
|
||||
Recyclability was also noted as an issue due to different grades of aluminium needing to be
|
||||
separated at end of life.
|
||||
- Doors and bonnets --- move to aluminium from steel --- more costly but the mass savings made this
|
||||
option worth it
|
||||
- Wiring --- aluminium to copper --- lower mass for same conductivity, copper is more expensive
|
||||
(I think)
|
||||
- Seats --- steel to composites or magnesium structural components --- very high weight savings
|
||||
|
||||
## Choosing a Material
|
||||
|
||||
|
||||
|
||||
|
||||
# Glossary
|
||||
|
||||
|
655
uni/mmme/1048_thermodynamics_and_fluid_mechanics/fluid_dynamics.md
Executable file
@@ -0,0 +1,655 @@
|
||||
---
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: MMME1048 // Fluid Dynamics
|
||||
tags:
|
||||
- uni
|
||||
- nottingham
|
||||
- mechanical
|
||||
- engineering
|
||||
- fluid_mechanics
|
||||
- mmme1048
|
||||
- fluid_dynamics
|
||||
uuid: b88f78f8-a358-460b-9dbb-812e7b1ace92
|
||||
---
|
||||
|
||||
\newcommand\Rey{\text{Re}}
|
||||
\newcommand\textRey{$\Rey$}
|
||||
|
||||
# Introductory Concepts
|
||||
|
||||
These are ideas you need to know about to know what's going on, I guess?
|
||||
|
||||
## Control Volumes
|
||||
|
||||
A control volume is a volume with an imaginary boundary to make it easier to analyse the flow of a
|
||||
fluid.
|
||||
The boundary is drawn where the properties and conditions of the fluid is known, or where an
|
||||
approximation can be made.
|
||||
Properties which may be know include:
|
||||
|
||||
- Velocity
|
||||
- Pressure
|
||||
- Temperature
|
||||
- Viscosity
|
||||
|
||||
The region in the control volume is analysed in terms of energy and mass flows entering and leaving
|
||||
the control volumes.
|
||||
You don't have to understand what's going on inside the control volume.
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
### Example 1
|
||||
|
||||
The thrust of a jet engine on an aircraft at rest can be analysed in terms of the changes in
|
||||
momentum or the air passing through the engine.
|
||||
|
||||
</summary>
|
||||
|
||||

|
||||
|
||||
The control volume is drawn far enough in front of the engine that the air velocity entering can
|
||||
be assumed to be at atmospheric pressure and its velocity negligible.
|
||||
|
||||
At the exit of the engine the boundary is drawn close where the velocity is known and the air
|
||||
pressure atmospheric.
|
||||
|
||||
The control volume cuts the material attaching the engine to the aircraft and there will be a force
|
||||
transmitted across the control volume there to oppose the forces on the engine created by thrust
|
||||
and gravity.
|
||||
|
||||
The details of the flows inside the control volume do not need to be known as the thrust can be
|
||||
determined in terms of forces and flows crossing the boundaries drawn.
|
||||
However, to understand the flows inside the engine in more detail, a more detailed analysis would
|
||||
be required.
|
||||
|
||||
</details>
|
||||
|
||||
## Ideal Fluid
|
||||
|
||||
The actual flow pattern in a fluid is usually complex and difficult to model but it can be
|
||||
simplified by assuming the fluid is ideal.
|
||||
The ideal fluid has the following properties:
|
||||
|
||||
- Zero viscosity
|
||||
- Incompressible
|
||||
- Zero surface tension
|
||||
- Does not change phases
|
||||
|
||||
Gases and vapours are compressible so can only be analysed as ideal fluids when flow velocities are
|
||||
low but they can often be treated as ideal (or perfect) gases, in which case the ideal gas equations
|
||||
apply.
|
||||
|
||||
## Steady Flow
|
||||
|
||||
Steady flow is a flow which has *no changes in properties with respect to time*.
|
||||
Properties may vary from place to place but in the same place the properties must not change in
|
||||
the control volume to be steady flow.
|
||||
|
||||
Unsteady flow does change with respect to time.
|
||||
|
||||
## Uniform Flow
|
||||
|
||||
Uniform flow is when all properties are the same at all points at any given instant but can change
|
||||
with respect to time, like the opposite of steady flow.
|
||||
|
||||
## One Dimensional Flow
|
||||
|
||||
In one dimensional (1D) flow it is assumed that all properties are uniform over any plane
|
||||
perpendicular to the direction of flow (e.g. all points along the cross section of a pipe have
|
||||
identical properties).
|
||||
|
||||
This means properties can only flow in one direction---usually the direction of flow.
|
||||
|
||||
1D flow is never achieved exactly in practice as when a fluid flows along a pipe, the velocity at
|
||||
the wall is 0, and maximum in the centre of the pipe.
|
||||
Despite this, assuming flow is 1D simplifies the analysis and often is accurate enough.
|
||||
|
||||
## Flow Patterns
|
||||
|
||||
There are multiple ways to visualize flow patterns.
|
||||
|
||||
### Streamlines
|
||||
|
||||
A streamline is a line along which all the particle have, at a given instant, velocity vectors
|
||||
which are tangential to the line.
|
||||
|
||||
Therefore there is no component of velocity of a streamline.
|
||||
|
||||
A particle can never cross a streamline and *streamlines never cross*.
|
||||
|
||||
They can be constructed mathematically and are often shown as output from CFD analysis.
|
||||
|
||||
For a steady flow there are no changes with respect to time so the streamline pattern does not.
|
||||
The pattern does change when in unsteady flow.
|
||||
|
||||
Streamlines in uniform flow must be straight and parallel.
|
||||
They must be parallel as if they are not, then different points will have different directions and
|
||||
therefore different velocities.
|
||||
Same reasoning with if they are not parallel.
|
||||
|
||||
### Pathlines
|
||||
|
||||
A pathline shows the route taken by a single particle during a given time interval.
|
||||
It is equivalent to a high exposure photograph which traces the movement of the particle marked.
|
||||
You could track pathlines with a drop of injected dye or inserting a buoyant solid particle which
|
||||
has the same density as the solid.
|
||||
|
||||
Pathlines may cross.
|
||||
|
||||
### Streaklines
|
||||
|
||||
A streakline joins, at any given time, all particles that have passed through a given point.
|
||||
Examples of this are line dye or a smoke stream which is produced from a continuous supply.
|
||||
|
||||
## Viscous (Real) Fluids
|
||||
|
||||
### Viscosity
|
||||
|
||||
A fluid offers resistance to motion due to its viscosity or internal friction.
|
||||
The greater the resistance to flow, the greater the viscosity.
|
||||
|
||||
Higher viscosity also reduces the rate of shear deformation between layers for a given shear stress.
|
||||
|
||||
Viscosity comes from two effects:
|
||||
|
||||
- In liquids, the inter-molecular forces act as drag between layers of fluid moving at different
|
||||
velocities
|
||||
- In gases, the mixing of faster and slower moving fluid causes friction due to momentum transfer.
|
||||
The slower layers tend to slow down the faster ones
|
||||
|
||||
### Newton's Law of Viscosity
|
||||
|
||||
Viscosity can be defined in terms of rate of shear or velocity gradient.
|
||||
|
||||

|
||||
|
||||
Consider the flow in the pipe above.
|
||||
Fluid in contact with the surface has a velocity of 0 because the surface irregularities trap the
|
||||
fluid particles.
|
||||
A short distance away from the surface the velocity is low but in the middle of the pipe the
|
||||
velocity is $v_F$.
|
||||
|
||||
Let the velocity at a distance $y$ be $v$ and at a distance $y + \delta y$ be $v + \delta v$.
|
||||
|
||||
The ratio $\frac{\delta v}{\delta y}$ is the average velocity gradient over the distance
|
||||
$\delta y$.
|
||||
|
||||
But as $\delta y$ tends to zero, $\frac{\delta v}{\delta y} \rightarrow$ the value of the
|
||||
differential $\frac{\mathrm{d}v}{\mathrm{d}y}$ at a point such as point A.
|
||||
|
||||
For most fluids in engineering it is found that the shear stress, $\tau$, is directly proportional
|
||||
to the velocity gradient when straight and parallel flow is involved:
|
||||
|
||||
$$\tau = \mu\frac{\mathrm{d}v}{\mathrm{d}y}$$
|
||||
|
||||
Where $\mu$ is the constant of proportionality and known as the dynamic viscosity, or simply the
|
||||
viscosity of the fluid.
|
||||
|
||||
This is Newton's Law of Viscosity and fluids that obey it are known as Newtonian fluids.
|
||||
|
||||
### Viscosity and Lubrication
|
||||
|
||||
Where a fluid is a thin film (such as in lubricating flows), the velocity gradient can be
|
||||
approximated to be linear and an estimate of shear stress obtained:
|
||||
|
||||
$$\tau = \mu \frac{\delta v}{\delta y} \approx \mu \frac{v}{y}$$
|
||||
|
||||
From the shear stress we can calculate the force exerted by a film by the relationship:
|
||||
|
||||
$$\tau = \frac F A$$
|
||||
|
||||
# Fluid Flow
|
||||
|
||||
## Types of flow
|
||||
|
||||
There are essentially two types of flow:
|
||||
|
||||
- Smooth (laminar) flow
|
||||
|
||||
At low flow rates, particles of fluid are moving in straight lines and can be considered to be
|
||||
moving in layers or laminae.
|
||||
|
||||
- Rough (turbulent) flow
|
||||
|
||||
At higher flow rates, the paths of the individual fluid particles are not straight but disorderly
|
||||
resulting in mixing taking place
|
||||
|
||||
Between fully laminar and fully turbulent flows is a transition region.
|
||||
|
||||
## The Reynolds Number
|
||||
|
||||
### Development of the Reynolds Number
|
||||
|
||||
In laminar flow the most influential factor is the magnitude of the viscous forces:
|
||||
|
||||
$$viscous\, forces \propto \mu\frac v l l^2 = \mu vl$$
|
||||
|
||||
where $v$ is a characteristic velocity and $l$ is a characteristic length.
|
||||
|
||||
In turbulent flow viscous effects are not significant but inertia effects (mixing, momentum
|
||||
exchange, acceleration of fluid mass) are.
|
||||
Inertial forces can be represented by $F = ma$
|
||||
|
||||
\begin{align*}
|
||||
m &\propto \rho l^3 \\
|
||||
a &= \frac{dv}{dt} \\
|
||||
&\therefore a \propto \frac v t \text{ and } t = \frac l v \\
|
||||
&\therefore a \propto \frac {v^2} l \\
|
||||
&\therefore \text{Interial forces} \propto \rho l^2\frac{v^2} l = \rho l^2v^2
|
||||
\end{align*}
|
||||
|
||||
The ratio of internal forces to viscous forces is called the Reynolds number and is abbreviated to
|
||||
Re:
|
||||
|
||||
$$\Rey = \frac{\text{interial forces}}{\text{viscous forces}} = \frac {\rho l^2v^2}{\mu vl} = \frac {\rho vl} \mu$$
|
||||
|
||||
where $\rho$ and $\mu$ are fluid properties and $v$ and $l$ are characteristic velocity and length.
|
||||
|
||||
- During laminar flow, $\Rey$ is small as viscous forces dominate.
|
||||
- During turbulent flow, $\Rey$ is large as inertial forces dominate.
|
||||
|
||||
\textRey is a non dimensional group.
|
||||
It has no units because the units cancel out.
|
||||
|
||||
Non dimensional groups are very important in fluid mechanics and need to be considered when scaling
|
||||
experiments.
|
||||
|
||||
If \textRey is the same in two different pipes, the flow will be the same regardless of actual
|
||||
diameters, densities, or other properties.
|
||||
|
||||
#### \textRey for a Circular Section Pipe
|
||||
|
||||
The characteristic length for pipe flow is the diameter $d$ and the characteristic velocity is
|
||||
mean flow in the pipe, $v$, so \textRey of a circular pipe section is given by:
|
||||
|
||||
$$\Rey = \frac{\rho vd} \mu$$
|
||||
|
||||
For flow in a smooth circular pipe under normal engineering conditions the following can be assumed:
|
||||
|
||||
- $\Rey < 2000$ --- laminar flow
|
||||
- $2000 < \Rey < 4000$ --- transition
|
||||
- $\Rey > 4000$ --- fully turbulent flow
|
||||
|
||||
These figures can be significantly affected by surface roughness so flow may be turbulent below
|
||||
$\Rey = 4000$.
|
||||
|
||||
# Euler's Equation
|
||||
|
||||
In a static fluid, pressure only depends on density and elevation.
|
||||
In a moving fluid the pressure is also related to acceleration, viscosity, and shaft work done on or
|
||||
by the fluid.
|
||||
|
||||
$$\frac 1 \rho \frac{\delta p}{\delta s} + g\frac{\delta z}{\delta s} + v\frac{\delta v}{\delta s} = 0$$
|
||||
|
||||
## Assumptions / Conditions
|
||||
|
||||
The Euler equation applies where the following can be assumed:
|
||||
|
||||
- Steady flow
|
||||
- The fluid is inviscid
|
||||
- No shaft work
|
||||
- Flow along a streamline
|
||||
|
||||
# Bernoulli's Equation
|
||||
|
||||
Euler's equation comes in differential form, which is difficult to apply.
|
||||
We can integrate it to make it easier
|
||||
|
||||
\begin{align*}
|
||||
\frac 1 \rho \frac{\delta p}{\delta s} + g\frac{\delta z}{\delta s} + v\frac{\delta v}{\delta s} &= 0
|
||||
& \text{(Euler's equation)} \\
|
||||
\int\left\{\frac{\mathrm{d}p} \rho + g\mathrm{d}z + v\mathrm{d}v \right\} &= \int 0 \,\mathrm{d}s \\
|
||||
\therefore \int \frac 1 \rho \,\mathrm{d}p + g\int \mathrm{d}z + \int v \,\mathrm{d}v &= \int 0 \,\mathrm{d}s \\
|
||||
\therefore \int \frac 1 \rho \,\mathrm{d}p + gz + \frac{v^2}{2} &= \text{constant}_1
|
||||
\end{align*}
|
||||
|
||||
The first term of the equation can only be integrated if $\rho$ is constant as then:
|
||||
|
||||
$$\int \frac 1 \rho \,\mathrm{d}p = \frac 1 \rho \int \mathrm{d}p = \frac p \rho$$
|
||||
|
||||
So, if density is constant:
|
||||
|
||||
$$\frac p \rho + gz + \frac{v^2}{2} = \text{constant}_2$$
|
||||
|
||||
## Assumptions / Conditions
|
||||
|
||||
All the assumptions from Euler's equation apply:
|
||||
|
||||
- Steady flow
|
||||
- The fluid is inviscid
|
||||
- No shaft work
|
||||
- Flow along a streamline
|
||||
|
||||
But also one more:
|
||||
|
||||
- Incompressible flow
|
||||
|
||||
## Forms of Bernoulli's Equation
|
||||
|
||||
### Energy Form
|
||||
|
||||
This form of Bernoulli's Equation is known as the energy form as each component has the units
|
||||
energy/unit mass:
|
||||
|
||||
$$\frac p \rho + gz + \frac{v^2}{2} = \text{constant}_2$$
|
||||
|
||||
It is split into 3 parts:
|
||||
|
||||
- Pressure energy ($\frac p \rho$) --- energy needed to move the flow against the pressure
|
||||
(flow work)
|
||||
- Potential energy ($gz$) --- elevation
|
||||
- Kinetic energy ($\frac{v^2}{2}$) --- kinetic energy
|
||||
|
||||
### Elevation / Head Form
|
||||
|
||||
Divide the energy form by $g$:
|
||||
|
||||
$$\frac p {\rho g} + z + \frac{v^2}{2g} = H_T$$
|
||||
|
||||
where $H_T$ is constant and:
|
||||
|
||||
- $\frac{p}{\rho g}$ --- static/pressure head
|
||||
- $z$ --- elevation head
|
||||
- $\frac{v_2}{2g}$ --- dynamic/velocity head
|
||||
- $H_T$ --- total head
|
||||
|
||||
- Each term now has units of elevations
|
||||
- In fluids the elevation is sometimes called head
|
||||
- This form of the equation is also useful in some applications
|
||||
|
||||
### Pressure Form
|
||||
|
||||
Multiply the energy form by $\rho$ to give the pressure form:
|
||||
|
||||
$$p + \rho gz + \frac 1 2 \rho v^2 = \text{constant}$$
|
||||
|
||||
where:
|
||||
|
||||
- $p$ --- static pressure (often written as $p_s$)
|
||||
- $\rho gz$ --- elevation pressure
|
||||
- $\frac 1 2 \rho v^2$ --- dynamic pressure
|
||||
|
||||
- Density is constant
|
||||
- Each term now has the units of pressure
|
||||
- This form is useful is we are interested in pressures
|
||||
|
||||
### Comparing two forms of the Bernoulli Equation (Piezometric)
|
||||
|
||||
$$\text{piezometric} = \text{static} + \text{elevation}$$
|
||||
|
||||
Pressure form:
|
||||
|
||||
\begin{align*}
|
||||
p_s + \rho gz + \frac 1 2 \rho v^2 &= \text{total pressure} \\
|
||||
p_s + \rho gz &= \text{piezometric pressure}
|
||||
\end{align*}
|
||||
|
||||
Head form:
|
||||
|
||||
\begin{align*}
|
||||
\frac{p_s}{\rho g} + z + \frac{v^2}{2g} &= \text{total head} \\
|
||||
\frac{p_s}{\rho g} + z &= \text{piezometric head}
|
||||
\end{align*}
|
||||
|
||||
# Steady Flow Energy Equation (SFEE) and the Extended Bernoulli Equation (EBE)
|
||||
|
||||
SFEE is a more general equation that can be applied to **any fluid** and also is also takes
|
||||
**heat energy** into account.
|
||||
This is useful in applications such as a fan heater, jet engines, ICEs, and steam turbines.
|
||||
|
||||
The equation deals with 3 types of energy transfer:
|
||||
|
||||
1. Thermal energy transfer (e.g. heat transfer from central heating to a room)
|
||||
2. Work energy transfer (e.g. shaft from car engine that turns wheels)
|
||||
3. Energy transfer in fluid flows (e.g. heat energy in a flow, potential energy in a flow, kinetic
|
||||
energy in a flow)
|
||||
|
||||
## Derivation of Steady Flow Energy Equation
|
||||
|
||||
#### Consider a control volume with steady flows in and out and steady transfers of work and heat.
|
||||
|
||||
The properties don't change with time at any any location and are considered uniform over inlet and
|
||||
outlet areas $A_1$ and $A_2$.
|
||||
|
||||
For steady flow, the mass, $m$, of the fluid **within the control volume** and the total energy, $E$,
|
||||
must be constant.
|
||||
|
||||
$E$ includes **all forms for energy** but we only consider internal, kinetic, and potential energy.
|
||||
|
||||
#### Consider a small time interval $\delta t$.
|
||||
|
||||
During $\delta t$, mass $\delta m_1$ enters the control volume and $\delta m_2$ leaves:
|
||||
|
||||

|
||||
|
||||
The specific energy $e_1$ of fluid $\delta m_1$ is the sum of the specific internal energy, specific
|
||||
kinetic energy, and specific potential energy:
|
||||
|
||||
$$e_1 = u_1 + \frac{v_1^2}{2} gz_1$$
|
||||
$$e_2 = u_2 + \frac{v_2^2}{2} gz_2$$
|
||||
|
||||
Since the mass is constant in the control volume, $\delta m_1 = \delta m_2$.
|
||||
|
||||
#### Applying the First Law of Thermodynamics
|
||||
|
||||
The control volume is a system for which $\delta E_1$ is added and $\delta E_2$ is removed::
|
||||
|
||||
$$\delta E = \delta E_2 - \delta E_1$$
|
||||
|
||||
$E$ is constant so applying the
|
||||
[first law of thermodynamics](thermodynamics.html#st-law-of-thermodynamics)
|
||||
we know that:
|
||||
|
||||
$$\delta Q + \delta W = \delta E$$
|
||||
|
||||
We can also say that:
|
||||
|
||||
$$\delta E = \delta E_2 - \delta E_1 = \delta m(e_2 - e_1)$$
|
||||
|
||||
#### The Work Term
|
||||
|
||||
The work term, $\delta W$, is made up of shaft work **and the work necessary to deform the system**
|
||||
(by adding $\delta m_1$ at the inlet and removing $\delta m_2$ at the outlet):
|
||||
|
||||
$$\delta W = \delta W_s + \text{net flow work}$$
|
||||
|
||||
Work is done **on** the system by the mass entering and **by** the system on the mass leaving.
|
||||
|
||||
For example, at the inlet:
|
||||
|
||||

|
||||
|
||||
$$\text{work done on system} = \text{force} \times \text{distance} = p_1A_1\delta x = p_1\delta V_1$$
|
||||
|
||||
Knowing this, we can write:
|
||||
|
||||
$$\delta W = \delta W_s + (p_1\delta V_1 - p_2\delta V_2)$$
|
||||
|
||||
#### Back to the First Law
|
||||
|
||||
Substituting these equations:
|
||||
|
||||
$$\delta E = \delta E_2 - \delta E_1 = \delta m(e_2 - e_1)$$
|
||||
$$\delta W = \delta W_s + (p_1\delta V_1 - p_2\delta V_2)$$
|
||||
|
||||
into:
|
||||
|
||||
$$\delta Q + \delta W = \delta E$$
|
||||
|
||||
gives us:
|
||||
|
||||
$$\delta Q + \left[ \delta W_s + (p_1\delta V_1 - p_2\delta V_2)\right] = \delta m (e_2-e_1)$$
|
||||
|
||||
Dividing everything by $\delta m$ and with a bit of rearranging we get:
|
||||
|
||||
$$q + w_s = e_2-e_1 + \frac{p_2}{\rho_2} - \frac{p_1}{\rho_1}$$
|
||||
|
||||
#### Substitute Back for $e$
|
||||
|
||||
$$e = u + \frac{v^2}{2} + gz$$
|
||||
|
||||
This gives us:
|
||||
|
||||
$$q + w_s + \left[ u_2 + \frac{p_2}{\rho_2} + gz_2 + \frac{v_2^2}{2} \right] - \left[ u_1 + \frac{p_1}{\rho_1} + gz_1 + \frac{v_1^2}{2} \right]$$
|
||||
|
||||
#### Rearrange and Substitute for Enthalpy
|
||||
|
||||
By definition, enthalpy $h = u + pv = u + \frac p \rho$.
|
||||
This gives us the equation:
|
||||
|
||||
$$q + w_s = (h_2 - h_1) + g(z_2-z_1) + \frac{v_2^2-v_1^2}{2}$$
|
||||
|
||||
This equation is in specific energy form.
|
||||
|
||||
Multiplying by mass flow rate will give you the power form.
|
||||
|
||||
## Application of the Steady Flow Energy Equation
|
||||
|
||||
#### Heat Transfer Devices
|
||||
|
||||
Like heat exchangers, boilers, condensers, and furnaces.
|
||||
|
||||
In this case, $\dot W = 0$, $\delta z ~ 0$, and $\delta v^2 ~ 0$ so the equation can be simplified
|
||||
to just
|
||||
|
||||
$$\dot Q = \dot m(h_2-h_1) = \dot m c_p(T_2-T_1)$$
|
||||
|
||||
#### Throttle Valve
|
||||
|
||||
No heat and work transfer.
|
||||
Often you can neglect potential and kinetic energy terms, giving you:
|
||||
|
||||
$$0 = h_2-h_1)$$
|
||||
|
||||
#### Work Transfer Devices
|
||||
|
||||
e.g. Turbines, Pumps, Fans, and Compressors
|
||||
|
||||
For these there is often no heat transfer ($\dot Q = 0$) and we can neglect potential
|
||||
($\delta z ~ 0$) and kinetic ($\delta v^2 ~ 0$) energy terms, giving us the equation
|
||||
|
||||
$$\dot W = \dot m (h_2-h_1) = \dot m c_p(T_2-T_1)$$
|
||||
|
||||
#### Mixing Devices
|
||||
|
||||
e.g. Hot and cold water in a shower
|
||||
|
||||
In these processes, work and heat transfers are not important and you can often
|
||||
neglect potential and kinetic energy terms, giving us the same equation as for the throttle valve
|
||||
earlier:
|
||||
|
||||
$$0 = h_2-h_1$$
|
||||
|
||||
which you may want to write more usefully as:
|
||||
|
||||
$$\sum \dot m h_{out} = \sum \dot m h_{in}$$
|
||||
|
||||
## SFEE for Incompressible Fluids and Extended Bernoulli Equation
|
||||
|
||||
$$\frac{w_s}{g} = H_{T2} - H_{T1} + \left[ \frac{(u_2-u_1)-1}{g}\ \right]$$
|
||||
|
||||
or
|
||||
|
||||
$$w_s = g(H_{T2}-H_{T1}+H_f$$
|
||||
|
||||
If we assume shaft work, $w_s$, is 0, then we can get this equation:
|
||||
|
||||
$$H_{T1}-H_{T2} = H_f$$
|
||||
|
||||
This is very similar to the Bernoulli equation.
|
||||
The difference is that it considers friction so it can be applied to real fluids, not just ideal
|
||||
ones.
|
||||
It is called the *Extended Bernoulli Equation*.
|
||||
|
||||
The assumptions remain:
|
||||
|
||||
- Steady flow
|
||||
- No shaft work
|
||||
- Incompressible
|
||||
|
||||
### $H_f$ for Straight Pipes
|
||||
|
||||
$$H_f = \frac{4fL}{D} \frac{v^2}{2g}$$
|
||||
|
||||
$$\Delta p = \rho g H_f \text{ (pressure form)}$$
|
||||
|
||||
This equation applies to long, round and straight pipes.
|
||||
It applies to both laminar and turbulent flow.
|
||||
|
||||
However be aware that in North America the equation is:
|
||||
|
||||
$$H_f = f \frac{L}{D} \frac{v^2}{2g}$$
|
||||
|
||||
Their $f$ (the Darcy Friction Factor) is four times our $f$ (Fanning Friction Factor).
|
||||
In mainland Europe, they use $\lambda = 4f_{Fanning}$, which is probably the least confusing version
|
||||
to use.
|
||||
|
||||
### Finding $f$
|
||||
|
||||
#### $f$ for Laminar Flow
|
||||
|
||||
$$f = \frac{16}{\Rey}$$
|
||||
|
||||
#### $f$ for Turbulent Flow
|
||||
|
||||
For turbulent flow, the value defends on relative pipe roughness ($k' = \frac k d$) and Reynolds
|
||||
number.
|
||||
|
||||
Note when calculating $k'$ that **both $k$ and $d$ are measured in mm** for some reason.
|
||||
|
||||
A *Moody Chart* is used to find $f$:
|
||||
|
||||

|
||||
|
||||
### Hydraulic Diameter
|
||||
|
||||
$$D_h = \frac{4 \times \text{duct area}}{\text{perimeter}}$$
|
||||
|
||||
### Loss Factor $K$
|
||||
|
||||
There are many parts of the pipe where losses can occur.
|
||||
|
||||
It is convenient to represent these losses in terms of loss factor, $K$, times the velocity head:
|
||||
|
||||
$$H_f = K \frac{v^2}{g}$$
|
||||
|
||||
Most manufacturers include loss factors in their data sheets.
|
||||
|
||||
#### Loss Factor of Entry
|
||||
|
||||

|
||||
|
||||
#### Loss Factor of Expansion
|
||||
|
||||
$$K = \left( \frac{A_2}{A_1} - 1\right)^2$$
|
||||
|
||||
This also tells us the loss factor on exit is basically 1.
|
||||
|
||||
For conical expansions, $K ~ 0.08$ (15 degrees cone angle),
|
||||
$K ~ 0.25$ (30 degrees).
|
||||
For cones you use the inlet velocity.
|
||||
|
||||
#### Loss Factor of Contraction
|
||||
|
||||
$\frac{d_2}{d_1}$ | K
|
||||
----------------- | ----
|
||||
0 | 0.5
|
||||
0.2 | 0.45
|
||||
0.4 | 0.38
|
||||
0.6 | 0.28
|
||||
0.8 | 0.14
|
||||
1.0 | 0
|
||||
|
||||
#### Loss Factor of Pipe Bends
|
||||
|
||||
On a sharp bend, $K ~ 0.9$.
|
||||
|
||||
On a bend with a radius, $K ~ 0.16-0.35$.
|
||||
|
||||
#### Loss Factor of Nozzle
|
||||
|
||||
$$K ~ 0.05$$
|
||||
|
||||
But you use the outlet velocity, increasing losses.
|
512
uni/mmme/1048_thermodynamics_and_fluid_mechanics/fluid_mechanics.md
Executable file
@@ -0,0 +1,512 @@
|
||||
---
|
||||
author: Alvie Rahman
|
||||
date: \today
|
||||
title: MMME1048 // Fluid Mechanics Intro and Statics
|
||||
tags:
|
||||
- uni
|
||||
- nottingham
|
||||
- mechanical
|
||||
- engineering
|
||||
- fluid_mechanics
|
||||
- mmme1048
|
||||
- fluid_statics
|
||||
uuid: 43e8eefa-567f-438b-b93d-63ae08e61d8f
|
||||
---
|
||||
|
||||
# Properties of Fluids
|
||||
|
||||
## What is a Fluid?
|
||||
|
||||
- A fluid may be liquid, vapour, or gas
|
||||
- No permanent shape
|
||||
- Consists of atoms in random motion and continual collision
|
||||
- Easy to deform
|
||||
- Liquids have fixed volume, gasses fill up container
|
||||
- **A fluid is a substance for which a shear stress tends to produce unlimited, continuous
|
||||
deformation**
|
||||
|
||||
## Shear Forces
|
||||
|
||||
- For a solid, application of shear stress causes a deformation which, if not too great (elastic),
|
||||
is not permanent and solid regains original position
|
||||
- For a fluid, continuous deformation takes place as the molecules slide over each other until the
|
||||
force is removed
|
||||
|
||||
## Density
|
||||
|
||||
- Density: $$ \rho = \frac m V $$
|
||||
- Specific Density: $$ v = \frac 1 \rho $$
|
||||
|
||||
### Obtaining Density
|
||||
|
||||
- Find mass of a given volume or volume of a given mass
|
||||
- This gives average density and assumes density is the same throughout
|
||||
|
||||
- This is not always the case (like in chocolate chip ice cream)
|
||||
- Bulk density is often used to refer to average density
|
||||
|
||||
### Engineering Density
|
||||
|
||||
- Matter is not continuous on molecular scale
|
||||
- For fluids in constant motion, we take a time average
|
||||
- For most practical purposes, matter is considered to be homogeneous and time averaged
|
||||
|
||||
## Pressure
|
||||
|
||||
- Pressure is a scalar quantity
|
||||
- Gases cannot sustain tensile stress, liquids a negligible amount
|
||||
|
||||
- There is a certain amount of energy associated with the random continuous motion of the molecules
|
||||
- Higher pressure fluids tend to have more energy in their molecules
|
||||
|
||||
### How Does Molecular Motion Create Force?
|
||||
|
||||
- When molecules interact with each other, there is no net force
|
||||
- When they interact with walls, there is a resultant force perpendicular to the surface
|
||||
- Pressure caused my molecule: $$ p = \frac {\delta{}F}{\delta{}A} $$
|
||||
- If we want total force, we have to add them all up
|
||||
- $$ F = \int \mathrm{d}F = \int p\, \mathrm{d}A $$
|
||||
|
||||
- If pressure is constant, then this integrates to $$ F = pA $$
|
||||
- These equations can be used if pressure is constant of average value is appropriate
|
||||
- For many cases in fluids pressure is not constant
|
||||
|
||||
### Pressure Variation in a Static Fluid
|
||||
|
||||
- A fluid at rest has constant pressure horizontally
|
||||
- That's why liquid surfaces are flat
|
||||
- But fluids at rest do have a vertical gradient, where lower parts have higher pressure
|
||||
|
||||
### How Does Pressure Vary with Depth?
|
||||
|
||||

|
||||
|
||||
Let fluid pressure be p at height $z$, and $p + \delta p$ at $z + \delta z$.
|
||||
|
||||
Force $F_z$ acts upwards to support the fluid, countering pressure $p$.
|
||||
|
||||
Force $F_z + \delta F_z$acts downwards to counter pressure $p + \delta p$ and comes from the weight
|
||||
of the liquid above.
|
||||
|
||||
Now:
|
||||
|
||||
\begin{align*}
|
||||
F_z &= p\delta x\delta y \\
|
||||
F_z + \delta F_z &= (p + \delta p) \delta x \delta y \\
|
||||
\therefore \delta F_z &= \delta p(\delta x\delta y)
|
||||
\end{align*}
|
||||
|
||||
Resolving forces in z direction:
|
||||
|
||||
\begin{align*}
|
||||
F_z - (F_z + \delta F_z) - g\delta m &= 0 \\
|
||||
\text{but } \delta m &= \rho\delta x\delta y\delta z \\
|
||||
\therefore -\delta p(\delta x\delta y) &= g\rho(\delta x\delta y\delta z) \\
|
||||
\text{or } \frac{\delta p}{\delta z} &= -\rho g \\
|
||||
\text{as } \delta z \rightarrow 0,\, \frac{\delta p}{\delta z} &\rightarrow \frac{dp}{dz}\\
|
||||
\therefore \frac{dp}{dz} &= -\rho g\\
|
||||
\Delta p &= \rho g\Delta z
|
||||
\end{align*}
|
||||
|
||||
The equation applies for any fluid.
|
||||
The -ve sign indicates that as $z$, height, increases, $p$, pressure, decreases.
|
||||
|
||||
### Absolute and Gauge Pressure
|
||||
|
||||
- Absolute Pressure is measured relative to zero (a vacuum)
|
||||
- Gauge pressure = absolute pressure - atmospheric pressure
|
||||
|
||||
- Often used in industry
|
||||
|
||||
- If absolute pressure = 3 bar and atmospheric pressure is 1 bar, then gauge pressure = 2 bar
|
||||
- Atmospheric pressure changes with altitude
|
||||
|
||||
## Compressibility
|
||||
|
||||
- All fluids are compressible, especially gasses
|
||||
- Most liquids can be considered **incompressible** most of the time (and will be in MMME1048, but
|
||||
may not be in future modules)
|
||||
|
||||
## Surface Tension
|
||||
|
||||
- In a liquid, molecules are held together by molecular attraction
|
||||
- At a boundary between two fluids this creates "surface tension"
|
||||
- Surface tension usually has the symbol $$\gamma$$
|
||||
|
||||
## Ideal Gas
|
||||
|
||||
- No real gas is perfect, although many are similar
|
||||
- We define a specific gas constant to allow us to analyse the behaviour of a specific gas:
|
||||
|
||||
$$ R = \frac {\tilde R}{\tilde m} $$
|
||||
|
||||
(Universal Gas Constant / molar mass of gas)
|
||||
|
||||
- Perfect gas law
|
||||
|
||||
$$pV=mRT$$
|
||||
|
||||
or
|
||||
|
||||
$$ p = \rho RT$$
|
||||
|
||||
- Pressure always in Pa
|
||||
- Temperature always in K
|
||||
|
||||
## Units and Dimensional Analysis
|
||||
|
||||
- It is usually better to use SI units
|
||||
- If in doubt, DA can be useful to check that your answer makes sense
|
||||
|
||||
# Fluid Statics
|
||||
|
||||
## Manometers
|
||||
|
||||

|
||||
|
||||
$$p_{1,gauge} = \rho g(z_2-z_1)$$
|
||||
|
||||
- Manometers work on the principle that pressure along any horizontal plane through a continuous
|
||||
fluid is constant
|
||||
- Manometers can be used to measure the pressure of a gas, vapour, or liquid
|
||||
- Manometers can measure higher pressures than a piezometer
|
||||
- Manometer fluid and working should be immiscible (don't mix)
|
||||
|
||||

|
||||
|
||||
\begin{align*}
|
||||
p_A &= p_{A'} \\
|
||||
p_{bottom} &= p_{top} + \rho gh \\
|
||||
\rho_1 &= density\,of\,fluid\,1 \\
|
||||
\rho_2 &= density\,of\,fluid\,2
|
||||
\end{align*}
|
||||
|
||||
Left hand side:
|
||||
|
||||
$$p_A = p_1 + \rho_1g\Delta z_1$$
|
||||
|
||||
Right hand side:
|
||||
|
||||
$$p_{A'} = p_{at} + \rho_2g\Delta z_2$$
|
||||
|
||||
Equate and rearrange:
|
||||
|
||||
\begin{align*}
|
||||
p_1 + \rho_1g\Delta z_1 &= p_{at} + \rho_2g\Delta z_2 \\
|
||||
p_1-p_{at} &= g(\rho_2\Delta z_2 - \rho_1\Delta z_1) \\
|
||||
p_{1,gauge} &= g(\rho_2\Delta z_2 - \rho_1\Delta z_1)
|
||||
\end{align*}
|
||||
|
||||
If $\rho_a << \rho_2$:
|
||||
|
||||
$$\rho_{1,gauge} \approx \rho_2g\Delta z_2$$
|
||||
|
||||
### Differential U-Tube Manometer
|
||||
|
||||

|
||||
|
||||
- Used to find the difference between two unknown pressures
|
||||
- Can be used for any fluid that doesn't react with manometer fluid
|
||||
- Same principle used in analysis
|
||||
|
||||
\begin{align*}
|
||||
p_A &= p_{A'} \\
|
||||
p_{bottom} &= p_{top} + \rho gh \\
|
||||
\rho_1 &= density\,of\,fluid\,1 \\
|
||||
\rho_2 &= density\,of\,fluid\,2
|
||||
\end{align*}
|
||||
|
||||
Left hand side:
|
||||
|
||||
$$p_A = p_1 + \rho_wg(z_C-z_A)$$
|
||||
|
||||
Right hand side:
|
||||
|
||||
$$p_B = p_2 + \rho_wg(z_C-z_B)$$
|
||||
|
||||
Right hand manometer fluid:
|
||||
|
||||
$$p_{A'} = p_B + \rho_mg(z_B - z_a)$$
|
||||
|
||||
\begin{align*}
|
||||
p_{A'} &= p_2 + \rho_mg(z_C - z_B) + \rho_mg(z_B - zA)\\
|
||||
&= p_2 + \rho_mg(z_C - z_B) + \rho_mg\Delta z \\
|
||||
\\
|
||||
p_A &= p_{A'} \\
|
||||
p_1 + \rho_wg(z_C-z_A) &= p_2 + \rho_mg(z_C - z_B) + \rho_mg\Delta z \\
|
||||
p_1 - p_2 &= \rho_wg(z_C-z_B-z_C+z_A) + \rho_mg\Delta z \\
|
||||
&= \rho_wg(z_A-z_B) + \rho_mg\Delta z \\
|
||||
&= -\rho_wg\Delta z + \rho_mg\Delta z
|
||||
\end{align*}
|
||||
|
||||
### Angled Differential Manometer
|
||||
|
||||

|
||||
|
||||
- If the pipe is sloped then
|
||||
|
||||
$$p_1-p_2 = (\rho_m-\rho_w)g\Delta z + \rho_wg(z_{C2} - z_{C1})$$
|
||||
|
||||
- $p_1 > p_2$ as $p_1$ is lower
|
||||
- If there is no flow along the tube, then
|
||||
|
||||
$$p_1 = p_2 + \rho_wg(z_{C2} - z_{C1})$$
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
### Exercise Sheet 1
|
||||
|
||||
</summary>
|
||||
|
||||
1. If 4 m$^3$ of oil weighs 35 kN calculate its density and relative density.
|
||||
Relative density is a term used to define the density of a fluid relative
|
||||
|
||||
> $$ \frac{35000}{9.81\times4} = 890 \text{ kgm}^{-3} $$
|
||||
>
|
||||
> $$1000 - 891.9... = 108 \text{ kgm}^{-3}$$
|
||||
|
||||
2. Find the pressure relative to atmospheric experienced by a diver
|
||||
working on the sea bed at a depth of 35 m.
|
||||
Take the density of sea water to be 1030 kgm$^{-3}$.
|
||||
|
||||
> $$
|
||||
> \rho gh = 1030\times 9.81 \times 35 = 3.5\times10^5
|
||||
> $$
|
||||
|
||||
3. An open glass is sitting on a table, it has a diameter of 10 cm.
|
||||
If water up to a height of 20 cm is now added calculate the force exerted onto the table by
|
||||
the addition of the water.
|
||||
|
||||
> $$V_{cylinder} = \pi r^2h$$
|
||||
> $$m_{cylinder} = \rho\pi r^2h$$
|
||||
> $$W_{cylinder} = \rho g\pi r^2h = 1000\times9.8\pi\times0.05^2\times0.2 = 15.4 \text{ N} $$
|
||||
|
||||
4. A closed rectangular tank with internal dimensions 6m x 3m x 1.5m
|
||||
high has a vertical riser pipe of cross-sectional area 0.001 m2 in
|
||||
the upper surface (figure 1.4). The tank and riser are filled with
|
||||
water such that the water level in the riser pipe is 3.5 m above the
|
||||
|
||||
Calculate:
|
||||
|
||||
i. The gauge pressure at the base of the tank.
|
||||
|
||||
> $$\rho gh = 1000\times9.81\times(1.5+3.5) = 49 \text{ kPa}$$
|
||||
|
||||
ii. The gauge pressure at the top of the tank.
|
||||
|
||||
> $$\rho gh = 1000\times9.81\times3.5 = 34 \text{ kPa}$$
|
||||
|
||||
iii. The force exerted on the base of the tank due to gauge water pressure.
|
||||
|
||||
> $$F = p\times A = 49\times10^3\times6\times3 = 8.8\times10^5 \text{ N}$$
|
||||
|
||||
iv. The weight of the water in the tank and riser.
|
||||
|
||||
> $$V = 6\times3\times1.5 + 0.001\times3.5 = 27.0035$$
|
||||
> $$W = \rho gV = 1000\times9.8\times27.0035 = 2.6\times10^5\text{ N}$$
|
||||
|
||||
v. Explain the difference between (iii) and (iv).
|
||||
|
||||
*(It may be helpful to think about the forces on the top of the tank)*
|
||||
|
||||
> The pressure at the top of the tank is higher than atmospheric pressure because of the
|
||||
> riser.
|
||||
> This means there is an upwards force on the top of tank.
|
||||
> The difference between the force acting up and down due to pressure is equal to the
|
||||
> weight of the water.
|
||||
|
||||
6. A double U-tube manometer is connected to a pipe as shown below.
|
||||
|
||||
Taking the dimensions and fluids as indicated; calculate
|
||||
the absolute pressure at point A (centre of the pipe).
|
||||
|
||||
Take atmospheric pressure as 1.01 bar and the density of mercury as 13600 kgm$^{-3}$.
|
||||
|
||||

|
||||
|
||||
> \begin{align*}
|
||||
P_B &= P_A + 0.4\rho_wg &\text{(1)}\\
|
||||
P_C = P_{C'} &= P_B - 0.2\rho_mg &\text{(2)}\\
|
||||
P_D = P_{at} &= P_A + 0.4\rho_wg &\text{(3)}\\
|
||||
\\
|
||||
\text{(2) into (3)} &\rightarrow P_B -0.2\rho_mg-0.1\rho_wg = P_{at} &\text{(4)}\\
|
||||
\text{(1) into (4)} &\rightarrow P_A + 0.4\rho_wg - 0.2\rho_mg - 0.1\rho_wg = P_{at} \\
|
||||
\\
|
||||
P_A &= P_{at} + 0.1\rho_wg + 0.2\rho_mg - 0.4\rho_wg \\
|
||||
&= P_{at} + g(0.2\rho_m - 0.3\rho_w) \\
|
||||
&= 1.01\times10^5 + 9.81(0.2\times13600 - 0.3\times1000)\\
|
||||
&= 124.7\text{ kPa}
|
||||
> \end{align*}
|
||||
|
||||
</details>
|
||||
|
||||
## Submerged Surfaces
|
||||
|
||||
### Preparatory Maths
|
||||
|
||||
#### Integration as Summation
|
||||
|
||||
#### Centroids
|
||||
|
||||
- For a 3D body, the centre of gravity is the point at which all the mass can be considered to act
|
||||
- For a 2D lamina (thin, flat plate) the centroid is the centre of area, the point about which the
|
||||
lamina would balance
|
||||
|
||||
To find the location of the centroid, take moments (of area) about a suitable reference axis:
|
||||
|
||||
$$moment\,of\,area = moment\,of\,mass$$
|
||||
|
||||
(making the assumption that the surface has a unit mass per unit area)
|
||||
|
||||
$$moment\,of\,mass = mass\times distance\,from\,point\,acting\,around$$
|
||||
|
||||
Take the following lamina:
|
||||
|
||||

|
||||
|
||||
1. Split the lamina into elements parallel to the chosen axis
|
||||
2. Each element has area $\delta A = w\delta y$
|
||||
3. The moment of area ($\delta M$) of the element is $\delta Ay$
|
||||
4. The sum of moments of all the elements is equal to the moment $M$ obtained by assuming all the
|
||||
area is located at the centroid or:
|
||||
|
||||
$$Ay_c = \int_{area} \! y\,\mathrm{d}A$$
|
||||
|
||||
or:
|
||||
|
||||
$$y_c = \frac 1 A \int_{area} \! y\,\mathrm{d}A$$
|
||||
|
||||
- $\int y\,\mathrm{d}A$ is known as the first moment of area
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
##### Example 1
|
||||
|
||||
Determine the location of the centroid of a rectangular lamina.
|
||||
|
||||
</summary>
|
||||
|
||||
###### Determining Location in $y$ direction
|
||||
|
||||

|
||||
|
||||
1. Take moments for area about $OO$
|
||||
|
||||
$$\delta M = y\delta A = y(b\delta y)$$
|
||||
|
||||
2. Integrate to find all strips
|
||||
|
||||
$$M = b\int_0^d\! y \,\mathrm{d}y = b\left[\frac{y^2}2\right]_0^d = \frac{bd^2} 2$$
|
||||
|
||||
($b$ can be taken out the integral as it is constant in this example)
|
||||
|
||||
but also $$M = (area)(y_c) = bdy_c$$
|
||||
|
||||
so $$y_c = \frac 1 {bd} \frac {bd} 2 = \frac d 2$$
|
||||
|
||||
###### Determining Location in $x$ direction
|
||||
|
||||

|
||||
|
||||
1. Take moments for area about $O'O'$:
|
||||
|
||||
$$\delta M = x\delta A = x(d\delta x)$$
|
||||
|
||||
2. Integrate
|
||||
|
||||
$$M_{O'O'} = d\int_0^b\! x \,\mathrm{d}x = d\left[\frac{x^2} 2\right]_0^b = \frac{db^2} 2$$
|
||||
|
||||
but also $$M_{O'O'} = (area)(x_c) = bdx_c$$
|
||||
|
||||
so $$x_c = \frac{db^2}{2bd} = \frac b 2$$
|
||||
|
||||
</details>
|
||||
|
||||
### Horizontal Submerged Surfaces
|
||||
|
||||

|
||||
|
||||
Assumptions for horizontal lamina:
|
||||
|
||||
- Constant pressure acts over entire surface of lamina
|
||||
- Centre of pressure will coincide with centre of area
|
||||
- $total\,force = pressure\times area$
|
||||
|
||||

|
||||
|
||||
### Vertical Submerged Surfaces
|
||||
|
||||

|
||||
|
||||
- A vertical submerged plate does experience uniform pressure
|
||||
- Centroid of pressure and area are not coincident
|
||||
- Centroid of pressure is always below centroid of area for a vertical plate
|
||||
- No shear forces, so all hydrostatic forces are perpendicular to lamina
|
||||
|
||||

|
||||
|
||||
Force acting on small element:
|
||||
|
||||
\begin{align*}
|
||||
\delta F &= p\delta A \\
|
||||
&= \rho gh\delta A \\
|
||||
&= \rho gh w\delta h
|
||||
\end{align*}
|
||||
|
||||
Therefore total force is
|
||||
|
||||
$$F_p = \int_{area}\! \rho gh \,\mathrm{d}A = \int_{h_1}^{h_2}\! \rho ghw\,\mathrm{d}h$$
|
||||
|
||||
#### Finding Line of Action of the Force
|
||||
|
||||

|
||||
|
||||
\begin{align*}
|
||||
\delta M_{OO} &= \delta Fh = (\rho gh\delta A)h \\
|
||||
&= \rho gh^2\delta A = \rho gh^2w\delta h \\
|
||||
\\
|
||||
M_{OO} &= F_py_p = \int_{area}\! \rho gh^2 \,\mathrm{d}A \\
|
||||
&= \int_{h1}^{h2}\! \rho gh^2w \,\mathrm{d}h \\
|
||||
\\
|
||||
y_p = \frac{M_{OO}}{F_p}
|
||||
\end{align*}
|
||||
|
||||
## Buoyancy
|
||||
|
||||
### Archimedes Principle
|
||||
|
||||
> The resultant upwards force (buoyancy force) on a body wholly or partially immersed in a fluid is
|
||||
> equal to the weight of the displaced fluid.
|
||||
|
||||
When an object is in equilibrium the forces acting on it balance.
|
||||
For a floating object, the upwards force equals the weight:
|
||||
|
||||
$$mg = \rho Vg$$
|
||||
|
||||
Where $\rho$ is the density of the fluid, and $V$ is the volume of displaced fluid.
|
||||
|
||||
### Immersed Bodies
|
||||
|
||||
As pressure increases with depth, the fluid exerts a resultant upward force on a body.
|
||||
There is no horizontal component of the buoyancy force because the vertical projection of the body
|
||||
is the same in both directions.
|
||||
|
||||
### Rise, Sink, or Float?
|
||||
|
||||
- $F_B = W$ \rightarrow equilibrium (floating)
|
||||
- $F_B > W$ \rightarrow body rises
|
||||
- $F_B < W$ \rightarrow body sinks
|
||||
|
||||
### Centre of Buoyancy
|
||||
|
||||
Buoyancy force acts through the centre of gravity of the volume of fluid displaced.
|
||||
This is known as the centre of buoyancy.
|
||||
The centre of buoyancy does not in general correspond to the centre of gravity of the body.
|
||||
|
||||
If the fluid density is constant the centre of gravity of the displaced fluid is at the centroid of
|
||||
the immersed volume.
|
||||
|
||||

|
||||
|
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 104 KiB |