Current Announcements |

May 5. A step in the power method involves (a) z = A*v followed by a nomalization (b) v = alfa*z. There are different choices for alfa, e.g., alfa = 1/norm(z,2), alfa = 1/norm(z,1). In th elatter case, if z is a vector with nonnegative entries, then norm(z,1) = sum(z). Also, in this problem we know that the dominant eigenvalue is 1-- so we don't have to estimate it via v'*A*v/v'*v. That is why the terminantion criteria is based on norm(Av - 1*v).

May 5. Regarding A5 regrades--we must receive these by Monday, May 10. If you feel that A5b is graded unfairly, please run the test script which is posted with the solution. Submit the output from that along with your regrade request. (Reminder, regrades are physically processed--not via CMS.

May 3 The termination criteria for the Match function in Part A is specified incorrectly. Each time through the while loop three sine values are generated, call them s1, s2, and s3. Continue iterating if any of these are greater than  tol in absolute value. I.e., terminate the while loop  if 

                   |s1| <= tol        AND           |s2| <= tol           AND          |s3 <= tol.

Apr 30 In test script A6A, the vector "e" is not defined. Set e = ones(n,1). 

Apr 29  Two Typos in the A6 handout. Refer to the bulleted list towards the bottom of page 1. First, the C matrix is 

                                                C = Btilde*Atilde^{transpose}

Not C = Atilde^{transpose}*Btilde. Second, the specification for v_opt should be

                                        v_opt = (Q_opt^{Transpose}*A - B)e/n

not v_opt = Q_{opt}^{transpose}*A - B)/n. The pdf version of the handout has been corrected.

Apr 29  The A6 test scripts are available.

Apr 29 Links to a few interesting papers concerning the Google eigenproblem are here.

Apr 29 The A5 solution guide is available. The grading will be done by Monday.

Apr 28 Here is the A6 handout. Although it is not necessary for you to understand why the algorithm in A6A works, you may want to browse through this background handout.

Apr 28  Details regarding the final exam. It is to be given Friday May 21, 9-11:30 in Ives 305. We cannot give early exams because you need to leave town early. If you have a conflict or more than two exams within any 24-huot period that brackets our exam time, then email Gun detailing your situation. FYI, we will be scheduling a review session and special office hours next week.


Apr 21. In A5B, you might want to take the approach of computing the bracketing intervals rather than trying to "derive" them via analysis. Indeed, when fzero is called with a single-number starting value, it proceeds to search for an initial bracketing interval. It is perfectly OK to evaluate f during this search. 

Apr 21 Take a look at the modified syllabus to see how things flow during the last two weeks of class. You will get A6 on Monday April  26. It will be due Friday, May 7 (Slope Day).

Apr 20

In P5B, it makes sense to set the x-tolerance to 10^-6 because the data is accurate to the nearest minute and there are roughly 500,000 minutes in a year,
                    fmin('MyF', Left, Right, [ 0 10^ -6], Param1, Param2,...)
Also, use subfunctions in this assignment whenever a required function that you write for submission
to CMS refers to another function that you have written.

Apri 15  The Prelim 2 solution guide is available. All regrade requests in by Wed April 21.

Apr 14 Here is the Assignment 5 handout.

Apr 14  regarding the function Update(d,alpha) that you must write in Part C, alpha is an angular measure. Assume that it is in radians. (Indeed, everywhere in the problem, assume radians.)

Apr 14 Two things about Part C. (1) We forgot to mention that your implementation of Update will be tested using the script A5C, which is available on the website. (2) In the handout, it is suggested that you write a function SeasonLength. This is now required and it should have this specification:

  function sE = SeasonLength(d,alpha)
  % sE a row 4-vector whose components are the four season
  % lengths that are predicted by the eccentric model with parameter
  % values d and alpha. Units are days and the first thru fourth components
  % are associated with Spring, SUmmer, Autumn, Winter.


Apr 14 A5 test scripts available


Apr 7  CVL office hours on Thursday = 10-12.

Apr 7 A4 Solutions available.

Apr 6  Both the review session (Wed, 4/7,  7:30-9pm) and Prelim II (Thur, 4/8, 7:30-9pm) are in Phillips 101.

Apr 2. There is a prelim Thursday night, April 8. Click here  for syllabus, review problems etc.

Apr 2  We've extended the A4 due date from 4pm Tuesday to 10AM Wednesday (4/7).

Apr 2  Assignment 3 solutions are available.

Mar 30  Test scripts for A4 are available. So is the handout. READ THE NEXT THREE NEWS ITEMS!

Mar 30  Comments on Assignment 4, Part A. Make your implementation of GenSylvester as fast as possible. How you vectorize is up to you. Use backslash to solve triangular systems--Matlab is efficient when it does this. As suggested, you should look at P6.1.3. Indeed, I would work out the solution to that problem. Observe how you are led to a solution procedure by comparing columns in the equation SX-TR= B. Follow the same methodology here.

Mar 30  Comments on Assignment 4, Part B. Typo in the footnote. The binomial coefficient q-choose-r  is defined to be zero if q<r. If q>=r then it is one if r = 0 and q!/(r!(q-r)!) otherwise. You may use backslash when solving triangular systems.

Mar 30 Comments on Assignment 4, Part C. To make your life easier, assume that the ray does not go through ANY polygon vertex and is not parallel to any polygon edge. The rules for your solution procedure are (a) fully vectorized and (b) the computed solution to each 2-by-2 system must be exactly the same as what would be produced if Gaussian elimination with pivoting is applied.. Use column vectors to store "the players". E.g., A22 = vector of all (2,2) entries, B1 = vector of all top components of the right hand sides, etc.


Mar 29 Gun's 9-10 office hours are moved to 1-2 for today only.

Mar 15. For 3/26 (Friday) and 4/2(Friday) only, Adam's 2-5 office hours are moved to 3/25 (Thursday) and 4/1 (Thursday)  4:30-5:30. 



Mar 10. Vectorization issues in A3. For full credit in Part A, you should have a fully vectorized implementation of maxSpline. In this case it means no loops. And you should take steps to ensure that the vector operations involve only necessary calculations. Just to be clear, a solution that looks at each local cubic's max value separately and then takes the max of those values will be docked 3 points (assuming that it is correct).

In Part B, recall that  QUAD will be calling your integrand function with vector arguments. You must make sure that your implementation of PointEnergy and LineEnergy can handle this. You are allowed to do this in a "naive" way. That is, if you have a scalar implementation of a function MyF(x) then the vectorized version can be arranged as follows


   function y = MyFVectorized(x)
   n = length(x);
   for i=1:n
      y(i) = MyF(x(i));
This turns out to be the only way to go for LineEnergy. There are better approaches for PointEnergy but we won't insist that you find them.

Mar 10. A minor change had to be made to the test script A3. The new version is available. Basically, we had to multiply the orbit radii by 10^6 , e.g.

Planet(1) = struct('name','Mercury','d',35.9773*10^6,'R',1516);
Planet(2) = struct('name','Venus','d',67.2322*10^6,'R',3759);
Planet(3) = struct('name','Earth','d',92.9570*10^6,'R',3963);
Planet(4) = struct('name','Mars','d',141.6102*10^6 ,'R',2111);

And we changed the output format so that the energy is reported in "scientific notation.",...

title(sprintf('thetaStar = %7.3f (deg)      EnergyMax = %7.3e',thetaStar*180/pi,EnergyMax))

Mar 3. The Assignment 3 handout is available. So are the given scripts.




Mar 1. If you would like us to regrade (part) of your Prelim write a clear note about the issue, attach it to your prelim, and give it to us. (Either in lecture or section.) We'll only accept regrade requests up through the Monday 3/8 lecture.

Mar 1. Prelim 1 solutions are available

Feb 25 Here is a rough draft of the solution for prelim 1. There is no partial credit scheme. And don't jump to any conclusions if your solution is different than ours.

Feb 25. We are running behind in  section. The agenda this week will be P3.2.3 and the exam solutions.

Feb 25. The scripts used in today's lecture are available.

Feb 25. The 3:30 Friday section is hereby cancelled due to zero attendance. Please select an alternative section and/or visit Gun in his office at the section time.

Feb 23 Solutions to A2 are available.

Feb 23  Review Session in Ph 101 at 7:30 tonight

Feb 11.  We will begin using the newsgroup to both post announcements about the course and receive and answer questions about the course, homeworks, sections, etc.  The Cornell newsgroup server is and the course newsgroup is cornell.class.cs322.  You can connect to the newsgroup through any news reading software, but MicroPlanet Gravity is supplied free through BearAccess.  Instructions for installation and configuration of Gravity to read Cornell newsgroups can be found at Please contact Adam if you have questions.


Feb 11. Prelim 1 is on Tuesday night, February 24. Here are some details about what you need to know. Because we will post solutions to Assignment 2 on Monday (2/23) at 4pm, there will be no late submissions.

Feb 11. Assignment A2 is available. You will need some test scripts.

Feb 11. Assignment 1 solutions are available. Grading should be done in a few days.

Feb 3. IMPORTANT In anticipation of the first due date (next Monday, Feb 9), you should get familiar with the Course Management System (CMS). Your assignments are submitted, graded, returned, and (if necessary) regraded under the auspices of this system. You can also establish groups should you choose to work with a partner. We will distribute this handout  in class tomorrow. The key thing is that you try out the system this week. "Not knowing how to use CMS" is not a valid excuse for missing the deadline.

Some aspects of the submission process as stated in the assignment handout do not apply since we will be using CMS. All you have to do is to electronically submit these files: Area.m, newfinitefern.m, A1C.m, AccuDerivative.m, and A1D.m. We will run these and thereby produce the output. Thus, you do not submit any output figures.

Feb 3. When it makes sense, scripts and functions that figure centrally in a lecture will be place here.




Feb 2. If you are working with the Student Edition of Matlab, you may have to revise downwards some the values of "n". Thus, if you cannot to newfinitefern(50000) try (say) newfinitefern(1000) etc. It shouldn't really make a difference. (I.e, we'll not penalize you in the grading.)

Feb 2. Ignore today's from the Course Management System (CMS). I'm learning how to use it! We'll tell you how to submit things in a day or two.

Jan 29  Typo in Assignment 1. In problem B (Fern Trajectories), the relevant NCM problem is 1.15, not 1.17. (In case any of you are using a "December" version of NCM, 1.17 is the correct problem.)

Jan 29 All sections are balanced in terms of size except F3:35 (4 sign-ups).. Thus, feel free to attend Th 12:20,Th 3:35, or F2:30. If you are in F3:35, let us know if you can attend a different section. You do not have to do any drop/adding when it comes to the sections.

Jan 28 Assignment P1 is available