MTH 655 LAB 5

This time I encourage you to use MATLAB from a remote computing platform, i.e., from the app.science.oregonstate.edu . For this, you must have X-Windows under Cygwin working for you.

  • I suggest you use Start X Win icon to start X Windows under CYGWIN. Open a few terminal windows so you will have somehting to work with. For example,
    type xterm -bg red -fg black &
    type xterm -fg yellow -bg black &
    so you will have an additional "black" and "red" windows.
  • in the black terminal, type ssh -Y you@app.science.oregonstate.edu and input password
  • You can start MATLAB either in the usual graphic mode matlab
  • ... or, without the graphics mode
    matlab -nodesktop
  • Plan how you will copy all the files to the application server: use scp.
    Assuming you have the file myfile in your current folder ...
    in the red terminal ... ls myfile
    scp myfile you@app.science.oregonstate.edu:

  • Turn in solutions to project 1, or 2 (advanced). In both, please present plots of solutions, and of convergence of Newton (i.e., the size of residual as iterations progress).
  • Project 1. In the algorithm semilinear.m from Lab4, Pbm2, you solved a semilinear problem using Newton's method.

    Now apply the inexact Newton-Krylov method. (Use Chapters 3 and 6 in Kelley's book for background.)
    • (i) Change the call to linear solver in the code to GMRES. Look-up the properties of GMRES implementation in MATLAB. Start with the demos with various matrices such as the one obtained with gallery('wilk',n) so you can become familiar how to use the various parameters controlling GMRES depending on the dimension n of the problem you are solving.
    • (ii) Use a fairly high tolerance for GMRES like tau_gmres=1e-1 at first. Experiment how large tau_gmres affects the number of iterations of Newton solver. Then adjust the tolerance to be tighter when your Newton solver gets closer to the solution.
    • (iii) Since GMRES expects to work with a sparse matrix, change the set-up of matrices A to sparse.
    • (iv) Solve the largest problem (change n) you can on the local computer and on the applications server.
    • (v) Compare with other Krylov-type solvers pcg, bicgstab .

  • Project 2. Proceed as in Project 1 however for a problem with (i) widely varying coefficients and (ii) disparate scales as suggested in 4)iv).
    • (i) Set the coefficients k to have values from a log-normal distribution, e.g.,
      randn('seed',316);
      data = exp(randn(n+1,1));

    • (ii) Set the coefficient k to be equal to 1 in the first and third part of the domain, and to 10^b in the middle part for a large range of $b=2-6$. This choice works well with the nonlinearity. Now use $-b=2-6$: this choice works againts the nonlinearity.