I want to find magnetic field generated by infinitly long wire using ampere's law but ampere's law is gives us scaler how can i get vectorial solutions
ampere's law : u0*i/(2*pi*d)

 채택된 답변

Star Strider
Star Strider 2017년 4월 23일

2 개 추천

You may not have the definition of it that you need.
Try this:
mu0 = pi*4E-7; % Ref: https://en.wikipedia.org/wiki/Vacuum_permeability
AmpereB = @(m0u,I,r) (mu0.*I)./(2*pi*r); % µₒ = Magnetic Constant, I = Current (A), r = radius (m), Ref: https://en.wikipedia.org/wiki/Amp%C3%A8re%27s_circuital_law
radius = linspace(1E-3, 1);
I = 1;
figure(1)
semilogy(radius, AmpereB(mu0,I,radius))
grid
xlabel('r (m)')
ylabel('B')

댓글 수: 4

Sogogo
Sogogo 2017년 4월 23일
thanks for your answer
but how can i get magnetic field vectors (arrows) arround the wire, how can i get directional arrows
Star Strider
Star Strider 2017년 4월 23일
These appear to have the correct directions (using conventional calculus to generate directional components for the quiver arrows):
mu0 = pi*4E-7; % Ref: https://en.wikipedia.org/wiki/Vacuum_permeability
AmpereB = @(m0u,I,r) (mu0.*I)./(2*pi*r); % µₒ = Magnetic Constant, I = Current (A), r = radius (m), Ref: https://en.wikipedia.org/wiki/Amp%C3%A8re%27s_circuital_law
radius = linspace(1E-3, 1);
I = 1;
figure(1)
semilogy(radius, AmpereB(mu0,I,radius))
grid
xlabel('r (m)')
ylabel('B')
thp = linspace(0, 2*pi);
thq = linspace(0, 2*pi, 10);
r5f = @(th) AmpereB(mu0,I,0.5)*[cos(th); sin(th)]; % Circle For Quiver Origins
uv = AmpereB(mu0,I,0.5)*[-sin(thq); cos(thq)]; % Quiver Directions
r5q = r5f(thq); % Quiver Origins
r5c = r5f(thp); % Continuous Circle
figure(2)
quiver(r5q(1,:), r5q(2,:), uv(1,:), uv(2,:)) % Plot Arrows
hold on
plot(r5c(1,:), r5c(2,:), '-r') % Plot Radius=0.5 Circle
hold off
grid
axis equal
title('B(r=0.5m, I=1A)')
This is the best I can do. I’ve not done anything with Ampere’s law since shortly before Pangaea split apart.
Sogogo
Sogogo 2017년 4월 23일
thank you very much i should keep working from this one
Star Strider
Star Strider 2017년 4월 23일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Vector Fields에 대해 자세히 알아보기

제품

질문:

2017년 4월 23일

댓글:

2017년 4월 23일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by