Story of Flux and Ellipse

A particle with charge q = + 10 q=+10 is position at N ( x , y , z ) = ( 0 , 0 , 1 ) N(x,y,z)=(0,0,1) at that orange dot as shown in figure. Find the flux passing through the green surface as shown in figure. Equation of ellipse is 4 x 2 + 9 y 2 = 36 4x^{2}+9y^{2}=36 . Details and assumptions 1) Electric permittivity ϵ 0 = 1 \epsilon_{0}=1


The answer is 0.303.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Steven Chase
Mar 16, 2020

Nice problem. Solution code is attached.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
import math

#(x**2.0)/9.0 + (y**2.0)/4.0 = 1.0
#(x/a)**2.0 + (y/b)**2.0 = 1.0

N = 5000

a = 3.0
b = 2.0
R = 2.0

#####################################

q = 10.0

xq = 0.0
yq = 0.0
zq = 1.0

e0 = 1.0

#####################################

k = 1.0/(4.0*math.pi*e0)

phi = 0.0

#####################################
#####################################
#####################################
#####################################

# Flux through green surface in 1st quadrant
# Multiply by four due to symmetry

dx = a/N

nx = 0.0
ny = 0.0
nz = -1.0

x = 0.0
z = 0.0

while x <= a:

    #(x/a)**2.0 + (y/b)**2.0 = 1.0

    right = 1.0 - (x/a)**2.0
    yf = b*math.sqrt(right)

    dy = yf/N

    dS = dx*dy

    y = 0.0

    while y <= yf:

        rsq = x**2.0 + y**2.0

        Dx = x - xq
        Dy = y - yq
        Dz = z - zq

        D = math.sqrt(Dx**2.0 + Dy**2.0 + Dz**2.0)

        ux = Dx/D
        uy = Dy/D
        uz = Dz/D

        E = k*q/(D**2.0)

        Ex = E * ux
        Ey = E * uy
        Ez = E * uz

        dot = Ex*nx + Ey*ny + Ez*nz

        dphi = dot * dS

        if rsq > R**2.0:
            phi = phi + 4.0*dphi

        y = y + dy

    x = x + dx

################################################

print N
print ""

print phi

################################################


#1000

#0.303896016113
#>>> ================================ RESTART ================================
#>>> 
#2000

#0.303849491858
#>>> ================================ RESTART ================================
#>>> 
#5000

#0.3038216394
#>>> 

@Steven Chase Sir I want know that you type this whole code in computer It's code of 112 lines. ?? Every time you make new code from starting.???

A Former Brilliant Member - 1 year, 2 months ago

Log in to reply

All of these problems are similar. So I just modify the code from the previous problem each time.

Steven Chase - 1 year, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...