Você está na página 1de 3

INTEGRANTES:

Enrique Coraisaca
Angel Uyaguari
Chritian Quizhpe
Carrera:

Ingeniera Electrnica

Tema:

Grafica de maltab ejercicio indicado en clases


%Ecuaciones de Poisson y Laplace
b = input('ingrese un primero valor\n');
d = input('ingrese un segundo valor\n');
v0 = input('ingrese el cantidad voltaje\n');

iteracion=100;
[x,y]=meshgrid(linspace(0,b,50),linspace(0,d,50));
v=zeros(length(x));
colormap('jet')
for j=1:50
for i=1:50
for n=1:iteracion
v(i,j)=v(i,j)+...
vo*(2-2*(-1)^n)*sinh((n*pi*x(i,j))/d)*...
sin((n*pi*y(i,j))/d)/(n*pi*sinh((n*pi*b)/d));
end
end
end

[Ex,Ey]=gradient(v);
Ex=-Ex;
Ey=-Ey;

fig = figure(1);
set (fig, 'Units', 'normalized', 'Position', [0,0,1,1]);

subplot(1,2,1); hold on;


title('Superficie potecial');
zlabel('Potecnial');
xlabel('x');
ylabel('y');
box on;
grid on
ax = gca;
ax.BoxStyle = 'full';
view(-45,46);
surf(x,y,v);

subplot(1,2,2); hold on;


title('Lineas de potencial y Lineas de Flujo')
xlabel('x');
ylabel('y');
contour(x,y,v,'Linewidth',1);
starty = 0:.3:d;
startx = ones(size(starty));
startx(:) = b;
Lineas=streamline(x,y,Ex,Ey,startx,starty);
set(Lineas(:),'Color',[.53 .32 .32],'Linewidth',1);

Grafica:

Você também pode gostar