Charged Balloons

Activity Description

Learning Goals

  • Use mathematical representations of Coulomb's Law to describe and predict the electrostatic force between objects ( HS-PS2-4)
  • Simulate interaction between charged objects using code (GlowScript)
    • Incorporate gravitational field into simulation

Prior Knowledge Required

  • Kinematics
  • Newton's 2nd Law
  • Electrostatics
    • Coulomb's Law
      • $F=k_{e}\dfrac{q_{1}q_{2}}{r^2}$

Code Manipulation

  • Define attributes (e.g. charge, mass) for coded objects
  • Modify existing code
  • Create new code
    • Model position, forces

Activity

Handout

Caballero Toy Company has developed a device that quickly and uniformly distributes an electrostatic charge on the surface of a balloon. Marketed as the Big Black Box (), the toy uses a small air compressor to consistently and reliably inflate balloons. In addition, the can positively and/or negatively charge the balloons using a proprietary functionality. The also allows for the magnitude of charge placed on the balloons to be adjusted.

The advertising department at Caballero Toy Company has asked your team of programmers to create a model to simulate the behavior of two balloons that have been charged by the . Your model should incorporate Coulomb's law to accurately demonstrate the forces and subsequent movement of the balloons. Additionally, the Company would like to be able to easily change the distance and charge magnitude parameters to see various balloon configurations (attraction and repulsion). As well, determine what an appropriate range of charge magnitudes the should be able to deliver.

Possible Extensions:

  • Model 3 or more balloons interacting
  • Model two charged balloons hanging from strings, incorporating the effects of gravity

Code

Link

  1. GlowScript 2.7 VPython
  2.  
  3. #get_library('https://rawgit.com/perlatmsu/physutil/master/js/physutil.js')
  4.  
  5. #Define some things
  6. k=9e9 #electrostatic constant
  7. t = 0 #time counter
  8. dt = 0.00005 #time increment
  9.  
  10. x1 = -5 #x location for charge 1
  11. y1 = 0 #y location for charge 1
  12. z1 = 0 #z location for charge 1
  13. m1 = 9e-31 #mass or charge 1
  14.  
  15. x2 = 5 #x location for charge 1
  16. y2 = 0 #y location for charge 1
  17. z2 = 0 #z location for charge 1
  18. m2 = 9e-31 #mass or charge 2
  19.  
  20. c1 = sphere(pos=vec(x1,y1,z1), color = vec(1,0,0)) #create charged particle 1
  21. c2 = sphere(pos=vec(x2,y2,z2), color = vec(0,1,0)) #create charged particle 2
  22.  
  23. r12 = c1.pos-c2.pos #distance between charge 1 and charge 2
  24.  
  25. c1.charge = 1.6e-19 #charge on charge 1 - note the sign of the charge
  26. c1.vel = vec(0,0,0) #initial velocity of charge 1
  27. c1.accel = vec(0,0,0) #initial acceleration of charge 1
  28.  
  29. c2.charge = -1.6e-19 #charge on charge 2 - note the sign of the charge
  30. c2.vel = vec(0,0,0) #initial velocity of charge 2
  31. c2.accel = vec(0,0,0) #initial acceleration of charge 2
  32.  
  33. #loop to move charged objects
  34. while mag(r12) = 0:
  35. rate(1000)
  36.  
  37. c1.eforcec2 = #electrostatic force of charge 2 on charge 1
  38. c2.eforcec1 = #electrostatic force of charge 1 on charge 2
  39.  
  40. #add electrostatic force arrow to charges
  41. attach_arrow (c1, "eforcec2", shaftwidth = .2, scale = 1e30, color = vector (1,0,0))
  42. attach_arrow (c2, "eforcec1", shaftwidth = .2, scale = 1e30, color = vector (0,1,0))
  43.  
  44. c1.accel = #acceleration of charge 1
  45. c2.accel = #acceleration of charge 2
  46.  
  47. c1.vel = #new velocity of charge 1
  48. c2.vel = #new velocity of charge 2
  49.  
  50. c1.pos = #new position of charge 1
  51. c2.pos = #new position of charge 2
  52.  
  53. r12 = #new distance between charge 1 and charge 2
  54.  
  55. t=t+dt #increment time variable

Answer Key

Handout

See highlighted code for notable changes to the program. The appropriate range of charge magnitudes should be in the nanocoulombs.

Code

Link

  1. GlowScript 2.7 VPython
  2.  
  3. #get_library('https://rawgit.com/perlatmsu/physutil/master/js/physutil.js')
  4.  
  5. #Define some things
  6. k=9e9 #electrostatic constant
  7. t = 0 #time counter
  8. dt = 0.00005 #time increment
  9.  
  10. x1 = -5 #x location for charge 1
  11. y1 = 0 #y location for charge 1
  12. z1 = 0 #z location for charge 1
  13. m1 = 9e-31 #mass or charge 1
  14.  
  15. x2 = 5 #x location for charge 1
  16. y2 = 0 #y location for charge 1
  17. z2 = 0 #z location for charge 1
  18. m2 = 9e-31 #mass or charge 2
  19.  
  20. c1 = sphere(pos=vec(x1,y1,z1), color = vec(1,0,0)) #create charged particle 1
  21. c2 = sphere(pos=vec(x2,y2,z2), color = vec(0,1,0)) #create charged particle 2
  22.  
  23. r12 = c1.pos-c2.pos #distance between charge 1 and charge 2
  24.  
  25. c1.charge = 1.6e-19 #charge on charge 1 - note the sign of the charge
  26. c1.vel = vec(0,0,0) #initial velocity of charge 1
  27. c1.accel = vec(0,0,0) #initial acceleration of charge 1
  28.  
  29. c2.charge = -1.6e-19 #charge on charge 2 - note the sign of the charge
  30. c2.vel = vec(0,0,0) #initial velocity of charge 2
  31. c2.accel = vec(0,0,0) #initial acceleration of charge 2
  32.  
  33. #loop to move charged objects
  34. while mag(r12) >= 2:
  35. rate(1000)
  36. c1.eforcec2 = (k*c1.charge*c2.charge*r12)/(mag(r12)**3) #electrostatic force of charge 2 on charge 1
  37. c2.eforcec1 = -c1.eforcec2 #electrostatic force of charge 1 on charge 2
  38.  
  39. #add electrostatic force arrow to charges
  40. attach_arrow (c1, "eforcec2", shaftwidth = .2, scale = 1e30, color = vector (1,0,0))
  41. attach_arrow (c2, "eforcec1", shaftwidth = .2, scale = 1e30, color = vector (0,1,0))
  42.  
  43. c1.accel = (c1.eforcec2/m1) #acceleration of charge 1
  44. c2.accel = (c2.eforcec1/m2) #acceleration of charge 2
  45.  
  46. c1.vel = c1.accel*t #new velocity of charge 1
  47. c2.vel = c2.accel*t #new velocity of charge 2
  48.  
  49. c1.pos = c1.pos+(c1.vel*t) #new position of charge 1
  50. c2.pos = c2.pos+(c2.vel*t) #new position of charge 2
  51.  
  52. r12 = c1.pos - c2.pos #new distance between charge 1 and charge 2
  53.  
  54. t=t+dt #increment time variable

See Also

  • repository/charged_balloons.txt
  • Last modified: 2021/03/24 23:40
  • by porcaro1