Perform the force generated by the Coulomb's repulsion.
[Cx,Cy]=NARVAL_G_CoulombForce(kh,qi,qj,i,j,nx,ny)
Coulomb coefficient.
charge of node i.
charge of node j.
starting node.
ending node.
current x-coordinates vector of nodes.
current y-coordinates vector of nodes.
x-coordinate of the Coulomb's repulsion.
y-coordinate of the Coulomb's repulsion.
NARVAL_G_CoulombForce performs the Coulomb's repulsion [Cx,Cy] between two nodes [i,j] of a graph. The position of all nodes is assumed to be stored in [nx,ny]. In respect with the Wikipedia definition, the Coulomb's law describes the electrostatic interaction between electrically charged particles.
n=3;//network size l0=5;//a maximum of 5 links are created for any created node L=1000;//network square area side kh=L*L;//Coulomb's coefficient [g,d]=NARVAL_T_BarabasiAlbert(n,l0,L);//generation of the topology nx=g.node_x;//original position ny=g.node_y; n=g.node_number; l=length(g.head); li=NARVAL_F_AleaNombre(l);//selection of a link [nd,nf]=NARVAL_G_Edge2Nodes(g,li); qd=1;//charge of node Nd qf=1;//charge of node Nf [Cx,Cy]=NARVAL_G_CoulombForce(kh,qd,qf,nd,nf,nx,ny);//application of NARVAL_G_CoulombForce Cx Cy | ![]() | ![]() |