RSS
...LePaS Follow SaYe BacE iNi PuLa...
►Totorial : Tips Tingkatkan Follower
(Sebarkan Tips ini Tanda anda Prihatin)

Simple Fixed-Point using Scilab

Question:

A total charge Q is uniformly distributed around a ring-shape conductor with radius a. A charge q is located at a distance x from the center or the ring. The force exerted on the charge by the ring is given by

F=qQx/(4*pi*eo (x^2+a^2)^(3/2))

Where eo =8.85 x 10-12 C2/(Nm2). Write a computer program based on the method of simple fixed-point iteration to find the distance x where the force is 1N if q and Q are 2 x 10-5 C for a ring with a radius of 0.8m.

Answer:

Xi = 1;
pi=3.1416;
e=8.85*(10^-12);
q=2*(10^-5);
r=0.8;
t=4*pi*e;
err=1;
ii=0;


while(err>=0.000001)

X=(sqrt(Xi^2+0.64))^3*t/q^2;
err=abs(X-Xi);
Xi=X;
i=ii+1;
ii=i;

mprintf('|%5d | %10f | %10f |\n', (i)',[X], [err])

end
X


Figure: Scilab Output

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comments: