Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
repository:charged_balloons [2020/03/24 02:34] porcaro1 [Activity] |
repository:charged_balloons [2021/03/24 23:40] (current) porcaro1 [Answer Key] |
||
|---|---|---|---|
| Line 29: | Line 29: | ||
| * Model two charged balloons hanging from strings, incorporating the effects of gravity | * 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"]> | <code Python [enable_line_numbers="true"]> | ||
| GlowScript 2.7 VPython | GlowScript 2.7 VPython | ||
| Line 88: | Line 89: | ||
| ====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=== | ||
| - | <code Python [enable_line_numbers="true", highlight_lines_extra=""]> | + | [[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 | GlowScript 2.7 VPython | ||
| Line 128: | Line 132: | ||
| c2.eforcec1 = -c1.eforcec2 #electrostatic force of charge 1 on charge 2 | c2.eforcec1 = -c1.eforcec2 #electrostatic force of charge 1 on charge 2 | ||
| | | ||
| - | | ||
| #add electrostatic force arrow to charges | #add electrostatic force arrow to charges | ||
| attach_arrow (c1, "eforcec2", shaftwidth = .2, scale = 1e30, color = vector (1,0,0)) | attach_arrow (c1, "eforcec2", shaftwidth = .2, scale = 1e30, color = vector (1,0,0)) | ||