course_planning:184_projects:s18_project_9

This is an old revision of the document!


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 out the hawkions by mass (using a mass spectrometer). Before building the spectrometer, your team is asked to develop a model of the spectrometer to determine where the magnetic field should be relative to the catching plate, which stops the hawkions. Below is the beginning of a model that was developed by another team that mysteriously disappeared…

## Model parameters
B = vec(0,0,-2)
magconstant = 1e-7
 
## Objects
magplateN =  box(pos=vec(1,0,1), length=2, height=2, width=0.1, opacity=0.2)
magplateS =  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

Learning Goals

  • Use the right hand rule to relate the charge's speed and external magnetic field to the force on that charge.
  • Use circular motion to relate the radius of the particle's trajectory to it's force
  • Understand what an “if statement” does in the code
  • course_planning/184_projects/s18_project_9.1520958285.txt.gz
  • Last modified: 2018/03/13 16:24
  • by dmcpadden