Plotting magnetic field of a permanent magnet.

11 visualizaciones (últimos 30 días)
Suraj Tamrakar
Suraj Tamrakar el 28 de Jul. de 2017
Respondida: ould hichem el 9 de Nov. de 2017
I would like to plot the magnetic field around a magnet. I have trying to plot magnetic field potential, and been partially successful for a point source, I believe. But would like to know if it is ok, and how can I make it better with bigger dimension. If you could correct me or give me suggestions, that would be great. Thank you.
%%2D plot practice
xa = linspace(-1,1,50); % x-axis or all positions in X
ya = linspace (-1,1,25);
[Y,X] = meshgrid(ya,xa);
D= X.^2 +Y.^2;
k= 1e-7; % mu/4*pi
m= 1e-4; %magnetic moment
M_pot= (k*m)./D; % Magnetic potential
% imagesc(xa,ya,D');
pcolor(xa,ya,M_pot');
shading interp
% smoothens the pixel boxes. with pcolor.
axis equal tight;
  1 comentario
KSSV
KSSV el 28 de Jul. de 2017
IT's been very long we studied about it...why don't you give it's formula..so that users can see it and check whether code needs modification...

Iniciar sesión para comentar.

Respuestas (1)

ould hichem
ould hichem el 9 de Nov. de 2017
You would use pde toolbox

Categorías

Más información sobre Smoothing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by