E Field Distribution Solution on Two Charge Model



Established studies for understanding to Electric Field  among maybe best important points on Applied Geophysics field can express...This application thus,explaining a solution on two-charge model;



import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import griddata
npts=200

xmin, xmax = 1, 10
ymin, ymax = 1, 10
x = np.array([1, 1, 1, 5.5, 5.5, 5.5, 10, 10, 10])
y = np.array([1, 5.5, 10, 1, 5.5, 10, 1, 5.5, 10])
#Voltage input
z = np.array([0.148, 0.238, 0.435, 0.238, 0.255,
              0.203, 0.234, 0.032, 0.053])


xi = np.linspace(xmin, xmax, npts)
yi = np.linspace(ymin, ymax, npts)
zi = griddata((x, y), z, (xi[None,:], yi[:,None]), method='cubic')



plt.contour(xi, yi, zi, 15, linewidths=0.5, colors='k')
plt.pcolormesh(xi, yi, zi, cmap=plt.get_cmap('rainbow'))
plt.colorbar()
plt.scatter(x, y, marker='o', c='b', s=5, zorder=10)
plt.show()
plt.contourf(xi,yi,zi,15,cmap=plt.cm.jet)

plt.show()

#Input of Mean Voltage and distance for two-charge condition
#where,effect force on other charge on q=1 condition is calculating
vort=0.25
r=10
f=vort/r
print(f)


#Next,F=k(q.aq)/(r^2) formulation that calculates a coefficint of other charge
import math
k=9*10e9
us=math.pow(r,2)
print(us)
a=(f*us)/k
print(a)#other charge as a.q on q=1 

#Total Two voltage calculations that effected on onepoint
#Point location that for example(6,6)
xa=6
ya=6

#x1,y1 coordinates of calcuated charge
x1=0.8
y1=10.2
#And,V1 voltage calculations
p1=math.pow((xa-x1),2)
p2=math.pow((ya-y1),2)
v1=a/(p1+p2)
print(v1)

#x2,y2 coordinates of q=1 charge
x2=11
y2=7.2
#And,V2 voltage calculations
p3=math.pow((xa-x2),2)
p4=math.pow((ya-y2),2)
v2=1/(p3+p4)
print(v2)

totalvtj=v1+v2
print(totalvtj)



 
from scipy.interpolate import Rbf   
import matplotlib.cm as cm
#Voltage Gradient Calculation on Vector Field with x,y coordinates
x = [0.8,6,11] 
y = [10.2,6,7.2] 
voltages=[v1,totalvtj,v2]

#Uniform area determination line
ti = np.linspace(0, 35.0, 35) 
XI, YI = np.meshgrid(ti, ti)   
#kriging function type(linear,multiquadric,inverse,gaussian,cubic,quintic,thin_plate)
rbf = Rbf(x, y, voltages, function='inverse') 
ZI = rbf(XI, YI)
# Conclusion Graph
plt.subplot(1, 1, 1) 
plt.pcolor(XI, YI, ZI,cmap=cm.RdBu_r) 
plt.scatter(x, y,1, voltages,cmap=cm.RdBu_r) 
plt.title('Voltage Gradient on Vector Field') 
plt.xlim(0, 35) 
plt.ylim(0, 35) 
plt.colorbar(orientation="vertical")
plt.show()

#E=-Grad(voltages) and next,plt.quiver(x,y,E) plotting
j=np.array(voltages, dtype=float)
opr=np.gradient(j)
Efield=-opr
print(Efield)

import pylab as plt
dx = np.linspace(0,35.0,35)
dy = np.linspace(0,35.0,35)

X,Y = np.meshgrid(dx,dy)
plt.quiver(X,Y,Efield,width=.01,headwidth=3,linewidth=1,cmap=cm.jet)
plt.colorbar()
plt.show()







Note:Program that suppying until four charge model as  a conclusion of tests on #Voltage Input.This condition that expected behaviour...



First output of program for two charge model.Where,some informations about charge coordinates and charge magnitudes are expressing(Note:Other chapters that explaining into Program);






Other Outputs  on My Computer of Program;







-----------------------------------------------------------------------------------------------------------
 

 
I wondered on two-charge model that evaluating to voltage conclusions via a print(voltage) process.
So,you will understand that Astronomic different between second&third values with first is subject.
If we unconsidering to different as this type,
 
verification for example via a open access software on web with [-,+,+] and coordinate information;
 
 
 
Where,you see distribution of two charge with reference...This type softwares that have to open-access via web.And,you thus,considered to quite small charge values that supplementary or complementary solutions for Applied Geophysics fields can establish.For example,thanks to
 
http://phet.colorado.edu/sims/charges-and-fields/charges-and-fields_en.html
 
 









Yorumlar

Bu blogdaki popüler yayınlar

Important Tectonic Components of Turkey Geography based on Anatolian Plate

Informations about experimental plate structures

Obspy-about Developments