Course 18.085: Mathematical Methods for Engineers I
(Fall 2006)


Department of Mathematics
Massachusetts Institute of Technology


[notes] [info] [homework] [class resources] [old exams] [links]


Important Notes

o Here is a finite element code with many comments -- I thought you might like to see how it works and try some examples by varying boundary conds. Homeworks to learn from, not to turn in! How does error drop from n to 2n? Moving on to Fourier after discussion Monday of finite elements.

This FEM code solves Poisson with f=1 on the square with standard mesh. You will be able to run the code as is/ boundary conditions easy to change HOMEWORK: USE SEVERAL m=n to find u at the center node (U=0 on boundary). HOMEWORK 2: Change boundary conditions (nodes in b) to make U=0 on *3* sides Solve again for U at the center // NOTICE how boundary conditions come last

2D Finite Element Code

o Gradient and Divergence / Parallel Table   ( ps | pdf )

o normalmodescode for Mu'' + Ku = 0

     % inputs M, K, uzero, vzero, t
     [vectors,values] = eig(K,M); eigen = diag(values); % solve Kx = (lambda)Mx
     A = vectors\uzero; B = (vectors*sqrt(values))\vzero;
     coeffs = A.*cos(t*sqrt(eigen)) + B.*sin(t*sqrt(eigen));
     u = vectors*coeffs;  % solution at time t to Mu'' + Ku = 0

o improved GRID2Dcode from Professor Strang

     N=3; % N*N nodes and 2N*N - 2N edges in a square grid
     col=[-1; zeros(N*N - 1,1)]; % -1 on diagonal of AH
     row=[-1 1 zeros(1,N*N -2)]; % +1 next to the diagonal
     AH=toeplitz(col,row); % Incidence matrix/Horizontal edges
     AH(N:N:N^2,:)=[]; % Remove N nonexistent edges/end nodes
     ROW=[-1 zeros(1,N-1) 1 zeros(1,N*N-N-1)]; % off-diagonal 1
     COL=[-1; zeros(N*N-N-1,1)]; % -1 on diagonal of AV
     AV=toeplitz(COL,ROW); % Incidence matrix/Vertical edges
     A=[AH;AV]; % Combine horizontal and vertical edges into A
     ATA=A'*A; % Conductance matrix (singular) of order N*N
     norm(ATA*ones(N*N,1)) % Check that ATA(1;...;1)=0

     B=toeplitz([2 -1 zeros(1,N-2)]); B(1,1)=1; B(N,N)=1;
     fastATA=kron(B,eye(N)) + kron(eye(N),B); % 2D from 1D
     norm(ATA - fastATA) % Check that both ATA's are correct
     % Voltages 0 and 1 at nodes k and j/can remove columns j,k from A
     % Easier way ! Create a current source f between nodes j and k
     % Ground a node (which can be k) and find u=ATA\f and u(j)
     % This is the voltage needed at j for unit current from j to k
     ATA(:,k)=[]; ATA(k,:)=[]; % Ground node k to make ATA invertible
     f=zeros(N*N - 1); f(j)=1; u=ATA\f; u(j) % Expect 1/2 for neighbors

o Short paper on infinite networks

o Another code:

     A=zeros(2*N*(N-1),N*N);
     for i=1:N-1, % first row horizontal edges
         A(i,i)=-1;
         A(i,i+1)=1;
     end
     for i=1:N, % ith vertical edges
         for j=1:N-1,
             A(i+j*(2*N-1)-N,i+(j-1)*N)=-1;
             A(i+j*(2*N-1)-N,i+j*N)=1;
         end
     end
     for i=1:N-1, % horizontal edges from second row to last row
         for j=1:N-1,
             A(i+j*(2*N-1),i+j*N)=-1;
             A(i+j*(2*N-1),i+1+j*N)=1;
         end
     end

[top]


General Information

o Lecturer:   Gilbert Strang (gs@math.mit.edu), room 2-240

o Lectures: MWF 11   room 2-190

o Course outline:   (ps, pdf)

o Exams dates:   Sept 29 moved to Oct 2 during classtime   Nov 3   Dec 8
All exams in 18085 will be open book and notes.

o Teaching assistants:  

[top]


Homework

o Homework 1:   due 11am WED 9/13   (ps | pdf)

o CORRECTIONS TO HOMEWORK 2

o Homework 2:   for WED September 20 from the sections on the web

Hoping for someone to try the MATLAB Experiment (web section 1.2):   (ps | pdf)

o Homework 3:   for FRI September 29

o Selected Solutions for Homework 3:   ( ps | pdf )

o Homework 4:   for FRI Oct 13 on Networks

o Selected Solutions for Homework 4:   ( ps | pdf )

o Homework 5:   due FRI October 20 on Trusses

o Selected Solutions for Homework 5:   ( ps | pdf )

o Homework 6:   due FRI October 27    Finite Elements in 1D / (Section 5.4 explains weak form in 2D)

o Selected Solutions for Homework 6:   ( ps | pdf )

o Homework 7:   Sorry to be slow to get this homework assignment to you. It will be due Monday the 27th (after Thanksgiving -- we do meet WED 22)

Then a final homework on Fourier Integrals (4.3) -- possibly not to collect.

o Selected Solutions for Homework 7:

[top]


Class resources

o Movie of elimination   moe.m   (also need realmmd.m)

o Code to create K,T,B,C as sparse matrices

o MATLAB's backslash command to solve Ax = b   (ps, pdf)

o Getting started with Matlab: http://ocw.mit.edu/OcwWeb/Mathematics/18-385Nonlinear-Dynamics-and-ChaosFall2002/RelatedResources/index.htm

[top]


Exams and Solutions from previous years

o Exams and Solutions (Fall 2005)

o Exams and Solutions (Fall 2004)

o Exams and Solutions (Fall 2003)

o Exams and Solutions (Fall 2002)

o Exams and Solutions (Fall 2001)

o More Exams and Matlab Homeworks from previous years

[top]


Some related links

o Videos of Professor Strang's Lectures (Lincoln Lab, Spring 2001)

o Linear algebra demos

o Fourier and signal processing resources (thanks to Julie)

o Least Squares: The Importance of Error Bars

[top]


You are visitor number 111438 since September 2, 1997.

MIT © 1997 Massachusetts Institute of Technology