|
Department of Mathematics |
University of Nebraska Lincoln |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Spring 2006 JDEP 384H Home PageWelcome to the JDEP 384H, Numerical Methods in Business, home page. You're probably here for information, so let's start with the vital statistics of the course.Essential Information
Numerical Analysis in Business Resources
AnnouncementsNotes and FAQ03/28/06: Where do I stand right now?... Well, that's easy enough. Here's a table to help you out. This table has all the possible grades for tests and assignment totals in this course. Notice there are zeros where an activity has not been completed yet. So if you are looking at this table and we've only done the midterm, then the grade scales are based on this data alone. Now all you need is your own scores. If you don't have them or simply want to see what grades I have recorded for you so far, email me with and give the the last 5 digits of your NUID. I will respond with the grades I have in my grade book. The grade scales row gives the bottom score to attain the given grade. Grade Scales for JDEP 384H, Spring 2006
1/9/06: Programming odds & ends... Here's a question I've answered for another student in a different class that might be helpful to you. It identifies a problem with understanding of how MATLAB functions work: I have a question about the Euler function for matlab. One of it's arguments is function name. What exactly would the function name be? We have an ODE we're trying to solve. So what is our function? Also if we define a function, we have to give it points to evaluate at. Well, functions are variables, and like all variables they have names and content. In Matlab names are just strings of characters (strings for short). Now notice that the comments of the function Euler say that the function has to have a certain format, namely it has to have arguments t,y, in that order. If you are solving a vector system, then y must be a vector; otherwise it is a scalar. In our exercise, it is just a scalar. For example, if I wanted to create a function represents the rhs of the ode dy/dt = t*sin(y), I would create a "function file" by using my favorite editor (Matlab has one, just type "edit" while you are in the command mode and the editor may pop up with a prompt asking if you want to create a new file. If so, hit the OK button, and you're off and running. Another option is to use your own favorite plain text editor.) In any case, the next thing that I would do is save the empty file and give the future function file a name like "fcn.m". You must use the extension ".m". Here would be the contents of the file, the first line of which must start with "function...": function retval = fcn(t,y) % description: FYI, the percent sign is a comment symbol % in both matlab and octave. and in fact whatever I put % here will appear right up to the first blank line % whenever I type "help fcn". Matlab and octave first see % if the function is already in memory. They then search % the current directory, then their own special function file % directories for a name that matches "fcn.m". Then they open % the file to see if its first line is "function x = fcn(xx,xxx)". % the arguments of the function are xx and xxx, and the return value % is whatever name follows "function". If so it is a function file % and the programs will then print out all comment lines up to the % first blank. % This line won't appear in your help request, and in fact you don't % need to type any comment lines at all. I like to remind myself of % syntax by putting a brief help description in my functions. % "retval" is just my favorite name for a returned value. You can use % anything else. Also, the parameter list for the function, "xx,xxx" % is important only inside the function. These are dummy variables or % placeholders, just like the dummy variable of a definite integral. retval = t*sin(y); end % this last end is optional in matlab (or octave in a function file.) Whew! That's all there is to it. Notice that the only mandatory lines in this file are the first line and the line "retval = t*sin(y)". Now if I invoke the function interactively in Matlab, say by typing "fcn(2,4*pi)", I'll get the return value of 2*sin(4*pi), which will be a specific number (in this case, 0.) BTW, Matlab has lots of builtin functions like sin, cos, ln, exp, etc, and builtin variable names like pi, eps, etc. And finally, for the answer you've been waiting for, the name of the function I just defined is 'fcn'. NB: don't use double quotes in Matlab, only single. This is one way to pass a function as a parameter in Matlab/Octave. Just say, for example, to solve the ode with IC y(0)=1 from 0 to 3 in steps of size 0.1, just type myanswer = Euler('fcn',0,1,0.1,30) There is a more sophisticated approach to function names in Matlab which is not compatible with Octave. Each function is an "object", so has a "handle" which is really a pointer to the function. You invoke the handle by the syntax "@fcn". If the function is passed in this way, then it can be used like any other builtin function. However, the command feval still works both ways, that is, with a quoted string name of the function or with its handle. Finally, I'm going to offer a few tips to novice programmers that might make their life a little easier. Feel free to use or not use them or misuse them. A few practical programming tips...
1/9/06:About significant digits... I've been asked to explain what significant digits of an approximation to a number mean. Here goes: to get the number of significant digits, first *subtract* (rather than just looking at the numbers) the two (may as well be larger - smaller,) then find the position of the leading digit of the error relative to the position of leading digit of the exact answer. (We're thinking in fixed point representation in this discussion.) If the difference in that position is at most 5, then number of significant digits is one less than that position, else two less. For example if 1.006 and .995 are used to approximate 1, calculate 1.006 - 1 = 0.006. Notice I put the zero in front of the decimal to start counting from the right position. There is disagreement at the 4th position, counting from the (base 10) position of the leading digit of 1, and the size of this disagreement is greater than 5, so this approximation has 2 significant digits. On the other hand, 1 - .995 = 0.004, which again first disagrees in the 4th position, and the size of the disagreement is at most 5, so .995 has 3 significant digits as an approximation to 1. BTW, it's also perfectly correct to say that each answerhas one significant digit, though this doesn't give all the available information. Hope this helps. Class Policy Statement
Course: JDEP 384H, Numerical Methods in Business Place/Time: 110 Kauffman, 9:30-10:45 TR, Spring 2006 Preq: Permission. Objectives: To help students achieve competence in the following areas:
Telephone: Office 472-7233 Home 489-0560 Email: tshores1@math.unl.edu Web Home Page: http://www.math.unl.edu/~tshores1/ Office Hours: Monday 3:30-5:00, Tuesday 11:00-1:00, Thursday 12:00-1:30, Friday 8:00-9:30, and by appointment. Office: 229 AvH Class Attendance: Is required. If absent, it is incumbent upon the student to determine what has been missed as soon as possible. It is advisable to consult with the instructor. Homework/Projects: Homework will be assigned in class and collected in accordance with the syllabus, and will be usually returned within one week. Although collaboration in solving problems is encouraged, it is strictly forbidden to copy someone else's homework. In some cases I will allow teams of two to turn in a single solution for certain problems. The official programming language for this course is Matlab. Prior experience in Matlab is not required. Current information about the course will be available through this lab account and the web (via the 384H homepage or my home page). Using the web is strongly recommended for keeping track of current activities in the course. Reading Assignment: Read the sections of the texts as, or before, they are covered in class lectures. This is a standing assignment throughout the semester. Grade: One midterm will be given and will account for 130 points. The final exam will count 130 points. Each exam may have a take home component. In-class exams are closed book with calculators. Homework will count 240 points. The final grade will be based on these 500 points. Final Exam: Will be comprehensive. To be given on Thursday, May 4, 10:00 - 12:00 am in 110 Kauffman. Grades of "I", "W" or "P": These grades will be given in strict accordance with University policy. (See any Schedule of Classes for the relevant information and dates.)
Keep This Information!!!
Syllabus for JDEP 384H, Spring 2006
ISBN: 2-00-102676-7
Friday, January 20, is the last day to withdraw from the course and not have it appear on your transcript.
Friday, March 3, is the last day to change your grade option to or from ``Pass/No Pass''.
Friday, April 7, is the last day to withdraw from the course and receive a grade of W.
Final Exam: The final exam is a comprehensive exam to be given on Thursday, May 4, 10:00 - 12:00 am in 110 Kauffman. Department Grading Appeals Policy: The Department of Mathematics does not tolerate discrimination or harassment on the basis of race, gender, religion or sexual orientation. If you believe you have been subject to such discrimination or harassment please contact the department. If, for this or any other reason, you believe that your grade was assigned incorrectly or capriciously, appeals may be made to (in order) the instructor, the department chair, the departmental grading appeals committee, the college grading appeals committee and the university grading appeals committee.
|