Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
course_planning:184_projects:f18_project_7 [2018/10/16 16:41] – created dmcpadden | course_planning:184_projects:f18_project_7 [2018/10/18 16:41] (current) – dmcpadden | ||
---|---|---|---|
Line 48: | Line 48: | ||
* Understand how to use a cross product conceptually and mathematically | * Understand how to use a cross product conceptually and mathematically | ||
* Explain the similarities and differences between electric and magnetic fields | * Explain the similarities and differences between electric and magnetic fields | ||
+ | </ | ||
+ | |||
+ | ==== Project 7B: Sorting Hawkions ==== | ||
+ | Since your team was so successful at creating the magnetic field detector for the Hawkions, the Lakeviewians have now hired you to analyze other characteristics of the Hawkions. The Hawkions appear to have a variety of masses, so you start by trying to sort the Hawkions by mass for further analysis (using a mass spectrometer). Before building the spectrometer, | ||
+ | |||
+ | <code python> | ||
+ | GlowScript 2.6 VPython | ||
+ | |||
+ | |||
+ | ## Model parameters | ||
+ | B = vec(0,0,-2) | ||
+ | magconstant = 1e-7 | ||
+ | |||
+ | ## Objects | ||
+ | magplateN = box(pos=vec(1, | ||
+ | magplateS = box(pos=vec(1, | ||
+ | catchingplate = box(pos=vec(4, | ||
+ | xaxis = cylinder(pos=vector(-3, | ||
+ | yaxis = cylinder(pos=vector(0, | ||
+ | zaxis = cylinder(pos=vector(0, | ||
+ | |||
+ | |||
+ | ## Set up particles | ||
+ | i = 0 | ||
+ | N = 20 | ||
+ | particleList = [] | ||
+ | |||
+ | while i < N: | ||
+ | | ||
+ | particleList.append(sphere(pos=vec(-2-4*random(), | ||
+ | i = i + 1 | ||
+ | |||
+ | ## Calculation Loop | ||
+ | t = 0 | ||
+ | dt = 0.01 | ||
+ | |||
+ | while t < 30: | ||
+ | | ||
+ | rate(300) | ||
+ | | ||
+ | for thisParticle in particleList: | ||
+ | | ||
+ | thisParticle.pos = thisParticle.pos + thisParticle.v*dt | ||
+ | | ||
+ | | ||
+ | if thisParticle.pos.x > catchingplate.pos.x: | ||
+ | | ||
+ | thisParticle.v = vector(0, | ||
+ | | ||
+ | t = t + dt | ||
+ | </ | ||
+ | |||
+ | <WRAP Info> | ||
+ | === Learning Goals === | ||
+ | * Use the right hand rule to relate the charge' | ||
+ | * Use circular motion to relate the radius of the particle' | ||
+ | * Understand what an "if statement" | ||
</ | </ | ||