## 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

GlowScript 2.7 VPython #get_library('https://rawgit.com/perlatmsu/physutil/master/js/physutil.js') #Define some thingsk=9e9 #electrostatic constantt = 0 #time counterdt = 0.00005 #time increment x1 = -5 #x location for charge 1y1 = 0 #y location for charge 1z1 = 0 #z location for charge 1m1 = 9e-31 #mass or charge 1 x2 = 5 #x location for charge 1y2 = 0 #y location for charge 1z2 = 0 #z location for charge 1m2 = 9e-31 #mass or charge 2 c1 = sphere(pos=vec(x1,y1,z1), color = vec(1,0,0)) #create charged particle 1c2 = 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 chargec1.vel = vec(0,0,0) #initial velocity of charge 1c1.accel = vec(0,0,0) #initial acceleration of charge 1 c2.charge = -1.6e-19 #charge on charge 2 - note the sign of the chargec2.vel = vec(0,0,0) #initial velocity of charge 2c2.accel = vec(0,0,0) #initial acceleration of charge 2 #loop to move charged objectswhile 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

#### Handout

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

#### Code

GlowScript 2.7 VPython #get_library('https://rawgit.com/perlatmsu/physutil/master/js/physutil.js') #Define some thingsk=9e9 #electrostatic constantt = 0 #time counterdt = 0.00005 #time increment x1 = -5 #x location for charge 1y1 = 0 #y location for charge 1z1 = 0 #z location for charge 1m1 = 9e-31 #mass or charge 1 x2 = 5 #x location for charge 1y2 = 0 #y location for charge 1z2 = 0 #z location for charge 1m2 = 9e-31 #mass or charge 2 c1 = sphere(pos=vec(x1,y1,z1), color = vec(1,0,0)) #create charged particle 1c2 = 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 chargec1.vel = vec(0,0,0) #initial velocity of charge 1c1.accel = vec(0,0,0) #initial acceleration of charge 1 c2.charge = -1.6e-19 #charge on charge 2 - note the sign of the chargec2.vel = vec(0,0,0) #initial velocity of charge 2c2.accel = vec(0,0,0) #initial acceleration of charge 2 #loop to move charged objectswhile 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