跳至內容

File:Level grad.png

頁面內容不支援其他語言。
這個檔案來自維基共享資源
維基百科,自由的百科全書

Level_grad.png(358 × 336 像素,檔案大小:70 KB,MIME 類型:image/png


Transferred from en.wikipedia to Commons by Maksim.

The original description page was here. All following user names refer to en.wikipedia.

Done with Matlab.

Public domain 我,此作品的版權所有人,釋出此作品至公共領域。此授權條款在全世界均適用。
這可能在某些國家不合法,如果是的話:
我授予任何人有權利使用此作品於任何用途,除受法律約束外,不受任何限制。
File:Level grad.svg是本檔案的向量版本。 如果品質不低,就應該優先使用該檔案,而非PNG檔案。

File:Level grad.png → File:Level grad.svg

更多資訊請參閱Help:SVG/zh

其他語言
Alemannisch  Bahasa Indonesia  Bahasa Melayu  British English  català  čeština  dansk  Deutsch  eesti  English  español  Esperanto  euskara  français  Frysk  galego  hrvatski  Ido  italiano  lietuvių  magyar  Nederlands  norsk bokmål  norsk nynorsk  occitan  Plattdüütsch  polski  português  português do Brasil  română  Scots  sicilianu  slovenčina  slovenščina  suomi  svenska  Tiếng Việt  Türkçe  vèneto  Ελληνικά  беларуская (тарашкевіца)  български  македонски  нохчийн  русский  српски / srpski  татарча/tatarça  українська  ქართული  հայերեն  বাংলা  தமிழ்  മലയാളം  ไทย  한국어  日本語  简体中文  繁體中文  עברית  العربية  فارسی  +/−
新SVG圖片

.

Source code:

Lx1=-1.7; Lx2=2.3; Ly1=-2; Ly2=2;  % box dimensions
N=60; % split the box into N x N grid
[X, Y]=meshgrid(Lx1:1/N:Lx2, Ly1:1/N:Ly2); % the grid

f=inline('-((y+1).^4/25+(x-1).^4/10+x.^2+y.^2-1)');   % draw the level sets of f
fx=inline('-2/5*(x-1).^3-2*x'); fy=inline('-4/25*(y+1).^3-2*y'); % partial deriv  
Z=f(X, Y); % the function value

figure(1); clf; hold on; axis equal; axis off; % pop up a figure
h=0.5; % spacing between heights
v=[-20:h:0.8 0.85]; % the heights
[c,h] = contour(X, Y, Z, v, 'b'); % the level sets at those heights

x0=0.1333; y0=-0.0666; % coordinates of the top of the hill
delta=0.01; % descend from the top of the hill with this step size
Angles=linspace(0, 2*pi, 20); % will draw 19 descent curves with Angles(i)

for i=1:length(Angles)
   x=x0+0.1*cos(Angles(i)); y=y0+0.1*sin(Angles(i)); % starting point
   Curve_x=[x]; Curve_y=[y]; % will hold a descent curve following the gradient

   % descend from the hill 
   for j=1:500
      x=x-delta*fx(x);
      y=y-delta*fy(y);
      Curve_x=[Curve_x x]; Curve_y=[Curve_y y]; % append the updated values

      if max(abs(x), abs(y)) > 5 % stop when going beyond the picture frame
	 break;
      end
   end
   plot(Curve_x, Curve_y, 'r') % plot the curve of steepest descent
end

axis([Lx1 Lx2 Ly1 Ly2]); % the picture frame

saveas(gcf, 'level_grad.eps', 'psc2') % save as color postscript. Use gimp to convert
% to png. Does anybody know how to reduce aliasing (gimp helps, but only a bit)?
date/time username edit summary
19:47, 30 January 2006 en:User:Varuna (get rid of ugly tag warning)
18:54, 23 December 2004 en:User:Oleg Alexandrov (added source code)
18:41, 23 December 2004 en:User:Oleg Alexandrov (I made this. {{PD}})

原始上傳日誌

Legend: (cur) = this is the current file, (del) = delete this old version, (rev) = revert to this old version.

Click on date to download the file or see the image uploaded on that date.

說明

添加單行說明來描述出檔案所代表的內容

在此檔案描寫的項目

描繪內容

檔案歷史

點選日期/時間以檢視該時間的檔案版本。

日期/時間縮⁠圖尺寸使用者備⁠註
目前2006年3月19日 (日) 15:31於 2006年3月19日 (日) 15:31 版本的縮圖358 × 336(70 KB)MaksimLa bildo estas kopiita de wikipedia:en. La originala priskribo estas: Done with Matlab. {{PD-self}} Source code: <pre> Lx1=-1.7; Lx2=2.3; Ly1=-2; Ly2=2; % box dimensions N=60; % split the box into N x N grid [X, Y]=meshgrid(Lx1:1/N:Lx2, Ly1:1/N:Ly2); %

下列頁面有用到此檔案:

全域檔案使用狀況

以下其他 wiki 使用了這個檔案: