aboutsummaryrefslogtreecommitdiff
path: root/jarrio/week12.bc
blob: fe5a7bd92ef6fde0d53da57d17709a57360bc5c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
print "Weekly Practice 12\n"
qelem = 1.6*10^(-19) # C
pi = 4*a(1)
mu0 = 4*pi*10^(-7)
g = 9.81 # m/s^2
scale = 40

print "#1\n"
# magnetic field in this problem is |B| @ theta ccw from +x.
# we find the i and j components. i\times j = k. j\times i = -k.
#params
v1 = 1.25 * 10^6 #i m/s
f1 = 1.64 * 10^(-16) #k N
v2 = 2.49 * 10^6 #j m/s
f2 = -4.04* 10^(-16) #k N

# v1*bj*q = f1
bj = f1/v1/qelem
# v2*bi*q = -f2
bi = -f2/v2/qelem

print "Magnitude (T)\n"
sqrt((bi*10^16)^2 + (bj*10^16)^2)*10^(-16)

print "Angle ccw from +x axis (deg)\n"
a(bj/bi)*180/pi

scale = 40
print "#2\n"
#params
v = 4*10^4 # m/s
b = 5 # mT

m = 1.67*10^(-27) # kg
b = b/1000
a = (b*qelem*v/m)
r = v^2/a
# r = vm/bq
print "Diameter (m)\n"
2*r

print "#3\n"
#params
mf = 27 # mT
v = 5.5 * 10^6 # m/s
thdeg = 30

th = thdeg*pi/180
mf = mf/1000 # T
vx = v*c(th)
melec = 9.1*10^(-31)
r = vx*melec/(mf*qelem)
print "Radius (m)\n"
r
c = 2*pi*r
t = c/vx

print "Pitch (m)\n"
t*v*s(th)

print "#4\n"
#params
l = 52 # mass density - g/m
d = 4 # cm

d = d/100 # m
l = l/1000 # kg/m

w = l*g # N/m
# Up and down cancel out from the two base wires, so we get an mf of
# 2*mu0*I*s(60deg)/(2pi*d) and a force (per meter) of I*mf = w
# i^2 * 2*mu0*s(60*pi/180)/(2*pi*d) = w
i = sqrt(w/(2*mu0*s(60*pi/180)/(2*pi*d)))

print "Current (A)\n"
i

print "#5\n"
#params
s = 5.1 # cm
i = 470 # mA
b = 1.7 # T
thdeg = 30

# We use magnetic moment here

s = s/100 # m
i = i/1000 # A
th = thdeg*pi/180

print "Torque Magnitude (Nm)\n"
s^2*s(th)*b*i

print "#6\n"
#params
k = 12 # N/m - spring constant
d = .7 # cm
b = .5 # T
l = 20 # cm

d = d/100 # m
l = l/100 # m
f = 2*k*d # N (two springs, double the force)
# i*l*b = f
i = f/(l*b)

print "Current (A)\n"
i

print "#7\n"
#params
m = 4 # kg
s = 5.5 # m
i = 25 # A
thdeg = 25

th = thdeg*pi/180

w = m*g
t = w*s/2
a = s^2
# a*i*b = t
b = t/(a*i) # what happened to the angle lmao. this is right (??)

print "Magnetic field (T)\n"
b

print "#8\n"
#params
dv = .02 # V
l = 10 # cm
v = 5 # m/s

l = l/100 # m
ef = dv/l # some stackexchange article said so
# ef = v*b

print "Magnetic field into the page (T)\n"
ef/v

print "#9\n"
#params
b = .45 # T
v = .5 # m/s
ohm = 2 # Ohm
d = 10 # cm

d = d/100 # m
i = v*d*b/ohm # IMPORTANT !!!
p = i^2*ohm
# f*v = p
f = p/v

print "Pushing force (N)\n"
f

print "Power (W)\n"
p

print "Current - induced counterclockwise (A)\n"
i

print "Power dissipated by resistor (W)\n"
p