diff options
author | Holden Rohrer <hr@hrhr.dev> | 2021-11-11 18:13:00 -0500 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2021-11-11 18:13:00 -0500 |
commit | 6cf6c1977c1cda2a7c123368630cc7703ddc5172 (patch) | |
tree | a8578d7da627cadf89361e4d07a043b6bf1cf758 /jarrio | |
parent | 54ca67bc4b75fe2ad6d2f68aa4eff61f781d2af8 (diff) |
more physics and linear homeworks
Diffstat (limited to 'jarrio')
-rw-r--r-- | jarrio/week11.bc | 67 | ||||
-rw-r--r-- | jarrio/week12.bc | 164 |
2 files changed, 231 insertions, 0 deletions
diff --git a/jarrio/week11.bc b/jarrio/week11.bc new file mode 100644 index 0000000..da49df1 --- /dev/null +++ b/jarrio/week11.bc @@ -0,0 +1,67 @@ +scale = 30 +qel = 1.602*10^(-19) # elementary charge in Coulombs +pi = 4*a(1) +mu0 = 4*pi * 10^(-7) + +print "Weekly Practice 11\n" + +vz = 4.8*10^7 # m/s +print "nonzero term on the first one\n" +-mu0/(4*pi) * qel*vz*.02/.02^3 + +print "nonzero term on the third one\n" +mu0/(4*pi) * qel*vz*.02/sqrt(.02^2+.02^2)^3 + +print "#2\n" +vy = 2*10^7 +print mu0/(4*pi) * qel*vy*.02/sqrt(.02^2+.02^2)^3 +print "k\n" + +print "#3 (T)\n" +#params +i = 4.8 # A +d = 1.9 # cm + +d = d/100 # m +r = d/2 # m +loopmag = mu0/(4*pi) * i*(pi*d)/r^2 +wiremag = mu0*i/(2*pi*r) +loopmag + wiremag + +print "#4 (T, pos = into screen, neg = out of screen)\n" +#params +i = 4 # A +r1 = .9 # cm +r2 = 1.8 # cm + +r1 = r1/100 # m +r2 = r2/100 # m + +# mu0/4pi Idl/r1^2 +(mu0 * i * (pi*r1)/r1^2 - mu0 * i * (pi*r2)/r2^2)/(4*pi) + +print "#5\n" +#params +l = 30 # cm +mf = 4.8 # mT +diamg18 = 1.02 # mm +ig18 = 6 # A +diamg26 = .41 # mm +ig26 = 1 # A + +# B*diamg18 = mu0*I +print "To reach necessary magnetic field with #26, current is\n" +mf*diamg26/mu0/10^6 +print "Therefore, we should use #18 with current (A)\n" +mf*diamg18/mu0/10^6 + +print "#7\n" +#params +l = 1.3 # m +mf = 1.4 # mT +i = 1.5 # A + +# Biot-Savart: mu0/4pi * idl/r^2 = B +# mu0/4pi * i * l / B = r^2 +print "Diameter is (m)\n" +sqrt(mu0/(4*pi) * i * l / mf * 1000)*2 diff --git a/jarrio/week12.bc b/jarrio/week12.bc new file mode 100644 index 0000000..fe5a7bd --- /dev/null +++ b/jarrio/week12.bc @@ -0,0 +1,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 |