Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
repository:charged_balloons [2020/03/17 19:36]
porcaro1 created
repository:charged_balloons [2021/03/24 23:40] (current)
porcaro1 [Answer Key]
Line 3: Line 3:
 ===Learning Goals=== ===Learning Goals===
   * Use mathematical representations of Coulomb'​s Law to describe and predict the electrostatic force between objects ([[https://​www.nextgenscience.org/​pe/​hs-ps2-4-motion-and-stability-forces-and-interactions | HS-PS2-4]])   * Use mathematical representations of Coulomb'​s Law to describe and predict the electrostatic force between objects ([[https://​www.nextgenscience.org/​pe/​hs-ps2-4-motion-and-stability-forces-and-interactions | HS-PS2-4]])
-    * $F=k_{e}\dfrac{q_{1}q_{2}}{r^2}$ 
   * Simulate interaction between charged objects using code (GlowScript)   * Simulate interaction between charged objects using code (GlowScript)
     * Incorporate gravitational field into simulation     * Incorporate gravitational field into simulation
Line 11: Line 10:
   * Electrostatics   * Electrostatics
     * Coulomb'​s Law     * Coulomb'​s Law
 +      * $F=k_{e}\dfrac{q_{1}q_{2}}{r^2}$ ​
 ===Code Manipulation=== ===Code Manipulation===
   * Define attributes (e.g. charge, mass) for coded objects   * Define attributes (e.g. charge, mass) for coded objects
Line 21: Line 21:
 ====Activity==== ====Activity====
 ===Handout=== ===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// (//B³//), the toy uses a small air compressor to consistently and reliably inflate balloons. In addition, the //B³// can positively and/or negatively charge the balloons using a proprietary functionality. The //B³// 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 //B³//. 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 //B³// 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=== ===Code===
 +[[https://​www.glowscript.org/#/​user/​porcaro1/​folder/​RepositoryPrograms/​program/​ChargedBalloons-Incomplete/​edit | Link]]
 +<code Python [enable_line_numbers="​true"​]>​
 +GlowScript 2.7 VPython
 +
 +#​get_library('​https://​rawgit.com/​perlatmsu/​physutil/​master/​js/​physutil.js'​)
 +
 +#Define some things
 +k=9e9 #​electrostatic constant
 +t = 0 #time counter
 +dt = 0.00005 #time increment
 +
 +x1 = -5 #x location for charge 1
 +y1 = 0 #y location for charge 1
 +z1 = 0 #z location for charge 1
 +m1 = 9e-31 #mass or charge 1
 +
 +x2 = 5 #x location for charge 1
 +y2 = 0 #y location for charge 1
 +z2 = 0 #z location for charge 1
 +m2 = 9e-31 #mass or charge 2
 +
 +c1 = sphere(pos=vec(x1,​y1,​z1),​ color = vec(1,0,0)) #create charged particle 1
 +c2 = sphere(pos=vec(x2,​y2,​z2),​ color = vec(0,1,0)) #create charged particle 2
 +
 +r12 = c1.pos-c2.pos #​distance ​ between charge 1 and charge 2
 +
 +c1.charge = 1.6e-19 #charge on charge 1 - note the sign of the charge
 +c1.vel = vec(0,0,0) #initial velocity of charge 1
 +c1.accel = vec(0,0,0) #initial acceleration of charge 1
 +
 +c2.charge = -1.6e-19 #charge on charge 2 - note the sign of the charge
 +c2.vel = vec(0,0,0) #initial velocity of charge 2
 +c2.accel = vec(0,0,0) #initial acceleration of charge 2
 +
 +#loop to move charged objects
 +while mag(r12) = 0:
 +   ​rate(1000)
 +   
 +   ​c1.eforcec2 =       #​electrostatic force of charge 2 on charge 1
 +   ​c2.eforcec1 =       #​electrostatic force of charge 1 on charge 2
 +  ​
 +   #add electrostatic force arrow to charges
 +   ​attach_arrow (c1, "​eforcec2",​ shaftwidth = .2, scale = 1e30, color = vector (1,0,0))
 +   ​attach_arrow (c2, "​eforcec1",​ shaftwidth = .2, scale = 1e30, color = vector (0,1,0))
 +   
 +   ​c1.accel =          #​acceleration of charge 1
 +   ​c2.accel =          #​acceleration of charge 2
 +    ​
 +   ​c1.vel =            #new velocity of charge 1
 +   ​c2.vel =            #new velocity of charge 2
 +   
 +   ​c1.pos =            #new position of charge 1
 +   ​c2.pos =            #new position of charge 2
 +  ​
 +   r12 =               #new distance between charge 1 and charge 2
 + 
 +   ​t=t+dt #increment time variable </​code>​
  
----- 
 ====Answer Key=== ====Answer Key===
 ===Handout=== ===Handout===
 +See highlighted code for notable changes to the program. The appropriate range of charge magnitudes should be in the nanocoulombs.
 +
 ===Code=== ===Code===
 +[[https://​www.glowscript.org/#/​user/​porcaro1/​folder/​RepositoryPrograms/​program/​ChargedBalloons-Solution | Link]]
 +<code Python [enable_line_numbers="​true",​ highlight_lines_extra="​36,​37,​43,​44,​46,​47,​49,​50,​52"​]>​
 +GlowScript 2.7 VPython
 +
 +#​get_library('​https://​rawgit.com/​perlatmsu/​physutil/​master/​js/​physutil.js'​)
 +
 +#Define some things
 +k=9e9 #​electrostatic constant
 +t = 0 #time counter
 +dt = 0.00005 #time increment
 +
 +x1 = -5 #x location for charge 1
 +y1 = 0 #y location for charge 1
 +z1 = 0 #z location for charge 1
 +m1 = 9e-31 #mass or charge 1
 +
 +x2 = 5 #x location for charge 1
 +y2 = 0 #y location for charge 1
 +z2 = 0 #z location for charge 1
 +m2 = 9e-31 #mass or charge 2
 +
 +c1 = sphere(pos=vec(x1,​y1,​z1),​ color = vec(1,0,0)) #create charged particle 1
 +c2 = sphere(pos=vec(x2,​y2,​z2),​ color = vec(0,1,0)) #create charged particle 2
 +
 +r12 = c1.pos-c2.pos #​distance ​ between charge 1 and charge 2
 +
 +c1.charge = 1.6e-19 #charge on charge 1 - note the sign of the charge
 +c1.vel = vec(0,0,0) #initial velocity of charge 1
 +c1.accel = vec(0,0,0) #initial acceleration of charge 1
 +
 +c2.charge = -1.6e-19 #charge on charge 2 - note the sign of the charge
 +c2.vel = vec(0,0,0) #initial velocity of charge 2
 +c2.accel = vec(0,0,0) #initial acceleration of charge 2
  
 +#loop to move charged objects
 +while mag(r12) >= 2:
 +   ​rate(1000)
 +   ​c1.eforcec2 = (k*c1.charge*c2.charge*r12)/​(mag(r12)**3) #​electrostatic force of charge 2 on charge 1
 +   ​c2.eforcec1 = -c1.eforcec2 #​electrostatic force of charge 1 on charge 2
 +  ​
 +    #add electrostatic force arrow to charges
 +   ​attach_arrow (c1, "​eforcec2",​ shaftwidth = .2, scale = 1e30, color = vector (1,0,0))
 +   ​attach_arrow (c2, "​eforcec1",​ shaftwidth = .2, scale = 1e30, color = vector (0,1,0))
 +   
 +   ​c1.accel = (c1.eforcec2/​m1) #​acceleration of charge 1
 +   ​c2.accel = (c2.eforcec1/​m2) #​acceleration of charge 2
 +    ​
 +   ​c1.vel = c1.accel*t #new velocity of charge 1
 +   ​c2.vel = c2.accel*t #new velocity of charge 2
 +   
 +   ​c1.pos = c1.pos+(c1.vel*t) #new position of charge 1
 +   ​c2.pos = c2.pos+(c2.vel*t) #new position of charge 2
 +  ​
 +   r12 = c1.pos - c2.pos #new distance between charge 1 and charge 2
 + 
 +   ​t=t+dt #increment time variable </​code>​
 ---- ----
 ====See Also==== ====See Also====
  • repository/charged_balloons.1584473811.txt.gz
  • Last modified: 2020/03/17 19:36
  • by porcaro1