Hello everybody, im trying to simulate electric and magnetic fields of high voltage transmission lines (im using DC for NOW!), when i put the equations for two cables, one at a distance "a" and another at "-a" at a height of "h", the equations are as follow:(adsbygoogle = window.adsbygoogle || []).push({});

Exx=Ke*((((X+a)./((X+a).^2+(Y-h).^2))-((X+a)./((X+a).^2+(Y+h).^2))) + (((X-a)./((X-a).^2+(Y-h).^2))-((X-a)./((X-a).^2+(Y+h).^2))));

Eyy=Ke*((((Y-h)./((X+a).^2+(Y-h).^2))-((Y+h)./((X+a).^2+(Y+h).^2))) + (((Y-h)./((X+a).^2+(Y-h).^2))-((Y+h)./((X+a).^2+(Y+h).^2))));

im having issues at the electric field (im good with the magnetic field one), of course im not considering "Q" right now. These are the components of the elctric field for two lines. Well the problem is that i ordered matlab to tell me when there are division by zero or log of zeros, well it appears on the two componentes, and i dont know HOW to evade it or eliminate the indetermination, cuz i had a similar problem with th magnetic fields but i solved it with "eps" but here i simply dont know how to manage the equations in matlab so it wont divide by zero, or log zero. Im really having issues here, can anyone help me??

PS: Im learning english, so i may have put some words wrong.

On the equations there are four tearms, two belong to one cable, and the other two to the other one, both positives.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MATLAB divide by zeros problem

**Physics Forums | Science Articles, Homework Help, Discussion**