magnetic fields from currents...

13
Magnetic Fields from Currents Introduction In the last section we started our study of magnetism by showing how certain materials, referred to as ferromagnetic, exert magnetic forces on other ferromagnetic material. We also introduced the concept of a magnetic field which we used to study these forces. More importantly, we mentioned that fact that there exists an intimate relationship between electricity and magnetism. We began our study of this relationship by showing that when a charged particle moves through a magnetic field a magnetic force acts on this particle governed by the following relationship. = Furthermore, as an electric current is no more than an assemblage of moving charged particles, (electrons), we went on to define the magnetic force acting on a current carrying wire placed in a magnetic field as follows: = Although these two observations hint at the intimate relationship between electricity and magnetism, recall that in both cases the magnetic field was assumed to be generated from some type of ferromagnetic material. Even more exciting was the discovery, by Hans Christian Oersted, that magnetic fields are also produced by electric currents. Let’s begin with Oersted’s observation that led him to this amazing discovery. In 1820 Oersted noticed that a compass needle is deflected when placed near a current carrying wire. We could investigate this phenomenon by surrounding a straight current carrying wire with compasses. As shown below, we would find that the needle aligns itself so that it is tangent to a circle drawn around the wire. From this observation we can deduce the direction of the magnetic field. It should come as no surprise that the direction can again be found by using a right-hand rule. In this case, placing the palm of your right hand on the wire with your thumb pointing in the direction of the current, when you close your hand your fingers sweep in the direction of the magnetic field.

Upload: others

Post on 08-Mar-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Magnetic Fields from Currents Introductionferrantetutoring.com/wp-content/uploads/2019/01/Physics2... · 2019. 1. 12. · Biot-Savart Law The fundamental relationship, which was developed

Magnetic Fields from Currents Introduction

In the last section we started our study of magnetism by showing how certain materials,

referred to as ferromagnetic, exert magnetic forces on other ferromagnetic material. We also

introduced the concept of a magnetic field which we used to study these forces. More

importantly, we mentioned that fact that there exists an intimate relationship between

electricity and magnetism. We began our study of this relationship by showing that when a

charged particle moves through a magnetic field a magnetic force acts on this particle governed

by the following relationship.

𝑭𝐵 = 𝑞𝒗 𝑥 𝑩

Furthermore, as an electric current is no more than an assemblage of moving charged particles,

(electrons), we went on to define the magnetic force acting on a current carrying wire placed in

a magnetic field as follows:

𝑭𝐵 = 𝑖𝑳 𝑥 𝑩

Although these two observations hint at the intimate relationship between electricity and

magnetism, recall that in both cases the magnetic field was assumed to be generated from

some type of ferromagnetic material. Even more exciting was the discovery, by Hans Christian

Oersted, that magnetic fields are also produced by electric currents. Let’s begin with Oersted’s

observation that led him to this amazing discovery.

In 1820 Oersted noticed that a compass needle is deflected when placed near a current carrying

wire. We could investigate this phenomenon by surrounding a straight current carrying wire

with compasses. As shown below, we would find that the needle aligns itself so that it is

tangent to a circle drawn around the wire. From this observation we can deduce the direction

of the magnetic field. It should come as no surprise that the direction can again be found by

using a right-hand rule. In this case, placing the palm of your right hand on the wire with your

thumb pointing in the direction of the current, when you close your hand your fingers sweep in

the direction of the magnetic field.

𝐼

Page 2: Magnetic Fields from Currents Introductionferrantetutoring.com/wp-content/uploads/2019/01/Physics2... · 2019. 1. 12. · Biot-Savart Law The fundamental relationship, which was developed

Further experiments would also reveal that the magnitude of the magnetic field is directly

proportional to the current and inversely proportional to the distance from the wire. After

developing a proper proportionality constant, the relationship can be written as follows:

𝐵 = 𝜇02𝜋∙𝐼

𝑟

Where, 𝐼 is the current measured in amps, 𝑟 is the distance from the wire measured in meters,

and 𝜇0 is called the permeability of free space and is equal to 4𝜋 𝐸−7 𝑇 ∙ 𝑚/𝐴.

As useful as this equation may be, it is valid for straight lengths of wire only, and therefore a

more general relationship is desired. A more general equation was indeed developed and is

known as the Biot-Savart Law. However, before introducing this law, let’s first combine what

we already know about magnetic forces on current carrying wires with the above discovery that

the wire itself generates a magnetic field to find the force between two parallel wires.

Magnetic Forces on Wires

The figure below shows two parallel current carrying wires. Since, as we now know, each wire

generates its own magnetic field, each wire will in effect apply a magnetic force on the other

wire. Note, when the currents are in the same direction the force is attractive, whereas when

the current is in opposite directions the force is repulsive.

𝐼1 𝐼2 𝐵1 𝐵2

𝐵2

𝐵1 𝐼1 𝐼2 𝐹𝐵12 𝐹𝐵21

𝐼1 𝐼2 𝐵1 𝐵2

𝐵2

𝐵1 𝐼1

𝐼2

𝐹𝐵12

𝐹𝐵21

In both cases the magnitude of the force can be found as shown below. Furthermore, note that

𝐹𝐵12 = 𝐹𝐵21, which we should of course expect to be true from Newtons third law.

𝐹𝐵12 = 𝐼1𝐿 𝐵2

𝐹𝐵12 = 𝐼1𝐿 ∙𝜇02𝜋∙𝐼2𝑑

𝐹𝐵12 =𝜇02𝜋∙𝐼1𝐼2𝐿

𝑑

𝐹𝐵21 = 𝐼2𝐿 𝐵1

𝐹𝐵21 = 𝐼2𝐿 ∙𝜇02𝜋∙𝐼1𝑑

𝐹𝐵21 =𝜇02𝜋∙𝐼1𝐼2𝐿

𝑑

Page 3: Magnetic Fields from Currents Introductionferrantetutoring.com/wp-content/uploads/2019/01/Physics2... · 2019. 1. 12. · Biot-Savart Law The fundamental relationship, which was developed

Biot-Savart Law

The fundamental relationship, which was developed by Jean-Baptiste Biot and Felix Savart, that

relates the current in a wire to the magnetic field produced is called the Biot-Savart Law. Using

the figure below, we wish to find the magnetic field at a point, 𝑃, due to the current, 𝐼, flowing

in the wire. The Biot-Savart Law is used to find the magnetic field contribution, 𝒅𝑩, due to an

infinitesimal element of the wire, 𝑑𝑙, and is written as below.

𝒅𝑩 = 𝜇04𝜋∙𝐼

𝑟2∙ 𝒅𝒍 𝒙 �̂�

Where, 𝐼 is the current in the wire, 𝒅𝒍 is a vector that points in the direction of the current, 𝒓 is

the displacement vector from 𝑑𝑙 to 𝑃, and �̂� =𝒓

𝑟 is the unit vector in the direction of 𝒓.

𝑑𝑙

𝒅𝒍

𝐼

�̂�

𝒅𝑩 x

𝒓

𝜽

𝑃

Since �̂� is a unit vector we can write the magnitude of the cross product as follows:

|𝒅𝒍 𝒙 �̂�| = 𝑑𝑙 sin(𝜃)

With direction again given by the right-hand rule.

Therefore, the magnitude of 𝒅𝑩 is

𝑑𝐵 = 𝜇04𝜋∙𝐼 sin(𝜃)

𝑟2𝑑𝑙

Naturally, the magnetic field at point 𝑃 is found by integrating over the length of the wire.

𝐵 = ∫𝜇04𝜋∙𝐼 sin(𝜃)

𝑟2𝑑𝑙

Page 4: Magnetic Fields from Currents Introductionferrantetutoring.com/wp-content/uploads/2019/01/Physics2... · 2019. 1. 12. · Biot-Savart Law The fundamental relationship, which was developed

To illustrate let’s use this integral to find the magnetic field from a straight wire and see if we

get the same result we stated earlier. Using the figure below we wish to find the magnetic field

at the point 𝑃.

Assuming the wire is in the plane of the page, we know that the direction of the field is into the

page as shown. To determine the magnitude, we can directly use the Biot-Savart integral from

above with 𝑦 varying from −∞ to ∞. However, using symmetry we can integrate instead from

0 to ∞ and multiple the results by 2.

𝐵 = 2 (𝜇0𝐼

4𝜋∫

sin(𝜃)

𝑟2𝑑𝑦

0

)

To solve this integral we can first attempt to write the integrand in terms of the integration

variable, 𝑦. The 𝑟2 can be replaced using Pythagorean theorem as follows:

𝑟2 = 𝑅2 + 𝑦2

And since 𝜃 = 𝜑 + 90 we can replace sin(𝜃) as follows:

sin(𝜃) = sin(𝜑 + 90 ) = cos(𝜑) = 𝑅

𝑟=

𝑅

√𝑅2 + 𝑦2

Re-writing the integral with the above substitutions we have:

𝐵 = 𝜇0𝐼

2𝜋∫

𝑅

√𝑅2 + 𝑦2∙

1

(𝑅2 + 𝑦2) 𝑑𝑦

0

𝐵 = 𝜇0𝐼𝑅

2𝜋∫

1

(𝑅2 + 𝑦2)3 2⁄ 𝑑𝑦

0

This integral can be solved using an advanced technique called trig substitution, however a

table of integrals can also be used to save time. The solution is given below.

𝐵 = 𝜇0𝐼𝑅

2𝜋[

𝑦

𝑅2(𝑅2 + 𝑦2)1 2⁄]0

= 𝜇0𝐼

2𝜋𝑅

Page 5: Magnetic Fields from Currents Introductionferrantetutoring.com/wp-content/uploads/2019/01/Physics2... · 2019. 1. 12. · Biot-Savart Law The fundamental relationship, which was developed

Where we used the following from a table of integrals:

∫1

(𝑎2 + 𝑥2)3 2⁄ 𝑑𝑥 =

𝑥

𝑎2(𝑎2 + 𝑥2)1 2⁄

And the following to evaluate 𝑦 = ∞.

lim𝑦→∞

(𝑦

(𝑅2 + 𝑦2)1 2⁄) = lim

𝑦→∞

(

𝑦𝑦⁄

(𝑅2

𝑦2⁄ +𝑦2

𝑦2⁄ )1 2⁄

)

= lim𝑦→∞

(1

(𝑅2

𝑦2⁄ + 1)1 2⁄)

= lim𝑦→∞

(1

(0 + 1)1 2⁄) = 1

The good news is the solution is indeed identical to the one we initially stated above, however

you may have noticed it took quite a bit of work to obtain.

Let’s now step back and recall how we first computed the electric field at a point in space from

a continuous charge distribution. Not surprisingly the equation for the electric field

contribution, 𝒅𝑬, due to an infinitesimal charge element, 𝑑𝑞, is very much like the equation for

the magnetic field contribution, 𝒅𝑩, due to an infinitesimal element of the wire, 𝑑𝑙. Both are

written below.

Coulomb’s Law for the Electric Field Biot-Savart Law for the Magnetic Field

𝒅𝑬 = 𝑘

𝑟2𝑑𝑞 �̂�

𝒅𝑩 = 𝜇04𝜋∙𝐼

𝑟2∙ 𝒅𝒍 𝒙 �̂�

Just as we have seen above for the Biot-Savart law, you may recall computing the electric field

using Coulomb’s law was also not always trivial. Fortunately, we also learned that in cases

where the charge distribution has some form of symmetry Gauss’s Law can be used with

considerably less effort. Is there a similar fundamental law for magnetism that can be used in

place of the Biot-Savart Law? The answer is yes, and the law is called Ampere’s Law. To

highlight the similarities, we state both laws below.

Page 6: Magnetic Fields from Currents Introductionferrantetutoring.com/wp-content/uploads/2019/01/Physics2... · 2019. 1. 12. · Biot-Savart Law The fundamental relationship, which was developed

Gauss’s Law for the Electric Field

The distribution of the electric field, (electric flux), through a closed surface is equal to the total net charge enclosed in that surface divided by a constant.

∮𝑬 ∙ 𝑫𝑨 =𝑄𝑒𝑛𝑐𝜀0

Ampere’s Law for the Magnetic Field

The line integral of the magnetic field around a closed curve, (Amperian loop), is equal to the total net current enclosed by the curve multiplied by a constant.

∮𝑩 ∙ 𝒅𝒍 = 𝜇0𝐼𝑒𝑛𝑐

To show the usefulness of Ampere’s law lets once again find the magnetic field from a straight

wire; this time using Ampere’s Law. Based on the Oersted’s experiments mentioned earlier, we

can use the right-hand rule to recognize the direction of the magnetic field shown in the figure

below. We also know that the magnitude of the magnetic field has the same value at all points

that are the same distance, 𝑟, from the wire. In other words, the 𝑩 field has cylindrical

symmetry, and based on this symmetry we will use a circle of radius 𝑟 as our Amperian loop to

simplify the integral on the left-hand side of Ampere’s law.

𝐼

𝑇𝑜𝑝 𝑉𝑖𝑒𝑤

𝑩

𝒅𝒍

𝑩 𝒅𝒍

𝑟

𝐼

𝑩

Ampere’s law is stated as follows:

∮𝑩 ∙ 𝒅𝒍 = 𝜇0𝐼𝑒𝑛𝑐

And since 𝑩 is parallel to 𝒅𝒍 at all points on the circle we can remove the dot product.

𝐵∮ 𝑑𝑙2𝜋𝑟

0

= 𝜇0𝐼

𝐵2𝜋𝑟 = 𝜇0𝐼

𝐵 = 𝜇0𝐼

2𝜋𝑟

Note this is the same answer we computed using the Biot-Savart Law, but with much less

effort!

Page 7: Magnetic Fields from Currents Introductionferrantetutoring.com/wp-content/uploads/2019/01/Physics2... · 2019. 1. 12. · Biot-Savart Law The fundamental relationship, which was developed

Another interesting example where Ampere’s Law can greatly simplify the computation of the

magnetic field is that of a coaxial cable. A coaxial cable consists of a single wire carrying a

current surrounded by an insulator, and then another thin cylindrical conducting material that

carries the same current in the opposite direction. Let’s use Ampere’s law to find the magnetic

field inside the center conductor, in the space between the conductors, and outside the cable.

The top figure below shows a front view of a coaxial cable carrying a current, I, directed into the

page for the center conductor with the same current directed out of the page for the outside

conductor. The magnetic field again displays cylindrical symmetry, so we use circles as our

Amperian loops. The bottom figures show the Amperian loop used for each region.

𝑟1

𝑟2

𝐶𝑜𝑎𝑥 𝐶𝑎𝑏𝑙𝑒 𝐹𝑟𝑜𝑛𝑡 𝑉𝑖𝑒𝑤

𝑟 < 𝑟1 𝑟1 < 𝑟 < 𝑟2 𝑟 > 𝑟2

𝐴𝑚𝑝𝑒𝑟𝑖𝑎𝑛 𝐿𝑜𝑜𝑝

𝐼

𝐼

x

Region 1: 𝒓 < 𝒓𝟏

Ampere’s law works out the same as it did for the straight wire above except the enclosed

current is radius dependent.

∮𝑩 ∙ 𝒅𝒍 = 𝜇0𝐼𝑒𝑛𝑐

∮𝐵𝑑𝑙 = 𝜇0𝐼𝑒𝑛𝑐

𝐵 = 𝜇0𝐼𝑒𝑛𝑐2𝜋𝑟

To find the enclosed current we assume the current is evenly distributed so that we can solve

for the enclosed current by comparing ratios as shown below.

𝐼𝑒𝑛𝑐𝐼= 𝜋𝑟2

𝜋𝑟12

𝐼𝑒𝑛𝑐 = 𝐼𝑟2

𝑟12

Page 8: Magnetic Fields from Currents Introductionferrantetutoring.com/wp-content/uploads/2019/01/Physics2... · 2019. 1. 12. · Biot-Savart Law The fundamental relationship, which was developed

Substituting we find that the magnetic field varies linearly with distance inside the conductor.

𝐵 = 𝜇02𝜋𝑟

𝐼𝑟2

𝑟12

𝐵 = 𝜇0𝐼

2𝜋𝑟12𝑟

Region 2: 𝒓𝟏 < 𝒓 < 𝒓𝟐

This case is identical to the straight wire example we did above. Note the current outside the

loop does not play a role in the computation of Ampere’s law.

𝐵 = 𝜇0𝐼

2𝜋𝑟

Region 3: 𝒓 > 𝒓𝟐

In this case the magnetic field is zero since the current enclosed in the Amperian loop is zero.

∮𝐵𝑑𝑙 = 𝜇0𝐼𝑒𝑛𝑐

𝐵2𝜋𝑟 = 𝜇0(𝐼 − 𝐼) 𝐵 = 0

Note there are no stray magnetic fields outside a coaxial cable, which makes them ideal for

carrying signals near other sensitive equipment. The figure below illustrates the behavior of the

magnitude of the magnetic field for all regions.

𝝁𝟎𝑰

𝟐𝝅𝒓𝟏

𝒓𝟏 𝒓𝟐

𝝁𝟎𝑰

𝟐𝝅𝒓𝟐

𝑩(𝒓)

𝒓

𝝁𝟎𝑰

𝟐𝝅𝒓𝟏𝟐

𝑩 ∝𝟏

𝒓

𝑩 ∝ 𝒓

Page 9: Magnetic Fields from Currents Introductionferrantetutoring.com/wp-content/uploads/2019/01/Physics2... · 2019. 1. 12. · Biot-Savart Law The fundamental relationship, which was developed

Solenoids and Toroid

An electromagnet is a type of magnet in which the magnetic field is produced from an electric

current. Electromagnets are very widely used in devices such as motors, loudspeakers, hard

drives, MRI machines, and even in certain industries to pick up and move heavy iron objects. A

solenoid is one type of electromagnet. A solenoid consists of a long wire that is wound in the

shape of a helix and made to carry a current as illustrated below.

To determine the magnetic field due to the solenoid let’s look first at a single loop of wire

shown in the figure below. Focusing on the top and bottom of the loop where the current

arrows are drawn, we can determine the direction of the field. Place the thumb of your right

hand where the current is shown and close your hand. The field curls in the direction your

hand closes, making circles as shown in the figure. Continuing these ever-larger circles we

notice that the magnetic field lines become almost straight aligning in one direction near the

center of the loop. Alternatively, there is another sort of right-hand rule that can more easily

be used to determine the direction of the magnetic field through the current loop. If you place

the palm of your right hand on the outside of the loop so that when your close your palm your

fingers curl in the direction of the current, your thumb will point in the direction of the

magnetic field.

Page 10: Magnetic Fields from Currents Introductionferrantetutoring.com/wp-content/uploads/2019/01/Physics2... · 2019. 1. 12. · Biot-Savart Law The fundamental relationship, which was developed

Placing these circular current loops side by side, as in a solenoid, will serve to increase the

strength of the magnetic field through the solenoid, as shown below.

Let’s now use Ampere’s law to determine the magnetic field inside a solenoid. The figure below

is a cut-view of the solenoid where the current is directed out of the paper at the top and into

the paper at the bottom.

We choose our closed path to be the rectangle with sides 𝑎𝑏, 𝑏𝑐, 𝑐𝑑 and 𝑑𝑎 as shown in the

figure. Therefore, the integral in Ampere’s law can be split into four separate integrals, one for

each side of the rectangle.

∮𝑩 ∙ 𝒅𝒍 = ∫ 𝑩 ∙ 𝒅𝒍𝑏

𝑎

+∫ 𝑩 ∙ 𝒅𝒍𝑐

𝑏

+ ∫ 𝑩 ∙ 𝒅𝒍𝑑

𝑐

+ ∫ 𝑩 ∙ 𝒅𝒍𝑒

𝑑

For the two vertical segments, 𝑏𝑐 and 𝑑𝑎, the vector 𝒅𝒍 is perpendicular to 𝑩, therefore those

terms will be zero. For the two segments, 𝑎𝑏 and 𝑐𝑑, we can see that 𝒅𝒍 and 𝑩 are anti-parallel

and parallel respectively, therefore the above simplifies as shown below.

∮𝑩 ∙ 𝒅𝒍 = ∫ −𝐵𝑂𝑑𝑙𝑏

𝑎

+0 + ∫ 𝐵𝐼𝑑𝑙𝑑

𝑐

+ 0

∮𝑩 ∙ 𝒅𝒍 = − 𝐵𝑂𝐿 + 𝐵𝐼𝐿

∮𝑩 ∙ 𝒅𝒍 = 𝐿(𝐵𝐼 − 𝐵𝑂)

Page 11: Magnetic Fields from Currents Introductionferrantetutoring.com/wp-content/uploads/2019/01/Physics2... · 2019. 1. 12. · Biot-Savart Law The fundamental relationship, which was developed

Where, 𝐵𝐼 is the magnetic field inside the solenoid and 𝐵𝑂 is the magnetic field outside the

solenoid.

The field outside a solenoid is very small compared to the field inside, except near the ends. If

we consider an infinitely long solenoid we can let 𝐵𝑂 = 0 and 𝐵𝐼 = 𝐵, therefore

∮𝑩 ∙ 𝒅𝒍 = 𝐵𝐿

and Ampere’s Law becomes

𝐵𝐿 = 𝜇0𝐼𝑒𝑛𝑐

To find 𝐼𝑒𝑛𝑐 we can consider there are 𝑁 loops of wire enclosed in our Amperian loop so that

𝐼𝑒𝑛𝑐 = 𝑁𝐼. Furthermore, if we let 𝑛 = 𝑁/𝐿 be the number of loops per unit length we can

write the magnitude of the magnetic field inside a solenoid as follows.

𝐵 = 𝜇0𝑛𝐼

Which shows that the magnetic field is constant inside an infinitely long solenoid, and the

magnitude is directly proportional to the current, 𝐼, and the number of loops per unit length, 𝑛.

Finally, a toroid is essentially a solenoid which is bent into a shape of a circle. To determine the

magnetic field inside a toroid we would create an Amperian loop in the shape of a circle that

follows the magnetic field lines, as shown below. However, as an alternative we can use the

results of the solenoid from above. The magnetic field of the solenoid can be written as

follows:

𝐵 = 𝜇0𝑁

𝐿𝐼

For the toroid we have 𝐿 = 2𝜋𝑟, therefore the magnitude of the magnetic field for a toroid,

which is not constant as it is in the solenoid, is given as:

𝐵 = 𝜇0𝑁

2𝜋𝑟𝐼

Page 12: Magnetic Fields from Currents Introductionferrantetutoring.com/wp-content/uploads/2019/01/Physics2... · 2019. 1. 12. · Biot-Savart Law The fundamental relationship, which was developed

Final Summary for Magnetic Fields from Currents Introduction

Magnetic Field from a Straight Current Carrying Wire

• A straight current carrying wire generates a magnetic field which curls around the wire in the concentric circles with a direction given by the right-hand rule using your thumb pointing in the direction of the current.

• The magnitude of the magnetic field is inversely proportional to the distance from the wire center.

𝐵 = 𝜇02𝜋∙𝐼

𝑟

Magnetic Force Between Two Parallel Current Carrying Wires

• A magnetic field exists between two parallel current carrying wires. o If the currents are flowing in the same direction the force is attractive. o If the currents are flowing in opposite directions the force is repulsive.

The magnitude of the force is given as below.

𝐹𝐵 =𝜇02𝜋∙𝐼1𝐼2𝐿

𝑑

Page 13: Magnetic Fields from Currents Introductionferrantetutoring.com/wp-content/uploads/2019/01/Physics2... · 2019. 1. 12. · Biot-Savart Law The fundamental relationship, which was developed

Biot-Savart Law

The magnetic field established by a current carrying conductor can be found using the Biot-Savart Law. The law relates a current carrying element, 𝒅𝒍, to its contribution to the magnetic field, 𝒅𝑩, at a point P, which is a distance 𝑟 from the current element.

𝒅𝑩 = 𝜇04𝜋∙𝐼

𝑟2∙ 𝒅𝒍 𝒙 �̂�

Where, 𝐼 is the current in the wire, 𝒅𝒍 is a vector that points in the direction of the current, 𝒓

is the displacement vector from 𝑑𝑙 to P, �̂� =𝒓

𝑟 is the unit vector in the direction of 𝒓, and 𝜇0

is called the permeability of free space and is equal to 4𝜋 𝐸−7 𝑇 ∙ 𝑚/𝐴 The total magnetic field is found by summing (integrating) all contributions, 𝒅𝑩, on a path along the conductor.

𝑩 = ∫𝒅𝑩

Ampere’s Law

The line integral of the magnetic field around a closed curve, (Amperian loop), is equal to the total net current enclosed by the curve multiplied by a constant.

∮𝑩 ∙ 𝒅𝒍 = 𝜇0𝐼𝑒𝑛𝑐

Solenoid

The magnitude of the magnetic field inside a current carrying solenoid is given as

𝐵 = 𝜇0𝑛𝐼 Where, 𝑛 = 𝑁/𝐿 is the number of turns per unit length. The direction of the field is given by the right-hand rule, where when you close your right hand around the loops in the direction of the current your thumb points in the direction of the magnetic field.

Toroid

The magnitude of the magnetic field inside a current carrying toroid is given as

𝐵 = 𝜇0𝑁

2𝜋𝑟𝐼

Where, 𝑁 is the number of turns and 𝑟 is the distance from the center of the toroid. The direction of the field is given as in the case of the solenoid.

By: ferrantetutoring