# Defining the current vector in the biot savart law?

1. Jul 2, 2012

### arronslacey

I am trying to use the biot savart law to calculate the magnetic field of a given object. I have got to the stage where I have calculated I*dl and R/R^2 separately (doing this in matlab. The problem is where I come to the cross product. If I have a uniform current, the values of the current vector would be zero where there is no cable. i.e. if I have a current loop of uniform current = 1, anywhere outside or inside the current loop, the value of I*dl = 0 right? So if this is correct, when I take the cross product of I*dl and R/R^2, I will be crossing a vector of value 0, with the R/R^2 in places outisde of the loop, which leads to a value of 0. Although, the magnetic field due to the current is only 0 is the distance goes to infinity, so I cannot have a space in the vicinity of the wire with magnetic field = 0. What am I not understanding here?

2. Jul 2, 2012

### tiny-tim

hi arronslacey!

the biot-savart law is B = (µo/4π) ∫ (I dl x r^)/r2

it gives the magnetic field induced by a current I flowing along a wire with line lement dl

you only use it along the wire!

3. Jul 2, 2012

### arronslacey

HI Tim, thanks for you reply. I see that you only use the current on the actual wire. I'll try to explain a bit further. I am doing this in matlab, so each variable in the equation is in the form of a matrix. I have a picture of a circle which I am trying to super impose a magnetic field on. So the variables might look like:

I = 0 0 0 0 0 0
0 0 1 1 0 0
0 1 0 0 1 0
0 0 1 1 0 0
0 0 0 0 0 0

dL = 0 0 0 0 0 0
0 0 -0.05 0.05 0 0
0 -0.05 0 0 0.05 0
0 0 -0.05 0.05 0 0
0 0 0 0 0 0

where I need to cross dL with R = Rs/Rxs.^2. Doing a cross product will take element (1,1) of dL and cross it with element R(1,1), which would give me 0. This should not be the case! so either my logic is wrong here, or I am using the wrong variables in the cross product.

4. Jul 2, 2012

### tiny-tim

(isn't I just a number? )

r is the position vector from the element dl to the fixed point that you're measuring B at