• R/O
  • SSH

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

File Info

Révision 07ecc6cc5344d8d718d0fbfda3e83526854440d0
Taille 1,141 octets
l'heure 2008-02-26 02:42:18
Auteur iselllo
Message de Log

I added videcoq.py which calculates the DLVO potential used by Videcoq.

Content

#! /usr/bin/env python

import scipy as s
import numpy as n
import pylab as p




def videcoq_pot(A,B,d,k,r):
	V_vdw=s.zeros(len(r))
	V_el=s.zeros(len(r))
	
        #V[:]=s.where(r<=r_core,slope*r+intercept,V[:])
	V_vdw=-A*(d**2./(r**2.-d**2.)+(d/r)**2.+2*s.log((r**2.-d**2.)/r**2.))
	V_el=B*s.exp(-k*(r-d))

	V_tot=V_vdw+V_el

	return V_tot


#Now it is time to calculate some parameters:


d=500e-9 # particle diameter
A=4.76e-20/12.
print "A is, ", A


#
T=300. #temperature in kelvin

k_B=1.38e-23
z=1.
e=1.6e-19 #electron charge in Coulombs
epsi_0=8.85e-12 #vacuum permittivity
epsi_r=81.
psi=32e-3 #in Volts
k=3.35e8


B=s.pi*epsi_0*epsi_r*(4.*k_B*T/(z*e)*s.tanh(z*e*psi/(4.*k_B*T)))**2.
B=B*d

r=s.linspace(1.01,6.,1000)
r=r*d



potential=videcoq_pot(A,B,d,k,r)

p.plot(r/d,potential/(k_B*T),linewidth=2.)
p.ylim(min(potential/(k_B*T))-0.2,max(0.1,max(potential/(k_B*T))))
p.xlim(0.9,max(r/d))
p.xlabel('r')
p.ylabel('My Radial Potential')
#pylab.legend(('prey population','predator population'))
p.title('Radial Potential')
p.grid(True)
p.savefig('videcoq_dimensional_potential.pdf')
p.hold(False)
p.clf()


print "So far so good"