Magetic field due to straight current wire

Your Name]In summary, to create a MATLAB plot of the magnetic field due to a current wire in cylindrical coordinates, you can use the "quiver" function to plot vectors at specified points. This can be done by defining values for r and φ, calculating the magnitude of the magnetic field at each point using the formula B=m0*I/2πr, and using the "quiver" function to plot the vectors.
  • #1
el_greco
4
0

Homework Statement



We have a system of cylindrical coordinates (r,φ,z) and a straight electrical current wire along the z axis. The objective is to create a MATLAB plot of the magnetic field due to this current wire.


Homework Equations



Ampere's law gives us that B=m0*I/2πr for that current wire, for any given r (perp distance from the z axis).


The Attempt at a Solution



As a vector, this is Bφ, since the right hand grip rule tells us that the magnetic field lines follow the four right hand fingers at the φ direction, when the thumb shows the electrical current. So now I just want to plot this Bφ for a few r lines, for φ=0 to 2π, ie to obtain a few circles around this wire... Any idea how? :S
 
Physics news on Phys.org
  • #2



Hello,

Thank you for sharing your approach to solving this problem. Your understanding of Ampere's law and the right hand grip rule is correct. To create a MATLAB plot of the magnetic field due to the current wire, you can use the "quiver" function. This function plots vectors at specified points in the coordinate system.

First, you will need to define the values of r and φ for the points at which you want to plot the magnetic field. For example, you can use the "linspace" function to create a vector of equally spaced values for r, and the "meshgrid" function to create a grid of values for φ.

Next, you can use the formula B=m0*I/2πr to calculate the magnitude of the magnetic field at each point. Since the magnetic field is in the φ direction, you can use this value as the y-component of the vector, and set the x-component to 0. Then, use the "quiver" function to plot the vectors at the specified points.

I hope this helps. Let me know if you have any further questions. Good luck with your plot!



 

What is a magnetic field?

A magnetic field is a region in space where a magnetic force is exerted on a magnet or moving electric charge.

How is a magnetic field created by a straight current wire?

A magnetic field is created by the flow of electric current through a wire. The direction of the magnetic field is determined by the direction of the current flow, with the field forming concentric circles around the wire.

How does the strength of the magnetic field depend on the current in the wire?

The strength of the magnetic field is directly proportional to the amount of current flowing through the wire. As the current increases, the magnetic field also increases in strength.

What factors affect the strength of the magnetic field around a straight current wire?

The strength of the magnetic field is affected by the distance from the wire, with the field becoming weaker as the distance increases. It is also affected by the material surrounding the wire, with magnetic materials enhancing the field.

How can the direction of the magnetic field be determined around a straight current wire?

The right-hand rule can be used to determine the direction of the magnetic field. Point your thumb in the direction of the current flow and curl your fingers around the wire, the direction your fingers curl in is the direction of the magnetic field.

Similar threads

Replies
27
Views
1K
  • Introductory Physics Homework Help
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
14
Views
1K
Replies
14
Views
636
  • Electromagnetism
Replies
5
Views
308
Replies
61
Views
2K
  • Advanced Physics Homework Help
Replies
1
Views
1K
  • Electromagnetism
Replies
5
Views
968
  • Advanced Physics Homework Help
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
11
Views
2K
Back
Top