course_planning:184_projects:f17_project_10

This is an old revision of the document!


Since your team was so successful at creating the magnetic field detector for the hawkions, you have now been hired to analyze other characteristics of the hawkions, which it appears come in a variety of masses. To do this, you must sort out the hawkions by mass using a mass spectrometer. To design the spectrometer, your team is asked to develop a model of the spectrometer to determine the appropriate dimensions of the magnetic plates and the catching plate, which stops the hawkions. Below is the beginning of a model that was developed by another team that mysteriously disappeared.

GlowScript 2.6 VPython
 
 
## Model parameters
B = vec(0,0,-2)
magconstant = 1e-7
 
## Objects
magplate1 =  box(pos=vec(1,0,1), length=2, height=2, width=0.1, opacity=0.2)
magplate2 =  box(pos=vec(1,0,-1), length=2, height=2, width=0.1, opacity=0.2)
catchingplate = box(pos=vec(4,0,0), length=0.1, height=10, width=10, opacity=1)
xaxis = cylinder(pos=vector(-3,0,0), axis=vector(6,0,0), radius = 0.05, color=color.white)
yaxis = cylinder(pos=vector(0,-3,0), axis=vector(0,6,0), radius = 0.05, color=color.white)
zaxis = cylinder(pos=vector(0,0,-3), axis=vector(0,0,6), radius = 0.05, color=color.white)
 
 
## Set up particles
i = 0
N = 20
particleList = []
 
while i < N:
 
    particleList.append(sphere(pos=vec(-2-4*random(),0,0), radius = 0.1, m = 20*(random()+1), v = vec(2,0,0), q = 10, color=color.red))
    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,0,0)
 
    t = t + dt
  • course_planning/184_projects/f17_project_10.1509468247.txt.gz
  • Last modified: 2017/10/31 16:44
  • by dmcpadden