===== Project: Better Thundercloud Model =====
==== Kick Off Questions ====
- Going back over your integral set up from last time, what were the steps that you took to set up the integral?
- How would those steps need to change if you were to use code to set up the integral? What steps would stay the same?
- Read over the main problem & given code. Draw out a prediction of what you want the code to give you in the end.
==== Main Problem ====
{{ 184_projects:project4b.png?300}}
The storms over Lakeview have gotten worse, with an almost permanent pitch black cloud system hovering overhead. The S.P.A.R.T.A.N. scientists at Stormchaser HQ have been taking data with the Super-Mega-Storm-Cloud-Meter 9000TM to try to understand what's happening. While they appreciated the model of the cloud's electric field you created for them two weeks ago, the data they're collecting simply don't match the model's predictions. They've concluded that modeling storm clouds as point charges was, in fact, problematic, and a better model for the thundercloud needs to be produced to understand how it is functioning.
Based on some research from the [[184_notes:lightning|National Weather Service]], they think that a better model for clouds would be two flat sheets of charge, since the negative charges in the cloud collect on the bottom of the cloud and the positive charges collect near the top. Given that the negative charge is much closer to the ground (and headquarters), the Lakeviewians want to prioritize what the Super-Mega-Storm-Cloud-Meter 9000TM will show based on the bottom of the cloud. (If you have time, though, they'd be interested in whether the top of the cloud has any effect.) They have shared their model of the bottom of the most recent storm cloud (which is thankfully fully functioning, well-commented code), but they are having trouble getting the electric field on the ground. The Lakeviewians have asked your team for your help completing the code and calculating the E field for a broad range of different points on the ground around HQ.
#Set up of the objects
ground = box(pos = vec(0,0,0), width=5000, length=5000, height=0.1, color=color.green)
mountains = [cone(pos=vec(-1800,0,0), axis=vec(0,1000,0), radius=700, color=vec(1,0.7,0.2)),
cone(pos=vec(-1800,0,-1600), axis=vec(0,1000,0), radius=700, color=vec(1,0.7,0.2)),
cone(pos=vec(-1800,0,1600), axis=vec(0,1000,0), radius=700, color=vec(1,0.7,0.2))]
HQ = box(pos = vec(-100,100,0), width = 15, length = 15, height= 200, color = color.blue)
cloud = box(pos = vector(0,1000,0), size = vector(500, 1, 500), color = color.white)
#Lines 13-48 create a grid of spheres to represent the bottom of the cloud (this part of the code doesn't need be modified):
#Define how many chunks to split the cloud in the x direction (define x size of the cloud grid)
nx = 10
#Define how many chunks to split the cloud in the z direction (define z size of the cloud grid)
nz = 10
#Define where the cloud should start/stop in the x direction
startx = -250
endx = 250
#Define the spacing between each chunk in the x, based on where the cloud start/stops and how many chunks there are
stepx = (endx - startx)/nx
#Define where the cloud should start/stop in the z direction
startz = -250
endz = 250
#Define the spacing between each chunk in the z, based on where the cloud start/stops and how many chunks there are
stepz = (endz - startz)/nz
#Create an empty list to store each cloud chunk
listOfCloudChunks = []
#For each cloud chunk in the x-direction
for i in range(0,nx):
#Define the x-location of the cloud chunk
xloc = startx + i*stepx
#For each cloud chunk in the z-direction
for j in range(0,nz):
#Define the z-location of the cloud chunk
zloc = startz + j*stepz
#Make a sphere at that x-z location
cloudChunk = sphere(pos = vector(xloc,1000,zloc), radius = 50, color = color.red)
#Add the sphere to the list of cloud chunks (so we can use it later)
listOfCloudChunks.append(cloudChunk)
#This part needs to be fixed and commented...
obsLocation = vector(0,0,0)
Enet = vector(0,0,0)
Q = -15
dQ = Q/(nx*nz)
k = 9e9
for chunk in listOfCloudChunks:
Enet = vector(0,0,0)
=== Learning Goals ===
* Visualize the electric field from a 2D plane of charge
* Use multiple loops to create many observation points from many charges
* Identify patterns in the electric fields between 1D, 2D, and 3D charge distributions
* Compare/contrast process for a 2D charge distribution with a 1D charge distribution
==== Wrap Up Questions ====
- Which loops in the code control your observation points? Which loops in the code control the source charges?
- Which line of code uses superposition to get the electric field?
- If you haven't already, comment your code line-by-line and make sure you know what each line of the code is doing.
- At this point, we've dealt with point charges, lines of charges, and now 2D planes of charge. Draw what the electric field would look like for each of these types of distributions.
- In your model, where is the electric field the biggest? Where is it most likely to have lightning strike?
- In your model, you likely ignored any sort of charges in the ground - but let's think about that. What would happen to the charges in the ground right under the cloud? Why? What impact would that have on your electric field and where you would expect lightning to strike?