Ficheiro:Numerical integration illustration, h=1.png

Fonte: testwiki
Saltar para a navegação Saltar para a pesquisa
Ficheiro original (1 500 × 2 183 píxeis, tamanho: 72 kB, tipo MIME: image/png)

Este ficheiro vem da wiki na wiki Wikimedia Commons e pode ser usado por outros projetos. A descrição na página original de descrição do ficheiro é mostrada abaixo.

Descrição do ficheiro

Descrição
Data
Origem Obra do próprio
Autor Oleg Alexandrov
Outras versões
File:Numerical integration illustration, step=1.svg é uma versão vetorial deste ficheiro. Ela deve ser usada em vez desta imagem em formato raster, se não for de qualidade inferior.

File:Numerical integration illustration, h=1.png → File:Numerical integration illustration, step=1.svg

Para mais informações, consulte Ajuda:SVG.

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

PNG desenvolvimento
InfoField
 Este diagrama foi criado com o MATLAB

Licenciamento

Public domain Esta obra foi dedicada ao domínio público pelo autor, Oleg Alexandrov, com aplicação em todo o mundo.
Nalguns países isto pode não ser legalmente possível; se assim for:
Oleg Alexandrov concede a todos o direito de usar esta obra para qualquer fim, sem quaisquer condições, a menos que tais condições sejam impostas por lei.

Source code (MATLAB)

 

% illustration of numerical integration
% compare the Forward Euler method, which is globally O(h) 
% with Midpoint method, which is globally O(h^2)
% and the exact solution

function main()

   f = inline ('y', 't', 'y'); % will solve y' = f(t, y)

   a=0; b=4; % endpoints of the interval where we will solve the ODE
   N = 5; T = linspace(a, b, N); h = T(2)-T(1); % the grid
   y0 = 1; % initial condition

   % solve the ODE
   Y_euler = solve_ODE (N, f, y0,  h, T, 1); % Forward Euler method
   Y_midpt = solve_ODE (N, f, y0,  h, T, 2); % midpoint method
   T_highres = a:0.1:b; Y_exact = exp(T_highres);
   
%  prepare the plotting window
   lw = 3; % curves linewidth
   fs = 20; % font size
   figure(1); clf; set(gca, 'fontsize', fs);   hold on;

   % colors
   red=[0.867 0.06 0.14];
   blue = [0, 129, 205]/256;
   green = [0, 200,  70]/256;

% plot the solutions
   plot(T, Y_euler, 'color', blue,  'linewidth', lw)
   plot(T, Y_midpt, 'color', green, 'linewidth', lw)
   plot(T_highres, Y_exact, 'color', red,   'linewidth', lw)

   % axes aspect ratio
   pbaspect([1 1.5 1]);

% save to disk
   disp(sprintf('Grid size is %0.9g', h))
   saveas(gcf, sprintf('Numerical_integration_illustration,_h=%0.2g.eps', h), 'psc2');
   
function Y = solve_ODE (N, f, y0,  h, T, method)

   Y = 0*T;
   
   Y(1)=y0;
   for i=1:(N-1)
	  t = T(i); y = Y(i);

	  if method == 1 % forward Euler method
		 
		 Y(i+1) = y + h*f(t, y);
		 
	  elseif method == 2 % explicit one step midpoint method
		 
		 K = y + 0.5*h*f(t, y);
		 Y(i+1) =  y + h*f(t+h/2, K);
		 
	  else
		 disp ('Don`t know this type of method');
		 return;
		 
	  end
   end

Legendas

Adicione uma explicação de uma linha do que este ficheiro representa

Elementos retratados neste ficheiro

retrata

73 846 byte

2 183 pixel

1 500 pixel

441b0ccb992cd08218f5f3a9217d9c134bc77844

Histórico do ficheiro

Clique uma data e hora para ver o ficheiro tal como ele se encontrava nessa altura.

Data e horaMiniaturaDimensõesUtilizadorComentário
atual03h57min de 25 de maio de 2007Miniatura da versão das 03h57min de 25 de maio de 20071 500 × 2 183 (72 kB)wikimediacommons>Oleg AlexandrovMake exact curve smooth

A seguinte página usa este ficheiro: