From charlesreid1

Loworderpoly_vs_highorderpoly.png(560 × 420 pixels, file size: 6 KB, MIME type: image/png)

Matlab-generated plot of a low-order polynomial and a high-order polynomial.

X = linspace(0,1,100);

alpha = 1e-2;

A = [ 25; 
      -4;
      15;
      4;
      8;
      1;
      2;
      0.5;
      0.5;
      1;
      1;
      0.5; ];
  
lambda = [ 1; 2; 3; 4; 5; 8; 20; 21; 25; 28; 35; 100; ];

for i=1:length(X)
    % For each term in the temperature expression, 
    % at the given spatial location
    T(i) = 0;
    for j=1:length(lambda)
        B(j) = exp(-(lambda(j)*pi*alpha).^2);
        C(j) = sin( lambda(j)*pi*X(i) );
        T(i) = T(i) + A(j)*B(j)*C(j);
    end
end

U=30*X.^4-15*(X-1).^3+12*X.^2+X-5;

plot(X,T,'r',X,U,'b','LineWidth',2);

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current19:32, 5 November 2010Thumbnail for version as of 19:32, 5 November 2010560 × 420 (6 KB)Admin (talk | contribs)adding x-axis and y-axis labels
19:31, 5 November 2010Thumbnail for version as of 19:31, 5 November 2010560 × 420 (6 KB)Admin (talk | contribs)Matlab-generated plot of a low-order polynomial and a high-order polynomial. <syntaxhighlight lang="matlab"> X = linspace(0,1,100); alpha = 1e-2; A = [ 25; -4; 15; 4; 8; 1; 2; 0.5; 0.5; 1; 1;

The following page uses this file: