Dec-02-2017, 07:31 PM
(This post was last modified: Dec-02-2017, 11:42 PM by sparkz_alot.)
Here is the stated problem:
A circular loop of radius one unit is carrying 1 unit of current. The center of the loop is at
(0,0,0) and it is flat in X–Y plane. Compute magnetic field on domain (−2, −2, −2) to (2, 2, 2)
using Biot–Savert law. Plot your results as vector field.
Currently I'm trying to define a 3 dimensional vector that will be used for calculating this problem.
This will probably look quite ugly(and wrong) but this is where I need help. I need this vector to encompass all points from (−2, −2, −2) to (2, 2, 2).
def radial_vector(x, y, z):
i=-2
while i <= 2:
x = i
x[i] = x
return x
j=-2 #errors for sure defining the radial_vector
while j <= 2:
y[j] = j
y[j] = y
return y
k=-2
while k <= 2:
z[k] = k
z[k] = z
return z
V=vec(3)
V[0]=x
V[1]=y
V[2]=z
radial_vector = V
return radial_vector
print radial_vector[/i]
A circular loop of radius one unit is carrying 1 unit of current. The center of the loop is at
(0,0,0) and it is flat in X–Y plane. Compute magnetic field on domain (−2, −2, −2) to (2, 2, 2)
using Biot–Savert law. Plot your results as vector field.
Currently I'm trying to define a 3 dimensional vector that will be used for calculating this problem.
This will probably look quite ugly(and wrong) but this is where I need help. I need this vector to encompass all points from (−2, −2, −2) to (2, 2, 2).
def radial_vector(x, y, z):
i=-2
while i <= 2:
x = i
x[i] = x
return x
j=-2 #errors for sure defining the radial_vector
while j <= 2:
y[j] = j
y[j] = y
return y
k=-2
while k <= 2:
z[k] = k
z[k] = z
return z
V=vec(3)
V[0]=x
V[1]=y
V[2]=z
radial_vector = V
return radial_vector
print radial_vector[/i]