next up previous contents
Nächste Seite: Mehrdimensionales Newton-Verfahren Aufwärts: M-Files zu den Funktionen Vorherige Seite: M-Files zu den Funktionen   Inhalt

Höhenlinien-Plots

Das Beispiel zum Zeichnen der Oberfläche eines Futtersilos mit Bodenlagerung wird im File 'silo.m' gelöst.

% silo.m H\"ohenlinien, Volumen und Abspannseile
%   fuer Futtersilo mit Bodenlagerung
h=zeros(61);  xpl=zeros(1,61);  ypl=zeros(1,61);
[xg,yg]= meshgrid(0:0.1:6,0:0.1:6 );
for k= 1:61
  x = (k-1)*0.1;   xpl(k) = x;
  for j=1:21
    y = (j-1)*0.1;  ypl(j) = y;
    h(k,j) = 0.2*x*(6-x) * y*(2-y);
  end
end
% Volumen in Liter = 10 mal (h in m) Summe aller Hoehen je 10x10cm
V=10*sum(sum(h))
contour3(xg,yg,h,30)
hold on
hmx = max(max(h))
for k=0:4
  xs1 =k+ (0:0.1:2) ; xs1(1);   ys1 = 0:0.1:2;
  zs1 =  0.2*xs1.*(6-xs1) .* ys1.*(2-ys1);
  plot3(ys1,xs1,zs1,'k')
end
for k=2:6
  xs1 =k+ (0:-0.1:-2) ;  xs1(1);   ys1 = 0:0.1:2;
  zs1 =  0.2*xs1.*(6-xs1) .* ys1.*(2-ys1);
  plot3(ys1,xs1,zs1,'k')
end
hold off;  vx=sum(h');  vpart=zeros(1,61);
for k=1:61
  vpart(k) =10*sum(vx(1:k));
end
vpart 
figure(2); plot(xpl,vpart) ; figure(1)



Stefan Adam 2006-03-07