<< NL_G_Coreness NL_G: Graph NL_G_DeleteEdges >>

NARVAL >> NL_G: Graph > NL_G_CoulombForce

NL_G_CoulombForce

Perform the force generated by the Coulomb's repulsion between two nodes.

Calling Sequence

[Cx,Cy] = NL_G_CoulombForce(K,Qi,Qj,I,J,Nx,Ny)

Arguments

K :

Coulomb coefficient.

:

Charge of node I.

:

Charge of node J.

I :

Starting node.

J :

Ending node.

:

X-coordinates vector.

:

Y-coordinates vector.

:

X-coordinate of the Coulomb's repulsion.

:

Y-coordinate of the Coulomb's repulsion.

Description

NL_G_CoulombForce performs the Coulomb's repulsion between the two nodes I and J of the graph G where the position of all nodes is assumed to be stored in . The Coulomb's law describes the electrostatic interaction between electrically charged particles (WIKIPEDIA).

Examples

n=3;//network size
l0=5;//a maximum of 5 links are created for each new node
L=1000;//network square area side 
kh=L*L;//Coulomb's coefficient
[g,d]=NL_T_BarabasiAlbert(n,l0,L);//generation of the topology
nx=g.node_x;//original position
ny=g.node_y;
n=g.node_number;//network size
l=length(g.head);//quantity of links
li=NL_F_RandInt1n(l);//selection of a link
[nd,nf]=NL_G_Edge2Nodes(g,li);
qd=1;//charge of node Nd
qf=1;//charge of node Nf
[Cx,Cy]=NL_G_CoulombForce(kh,qd,qf,nd,nf,nx,ny)//application of NL_G_CoulombForce

Dependency

NL_F_DistanceNiNj

Report an issue
<< NL_G_Coreness NL_G: Graph NL_G_DeleteEdges >>