Análise de métodos númericos

2953 palavras 12 páginas
ANNEX * FIGURES:

(Figure 1 – Application of the code shown in Question 1)

(Figure 2 – Periodic advection using scheme (a))

(Figure 3 – Periodic advection using scheme (b))

(Figure 4 – Periodic advection using scheme (c))

(Figure 5 – Eigenvalues for the schemes (a), (b) and (c))

(Figure 6 – Periodic Burger’s Equation using scheme (a))

(Figure 7 – Periodic Burger’s Equation using scheme (b))

(Figure 8 – Periodic Burger’s Equation using scheme (c))

(Figure 9 – Periodic heat equation using scheme (a))

(Figure 10 – Periodic heat equation using scheme (b))

(Figure 11 – Periodic heat equation using scheme (c))

(Figure 12 – Eigenvalues for the schemes (a), (b) and (c) for second derivative)

(Figure 13 – Periodic backwards heat equation using scheme (a))

(Figure 14 – Periodic backwards heat equation using scheme (b))

(Figure 15 – Periodic backwards heat equation using scheme (c))

* CODES:

* General codes:

- Second Order Central Scheme

function C = Central2(Nx,dx,PeriodicFlag)
%
% [C] = Central2(Nx,dx,PriodicFlag)
%
% Return the matrix for the 1-2-1 Central second order FD scheme on a grid
% of Nx points with equal spacing dx.
%
% INPUTS:
%
% PeriodicFlag = 1 = TRUE;
% PeriodicFlag = 0 = FALSE;
%
% OUTPUTS:
% C = B fprintf(1,'Using 2nd-order central '); V1 = ones([1,Nx-1]);
V2 = ones([1,Nx-2]);
V3 = ones([1,Nx-3]); B = (-diag(V1,-1)+diag(V1,1))/(2*dx); if (PeriodicFlag == 0) % boundary terms fprintf(1,'bounded.\n'); B(1,:) = [-1 1 0*V2]/dx; B(Nx,:) = [0*V2 -1 1]/dx; else fprintf(1,'periodic.\n'); B(1,:) = [0 1 0*V3 -1]/(2*dx); B(Nx,:) = [1 0*V3 -1 0]/(2*dx); end C = B; return;

- Fourth Order Central Scheme:

function C = Central4(Nx,dx,PeriodicFlag)
%
% [C] = Central4(Nx,dx,PriodicFlag)
%
% Return the matrix for the Central fourth order FD scheme on a grid
% of Nx points with equal spacing dx.
%
% INPUTS:
%
%

Relacionados

  • mathematica
    1035 palavras | 5 páginas
  • calculo numerico integral
    2640 palavras | 11 páginas
  • algebra
    1587 palavras | 7 páginas
  • ZEROS DA FUN O PARTE 1
    1436 palavras | 6 páginas
  • Desenho
    722 palavras | 3 páginas
  • Atps Algebra l
    1564 palavras | 7 páginas
  • Atps Calculo Numerico
    2078 palavras | 9 páginas
  • Estudo Sobre O Scilab
    4792 palavras | 20 páginas
  • ATPS Calculo Numerico
    997 palavras | 4 páginas
  • Edos de segunda ordem especiais
    2205 palavras | 9 páginas