$Id: LectureRemarks.txt,v 1.6 2017/05/06 20:04:29 mike Exp $ 1/14/13: no discussion 1/16/13: usual intro to Lab 2 1/20/13: MLK day 1/23/13: * Discuss eps, 1+eps, 2+eps - Generic for computers, not just Matlab - analogy with pixillated screens * Files: script, function, data, fig - cannot import data from .jpg, but can treat as an image * Can use a comma to separate statements on a line and still print * %{ and %} can be used to identify bunch of statements as comments. * "break" "continue" and "return" * Final element of vector is y(end) * length, numel, size 1/28/13: Intro Lab 3 1/30/13: * When using uparrow for recovering previous commands, can give first few symbols in command to filter. * Can highlight set of commands in command history to make a script. * Although I say all variables are double precision, it is possible to have many different variable types. Only single and double floating point. * No specific "logical" variables. 1 is true, 0 is false * Some students use the expression, "order of accuracy is approximately..." It is not the order of accuracy that is approximate * To plot complex numbers, use plot(exp(i*pi*linspace(-1,1,100))) - ONLY ONE ARGUMENT, NOT TWO! 2/4/13 Matlab ODE solvers options (odeset) * AbsTol, RelTol mentioned in lab * Stats: gives information on how many function calls, etc. * Jacobian: matrix or function handle - needed for very stiff problems - JPattern for sparse matrices * Mass: matrix or function handle - might be singular! - MvPattern for sparse matrices - MassSingular (yes|no|maybe) * Vectorized: if ODE function uses elementwise syntax * Events - An "event" is when some component or scalar function becomes 0 - Can "terminate", do something, continue - My home page -> Matlab workshop, 12/1/12 2/6/13 Intro to lab 4 2/11/13 Matlab plotting * Button: Show plot tools * Change line width and color * Add markers (need just a few data for this) * Annotate with text arrow * Annotate by drawing squares, etc. * Click on Axes - change x-scale, limits - make axes bigger * Tell them that "handle graphics" is the way to do command-line changes. 2/13/13 Remarks on PDE discretizations * Spatial: - FDM is simplest to understand o order of accuracy determined using Taylor's theorem o Hard to deal with angled and curved boundaries o Hard to have high order at boundaries. o Start derivation from PDE itself - FEM is theoretically deeper o Math people like it: close association with func. anal. o Order of accuracy determined using approximation theory o Easy to deal with boundaries o Easy to get high order accuracy o Particularly well-suited to elliptic problems + number of people in the world using FDM for structural analysis is probably fewer than 10 o Start derivation from weak form of PDE - Shooting methods not generally used! o Sometimes can make "quick and dirty" possible o Financial math applications. * Temporal - Majority of applications use method of lines - It is possible to use FEM in time! - Very common temporal integrators: backwards Euler, trapezoid, bdm2 2/18/13 Usual Lab 5 introduction 2/20/13 Discuss FEM details in Lab 4 * Remark that \phi_i are \emph{defined} as 1. Piecewise quadratic (but could be others) 2. \phi_i(x_j)=\delta_{ij} * In response to question, said that linears are OK, too, but I chose quadratics for the lab so that could get roundoff-sized errors in verification problems. * Discussed gaussquad - breaks interval into subintervals of size h, then uses 3-pt Gauss - exact for polys up to degree 5 - all our functions are continuous on subintervals of size h - allows roundoff-sized errors in verification problems * Mentioned that convergence rate ratios are not clean, promised more info when I establish whether or not this is due to roundoff * Need to use "<=" in \phi and \phip to get correct plots and to get extra credit right. 2/25/13 Comments on Lab 4 * the \phi_i are DEFINED as 1. piecewise quadratic 2. \phi_i(x_j)=\delta_{ij} * gaussquad remarks - break interval ito subintervals of length h and use 3-pt Gauss in each. - exact for polys up to degreee 5 - great for this problem * be careful of <= inside phi and phip code. 2/27/13 Brief intro to symbolic toolbox (Maple for R14, muPad for more recent versions) * From the getting started help * Declarations: syms x y sym('w') sym('2') or just sym(2) for symbolic constant sqrt(2) is floating-point, sqrt(sym(2)) is 2^(1/2) 1/sqrt(2) is rationalized x=sym(2) (NOT x=2) 2-sqrt(x)^2=0 2-sqrt(2)^2=roundoff * Calculations syms x (to clear value 2) z=(x+sin(y))^5 needs expand (others are simplify, factor, collect) diff(z), diff(z,x), diff(z,y) diff(z,y,2), diff(z,2) int(z), int(z,y) int(z,0,1), int(z,y,0,1), int(int(z,0,1),0,1) * They asked about mixed symbolic and floating calculations I don't know the rules for, e.g.: x=sym(2) a=1/3 (x+a) ? 3/4/13 more symbolic toolbox: find FEM shape function * Look for phi=quadratic poly = 1 at x1, 0 at x2, 0 at x3 syms a b c x x1 x2 x3 phi=a*x^2+b*x+c % no syms needed! eq1=subs(phi,x,x1)==1 % note == eq2=subs(phi,x,x2)==0 eq3=subs(phi,x,x3)==0 S=solve(eq1,eq2,eq3,a,b,c) phi1=subs(phi,a,S.a) % note how to get solution phi1=subs(phi1,b,S.b) phi1=subs(phi1,c,S.c) phi1=factor(phi1) * result is phi1 = ((x - x2)*(x - x3))/((x1 - x2)*(x1 - x3)) 3/6/13 Intro to Lab 7 3/11-15 spring break 3/18 Discussed rewriting FEM stuff in Fortran and running in quad precision to get accurate estimate of accuracy. See tests/lab4accuracy/discussion.txt 3/20 Intro to Lab 8 3/25 Efficiency of computations * initialization to zero - tic; for i=1:4000000;v(i)=0;end;toc takes 1.569075 - tic; for i=1:4000000;v(i)=0;end;toc takes 0.347026 - tic;v4=zeros(4000000,1);toc takes 0.023463 + zeros(2000,2000) is similar - tic;v3(4000000)=0;toc takes 0.000136 - tic; for i=1:2000;for j=1:2000;B(i,j)=0;end;end;toc 4.636132 seconds. - same, second time 0.365736 seconds. - tic; for i=2000:-1:1;for j=2000:-1:1;E(i,j)=0;end;end;toc 0.386840 * initialization to non-zero - tic; for i=2000:-1:1;for j=2000:-1:1;F(i,j)=i+j;end;end;toc 0.395390 - tic; for i=2000:-1:1;for j=2000:-1:1;G(i,j)=sin(i+j);end;end;toc 0.592777 3/27 Efficiency again * compare different times for Frobenius norm >> tic;A=rand(2000,2000);toc Elapsed .076 >> tic;B=A*A';nrm=sqrt(sum(diag(B)));toc Elapsed time is 0.62 seconds. >> tic;nrm1=norm(A,'fro');toc Elapsed time is 0.055 seconds. >> tic;nrm2=0;for i=1:2000;for j=1:2000;nrm2=nrm2+A(i,j)^2;end;end;nrm2=sqrt(nrm2);toc Elapsed time is 0.155 seconds. >> tic;C=A.*A;nrm3=sqrt(sum(sum(C)));toc Elapsed time is 0.019 seconds. * Associative law N=2000;A=rand(N,N);B=rand(N,N);v=rand(N,1); tic;w=A*B*v;toc Elapsed .60 sec tic;x=A*(B*v);toc Elapsed .085 sec - A*B is O(N^3), B*v is O(N^2) - this effect is same in other languages. 4/1 Introduction to Lab 9 4/3 missed-sick 4/8 Discuss underdetermined systems and SVD * Many solutions: affine subspace * "particular solution" + sum ( const_i * basisvector_i) * SVD V, nullspace={V(:,i) | S(i,i)==0} : if A*x=0, then U*S*V'*x=0, then S*V'*x=0 but S*V'*x=[S(1,1)*V(:,1)'*x(:)+ ... ]=0, so either V(:,i)'*x=0 or S(i,i)=0 * want to solve A*x=b U*S*V'*x=b, so S*V'*x= (U*b) = (bbar_range) + (bbar_nullspace) multiply by Splus: V'*x=Sinv*(bbar_range) and x=V*Sinv*(bbar_range) * least squares because U,V orthogonal 4/10 Introduction to Lab 10 4/14 Debugging (qr_convergence. see 2071/tests/debug) 1. Start out with: A=eigen_test(8); [e,num]=qr_bug(A,1.e-8) % qr_convergence with abs val removed from sort fails: too many iterations 2. since convergence is failing, look at convergence: if norm(e-eold) < tol*(1-rho)*norm(e) * norm(e-eold) might not -> 0 * norm(e) might -> infinity * (1-rho) might be negative 3. print these out and watch fprintf('norm(e-eold)=%e, rho=%e, norm(e)=%e\n',norm(e-eold),rho, ... norm(e)) norm(e-eold) -> 0 rho -> bigger than 1 norm(e) -> const 4. but rho cannot be larger than 1! Fix it and it works. 5. Avoid the pain: look at my original code. remark about "assert". 4/16 Internet resources * NA-digest * Netlib (browse it) - lapack - toms (T On Math Software) - slatec * Matrix market * mathoverflow.net * math.stackexchange.com * arXiv.org * wikipedia * mathworld.wolfram.com ---------------------------------------------------------------------- 2014 2014 2014 2014 2014 2014 2014 2014 ---------------------------------------------------------------------- 1/8/14 second day * Show that various windows in Matlab can be moved around - Dock editor and plot windows - arrange to your liking by drag-and-drop * When writing the summary file, you can keep the Matlab editor up and copy your stuff to it. * Can use a comma to separate statements on a line and still print * format compact * Files: script, function, data, fig - cannot import data from .jpg, but can treat as an image 1/13/14 Matlab plotting * Button: Show plot tools at far right top * Click on line - change type to bar and back - line width, color - Add markers (need just a few data for this) * Click on background - add title - change background color - change axis text color - add grid - remove box - move around and change size - change x to log scale - "More Properties" and handle graphics for command-line * Annotate with text arrow - put some stuff in - LaTeX interpeter 1/15/14: Lab 2 intro 1/22/14: Debugging extras/debugging/debug1.m * Row-reduction, 1 step N=100; M=1+rand(N,N); % never zero on diagonal fprintf('Determinant of original M=%g\n',det(M)); for k=2:N for j=1:N M(k,j)=M(k,j)-(M(k,1)/M(1,1))*M(1,j); end end printf('Determinant of new M=%g\n',det(M)); 1. Reduce size to 3X3: dets still disagree 2. Fix matrix: magic 3. Print matrices: Col 1 OK, Cols 2,3 unchanged ??? 4. Bring up debugger 5. Stop inside loop a. Check M(k,1)/M(1,1) using command line b. Step: M(2,1) turns into zero c. Step again: M(2,2) unchanged! d. What was M(k,1)/M(1,1)? ZERO! 6. Fix 1/27/14: Intro to Lab 3 1/29/14 Matlab ODE solvers options (odeset) extras/matlab/odeset.tex 2/3/14 First FreeFem++, extras/freefem++/I.tex * only one showed 2/5/14: Intro to Lab 4 2/10/14: Second FreeFem++, extras/freefem++/II.tex * The students are not interested, only one showed (plus one other) 2/12/14: Comments on Lab 4 extras/lab4accuracy/lab4comments.tex * the \phi_i are DEFINED as 1. piecewise quadratic 2. \phi_i(x_j)=\delta_{ij} * gaussquad remarks - break interval ito subintervals of length h and use 3-pt Gauss in each. - exact for polys up to degreee 5 * use of gaussquad makes it easy to see test problems are correct. * convergence results are not so clean as they could be: roundoff problems extras/lab4accuracy.tgz 2/17/14: Intro to Lab 5 2/19/14: Brief intro to symbolic toolbox (muPad) * From the getting started help * Declarations: syms x y sym('w') sym('2') or just sym(2) for symbolic constant sqrt(2) is floating-point, sqrt(sym(2)) is 2^(1/2) 1/sqrt(2) is rationalized x=sym(2) (NOT x=2) 2-sqrt(x)^2=0 2-sqrt(2)^2=roundoff * Calculations syms x (to clear value 2) z=(x+sin(y))^5 needs expand (others are simplify, factor, collect) diff(z), diff(z,x), diff(z,y) diff(z,y,2), diff(z,2) int(z), int(z,y) int(z,0,1), int(z,y,0,1), int(int(z,0,1),0,1) * Mixed arithmetic double + sym = sym x=sym(2) a=1/3 y=x+a whos 2/24/14 Intro to Lab 6 2/26/14 more symbolic toolbox: find FEM shape function * Look for phi=quadratic poly = 1 at x1, 0 at x2, 0 at x3 syms a b c x x1 x2 x3 phi=a*x^2+b*x+c % no syms needed! eq1=subs(phi,x,x1)==1 % note == eq2=subs(phi,x,x2)==0 eq3=subs(phi,x,x3)==0 S=solve(eq1,eq2,eq3,a,b,c) phi1=subs(phi,a,S.a) % note how to get solution phi1=subs(phi1,b,S.b) phi1=subs(phi1,c,S.c) phi1=factor(phi1) * result is phi1 = ((x - x2)*(x - x3))/((x1 - x2)*(x1 - x3)) 3/3/14: Efficiency * initialization - tic; for i=1:4000000;a(i)=0;end;toc takes 1.569075 (first time) - tic; for i=1:4000000;a(i)=0;end;toc takes 0.347026 (v already alloc) - tic; for i=4000000:-1:1;b(i)=0;end;toc takes .346876 - tic; c(4000000)=0;for i=1:4000000;c(i)=0;end;toc takes .040137 - tic; d=zeros(4000000,1);toc takes 0.023463 - tic; for i=1:2000;for j=1:2000;e(i,j)=0;end;end;toc 4.636132 seconds. - same, second time 0.365736 seconds. - tic; for i=2000:-1:1;for j=2000:-1:1;f(i,j)=0;end;end;toc 0.386840 - tic; for i=2000:-1:1;for j=2000:-1:1;g(i,j)=i+j;end;end;toc 0.395390 - tic; for i=2000:-1:1;for j=2000:-1:1;k(i,j)=sin(i+j);end;end;toc 0.579662 - tic; m(2000,2000)=0;for i=2000:-1:1;for j=2000:-1:1;m(i,j)=sin(i+j);end;end;toc 0.283989 - tic;n=zeros(2000,2000);toc takes 0.027703 3/5/14: Intro to Lab 7 3/10/14 spring break 3/12/14 spring break 3/17/14 No one present: would have been intro to lab 8 3/19/14 lab cancelled in favor of Ivan's exam 3/24/14: Efficiency * Vectors instead of loops: loop vectorization trick N=200001; x=linspace(0,pi,N); s(N-2)=0; tic; for k=2:N-1 s(k-1)=( sin(x(k+1))-2*sin(x(k))+sin(x(k-1)) )/sin(x(k)); end toc min(s) max(s) FASTER: N=200001; x=linspace(0,pi,N); s(N-2)=0; tic; k=2:N-1; % k is a vector s(k)=( sin(x(k+1))-2*sin(x(k))+sin(x(k-1)) )./sin(x(k)); toc min(s) max(s) SLIGHTLY faster yet N=200001; x=linspace(0,pi,N); tic; s=( sin(x(3:N))-2*sin(x(2:N-1))+sin(x(1:N-2)) )./sin(x(2:N-1)); toc min(s) max(s) * Associative law for matrix-vector speedup slow: (A*B)*x, fast: A*(B*x) N=2000; A=rand(N,N); B=rand(N,N); x=rand(N,1); tic;y=(A*B)*x;toc %slow tic;z=A*(B*x);toc %fast norm(y-z) 3/26/14 generating random numbers extras/random 3/31/14 Intro to Lab 9 4/2/14 octave 4/7/14 Debugging (qr_convergence. see 2071/extras/debugging/debug) 1. Start out with: A=eigen_test(8); [e,num]=qr_bug(A,1.e-8) % qr_convergence with abs val removed from sort fails: too many iterations 2. since convergence is failing, look at convergence: if norm(e-eold) < tol*(1-rho)*norm(e) * norm(e-eold) might not -> 0 * norm(e) might -> infinity * (1-rho) might be negative 3. print these out and watch fprintf('norm(e-eold)=%e, rho=%e, norm(e)=%e\n',norm(e-eold),rho, ... norm(e)) norm(e-eold) -> 0 rho -> bigger than 1 norm(e) -> const 4. but rho cannot be larger than 1! Fix it and it works. 5. Avoid the pain: look at my original code. remark about "assert". 4/14 Internet resources * NA-digest * Netlib - lapack - toms (T On Math Software) - slatec * stay away from "Numerical Recipes" * Matrix market * mathoverflow.net * math.stackexchange.com * arXiv.org * wikipedia, scholarpedia * mathworld.wolfram.com ---------------------------------------------------------------- 2016 2016 2016 2016 2016 2016 2016 2016 2016 2016 2016 ---------------------------------------------------------------- 1/11/16 Second day * Use comma to separate statements on a line w/o suppressing printing * %{ and %} surround a block of comments--can be used to "commenting out" a block of code. * "break" and "continue" and "return" * last element of a vector is y(end) Using the Matlab window: * circle with down-arrow in UR - "minimize" to put on right - "maximize" leaves symbol to return it - un-dock it (and can re-dock it same way) * edit window comes up separate, but can dock it - Code analyzer report - Dependency report * can also dock plot window: gets shared with editor window 1/13/16 Gussying up plots * setup: [x,y]=meshgrid(linspace(-1,1,100),linspace(-1,1,100)); surf(x,y,x.^2+y.^2) * Rotate icon: do it - rotate (move cursor inside--changes) * Pan icon (hand) * insert colorbar icon * Data cursor icon: show it * Edit menu - colormap: change it a little * Show plot tools icon: bring up edit window * insert text, etc. - use latex as interpreter for math * can make subplots: - highlight one that data goes into * can save an m-file with graphics commands in it from the "File"->"Generate Code" menu in the property editor window. - will discuss creating files and setting properties next Wed. 1/20/16 Usual intro to Lab 2. 1/25/16 extras/pendulum/pendulum1.tex 1/27/16 Usual intro to Lab 3 2/1/16 extras/pendulum/pendulum2.tex: verifying nonlinear soln 2/3/16 Matlab plotting * Button: Show plot tools at far right top * Click on line - change type to bar and back - line width, color - Add markers (need just a few data for this) * Click on background - add title - change background color - change axis text color - add grid - remove box - move around and change size - change x to log scale - "More Properties" and handle graphics for command-line * Annotate with text arrow - put some stuff in - LaTeX interpeter 2/8/16 Usual intro Lab 4 2/10/16 Odeset extras/odeset/odeset.tex 2/15/16 extras/PDE/PDE.tex 2/17/16 extras/Lab4Comments/comments.tex 2/22/16 Lab 5 intro 2/24/16 extras/Lab4Comments/comments1.tex 2/29/16 Lab 6 intro 3/2/16: Brief intro to symbolic toolbox (muPad) * From the getting started help * Declarations: syms x y sym('w') sym('2') or just sym(2) for symbolic constant sqrt(2) is floating-point, sqrt(sym(2)) is 2^(1/2) 1/sqrt(2) is rationalized x=sym(2) (NOT x=2) 2-sqrt(x)^2=0 2-sqrt(2)^2=roundoff * Calculations syms x (to clear value 2) z=(x+sin(y))^5 needs expand (others are simplify, factor, collect) diff(z), diff(z,x), diff(z,y) diff(z,y,2), diff(z,2) int(z), int(z,y) int(z,0,1), int(z,y,0,1), int(int(z,0,1),0,1) * Mixed arithmetic double + sym = sym x=sym(2) a=1/3 y=x+a whos * subs(z,y,pi) 3/14/16 more symbolic toolbox: find FEM shape function * Look for phi=quadratic poly = 1 at x1, 0 at x2, 0 at x3 syms a b c x x1 x2 x3 phi=a*x^2+b*x+c % no syms needed! eq1=subs(phi,x,x1)==1 % note == eq2=subs(phi,x,x2)==0 eq3=subs(phi,x,x3)==0 S=solve(eq1,eq2,eq3,a,b,c) phi1=subs(phi,a,S.a) % note how to get solution phi1=subs(phi1,b,S.b) phi1=subs(phi1,c,S.c) phi1=factor(phi1) * result is phi1 = ((x - x2)*(x - x3))/((x1 - x2)*(x1 - x3)) 3/16/16 Intro to Lab 7 3/21/16 Debugging extras/debugging/debug1.m * Row-reduction, 1 step N=100; M=1+rand(N,N); % never zero on diagonal fprintf('Determinant of original M=%g\n',det(M)); for k=2:N for j=1:N M(k,j)=M(k,j)-(M(k,1)/M(1,1))*M(1,j); end end printf('Determinant of new M=%g\n',det(M)); 1. Reduce size to 3X3: dets still disagree 2. Fix matrix: magic 3. Print matrices: Col 1 OK, Cols 2,3 unchanged ??? 4. Bring up debugger 5. Stop inside loop a. Check M(k,1)/M(1,1) using command line b. Step: M(2,1) turns into zero c. Step again: M(2,2) unchanged! d. What was M(k,1)/M(1,1)? ZERO! 6. Fix * Note: vectorized j-loop does not exhibit bug! 3/23/16 Intro to Lab 8 4/7/14 Debugging (qr_convergence. see 2071/extras/debugging/debug) 1. Start out with: A=eigen_test(8); [e,num]=qr_bug(A,1.e-8) % qr_convergence with abs val removed from sort fails: too many iterations 2. since convergence is failing, look at convergence: if norm(e-eold) < tol*(1-rho)*norm(e) * norm(e-eold) might not -> 0 * norm(e) might -> infinity * (1-rho) might be negative 3. print these out and watch fprintf('norm(e-eold)=%e, rho=%e, norm(e)=%e\n',norm(e-eold),rho, ... norm(e)) norm(e-eold) -> 0 rho -> bigger than 1 norm(e) -> const 4. but rho cannot be larger than 1! Fix it and it works. 5. Avoid the pain: look at my original code. remark about "assert". 3/28/16: Efficiency * Vectors instead of loops: loop vectorization trick N=1000001; x=linspace(0,pi,N); s(N-2)=0; tic; for k=2:N-1 s(k-1)=( sin(x(k+1))-2*sin(x(k))+sin(x(k-1)) )/sin(x(k)); end toc min(s) max(s) FASTER: N=1000001; x=linspace(0,pi,N); s(N-2)=0; tic; k=2:N-1; % k is a vector s(k)=( sin(x(k+1))-2*sin(x(k))+sin(x(k-1)) )./sin(x(k)); toc min(s) max(s) SLIGHTLY faster yet N=1000001; x=linspace(0,pi,N); tic; s=( sin(x(3:N))-2*sin(x(2:N-1))+sin(x(1:N-2)) )./sin(x(2:N-1)); toc min(s) max(s) * Associative law for matrix-vector speedup slow: (A*B)*x, fast: A*(B*x) N=2000; A=rand(N,N); B=rand(N,N); x=rand(N,1); tic;y=(A*B)*x;toc %slow O(N^3) tic;z=A*(B*x);toc %fast O(N^2) norm(y-z) 3/30 extras/random 4/4 intro Lab 9 4/6 extras/structs 4/11 octave/octave 4/13 intro lab 10 4/18 resources/resources 4/20 Wrapup x/x/xx cell arrays (see 2070) --------------------------------------------------------------------- 2017 2017 2017 2017 2017 2017 2017 2017 --------------------------------------------------------------------- 1/4/17: first day 1/09/17 Second day * Use comma to separate statements on a line w/o suppressing printing * %{ and %} surround a block of comments--can be used to "commenting out" a block of code. * "break" and "continue" and "return" * last element of a vector is y(end) Using the Matlab window: * circle with down-arrow in UR - "minimize" to put on right - "maximize" leaves symbol to return it - un-dock it (and can re-dock it same way) * edit window comes up separate, but can dock it - Code analyzer report - Dependency report * can also dock plot window: gets shared with editor window * When writing the summary file, you can keep the Matlab editor up and copy your stuff to it. 1/11/17 Gussying up plots * setup: [x,y]=meshgrid(linspace(-1,1,100),linspace(-1,1,100)); surf(x,y,x.^2+y.^2) * Rotate icon: do it - rotate (move cursor inside--changes) * Pan icon (hand) * insert colorbar icon (looks like colorbar) * Data cursor icon: show it (sheet of paper with plus on lower left) * Edit menu - looks like cursor arrow - point to colormap, use right-mouse to bring up edit menu - colormap: change it a little * Show plot tools icon: bring up edit window - click on picture, change labels, scale, etc. * insert text, etc. (text box icon) - use latex as interpreter for math - double-click on text to change it * can make subplots: - highlight one that data goes into 1/16/17 MLK day 1/18/17 IntroductionLab02 1/23/17 eps and roundoff * Explain IEEE double precision o 1 sign bit o 11 bit exponent with bias=1022 o 52-bit mantissa with assumed first bit=1 * format hex * eps and roundoff: * numbers near 1 >> 1 3ff0000000000000 >> -1 % 3+8=b, first bit is sign bff0000000000000 >> 1+eps 3ff0000000000001 >> 2 4000000000000000 >> 2+eps 4000000000000000 * It is not always true that for x>=2, (x+eps)=x >> 3.1 4008cccccccccccd >> 3.1+eps 4008ccccccccccce >> 3.1+2*eps 4008ccccccccccce >> 3.1+3*eps 4008ccccccccccce >> 3.1+4*eps 4008cccccccccccf 1/25/17 Intro do Lab 3 1/30/17 extras/pendulum/pendulum1.tex 2/1/17 extras/pendulum/pendulum2.tex 2/6/17 Intro to Lab 4 2/8/17 Leapfrog extras/pendulum/pendulum3.tex 2/13/17 Remarks on PDE discretizations extras/PDE/PDE.tex 2/15/17 Comments on Lab 4 FEM Exercise 4 extras/Lab4Comments/comments1.tex 2/20/17 Intro to Lab 5 2/22/17 Comments on Lab 4 FEM extras/Lab4Comments/comments.tex 2/27/17 Intro to lab 6 3/1/17 Matlab ODE solvers options (odeset) extras/odeset/odeset.tex 3/13/17 Superconvergence in Lab 4 extras/Lab4Comments/comments2.tex 3/15/17 Intro to lab 7 3/20/17 Discuss condition number and table in Lab 6, exercise 4 extras/ConditionNumber Probably should include this discussion in Lab 6 3/22/17 Intro to Lab 8 3/27/17: Debugging extras/debugging/debug1.m 3/29/17 extras/random 4/3/17 Intro to Lab 9 4/5/17 extras/structs 4/10/17 extras/octave 4/12/17 Intro to Lab 10 4/17/17 Debugging (qr_convergence. see 2071/extras/debugging/qr) 4/19/17 Wrapup