# Magnetic field of cylinder with coils problem?

1. Dec 1, 2014

### asdf12312

1. The problem statement, all variables and given/known data

In the picture in the figure, three coils are tightly wrapped around a non-magnetic cylinder of diameter Dcyl. Each coil is defined through the diameter of each wire comprising the coil, dcoil1-dcoil3, the current going through each coil, I1-I3, and the number of turns in each coil, N1 – N3. In addition, each coil extends a length equal to a 1/3 the length of the cylinder. Write a program that defines the magnetic field in the centerline of the cylinder (on the z axis) and plots it against z (from –l to l, where l is the length of the cylinder). Note that the cylinder extends from –l/2 to l/2.

The user inputs values for Dcyl, dcoil1, dcoil2, dcoil3, N1, N2, N3, I1, I2, I3, and l.

The program outputs a graph of Bz vs z from –l to l for:
1. All coils identical – same current I, same diameter, same number of coils. This should give you an answer identical to the case of one coil with current I and number of coils equal to 3N. Confirm.

2. Each coil activated separately – so, I1=I while I2=I3=0, etc. If, in each case you use the same I and N to define each coil, how do you expect the results to compare with each other. Are your results reasonable?

3. Two combinations of I1, I2, and I3, including at least one where the currents are going in different directions.

2. Relevant equations

3. The attempt at a solution
can someone please help me i dont understand this!! I think the magnetic field of cylinder is something like B= u0*I / (2*pi*r) but I'm not sure!

2. Dec 1, 2014

### Bystander

I've highlighted the starting points for you.
Check your class notes or the textbook, or look for "magnetic field of a solenoid" and become sure.

Do not ever let a page long problem statement intimidate you. Just work your way through it one line at a time.

3. Dec 2, 2014

### asdf12312

I guess i'm confused because I don't understand how diameters matter in finding the B field. Also does the Bz = (u0*N*I)/L equation apply to whole cylinder or to each wire/coil too? For part 1) I get if all coils are identical, the B field through each is same so total B field is Bz=B1+B2+B3 or Bz= 3((u0*N*I)/(1/3)) = 9*u0*N*I. this is same answer I also get for case of only one coil with number of coils equal to 3N.

by the way, why do we need the diameters if they don't affect Bz at all?

4. Dec 2, 2014

### Bystander

Problem statements may be written for you to sort what is necessary from what is not; or to find missing information.

Yes.
Okay, you've "confirmed" part 1.