plot(sin(0:0.1:(2*pi)),'r'); % 'r' specifies that the curve be drawn in red print('sin.eps','-depsc'); % save an eps file, which can be used in latex print('sin.png','-dpng'); % save a png file

General | Homework | Programming assignments | Demos | Links |
---|

#### Final Exam time and place

- Time: Dec. 11, 2008. 10:00-11:50 AM.
- Place: MSCS 203 (usual class meeting place).
- More information about final schedule is here.

Prerequisites: MATH 4233, MATH 4153 (or CS 4153). Advanced machine computing, algorithms, analysis of truncation and rounding errors, convergence and stability applied to discrete variables, finite difference methods for solving hyperbolic, parabolic and elliptic differential equations. One programming language (e.g. C/C++, Fortran, Matlab, Maple) is required. Among them, Matlab is recommended. (syllabus)**Course description:**See Syllabus Attachment for university-wide rules regarding dropping a course, academic integrity, and office of student disability services.

**Instructor:**Yanqiu Wang- Office: 441 MATH (405-744-5698)
- Office Hour: TR 4-6pm or by appointment.
- Email:
*yqwang (AT) math.okstate.edu*

**Textbook:**- Finite Difference Schemes and Partial Differential Equations, (2nd ed.)
- Author: J. C. Strikwerda

**Classroom and time:**Sec Classroom Time 001 TR 10:30-11:45pm MSCS 203 **Grading Policy:**- Your final grade will be based on the following:
- 6 homework (120pts) and 4 programming assignments (80pts);
- Final Exam (100pts): comprehensive, open-book, open-notes;
- The Total is 300 pts: A (>=90%), B (>=80%), C (>=70%), D (>=60%).

**Make-up Policy:**- Make-ups for exams will only be allowed for an authorized absence under University Regulations. Normally a written note is required. Student should contact the instructor to schedule a make-up by the end of the next working day after the missed exam.
- You sacrifice 5 points per day for each late homework and programming assignments. Early submissions are always welcome.

Back to top |
---|

- Hwk 1: due 9/2/2008. A.2.2, A.2.3(only first part), 1.1.1, 1.1.2
- Hwk 2: due 9/16/2008. 2.1.4, 2.1.5, 2.1.6, 1.4.2, 1.4.4
- Hwk 3: due 9/30/2008. 1.5.2, 1.6.3, 2.2.3, 2.2.4, 2.2.6, 3.2.1.
- Hwk 4: due 10/23/2008.
- Hwk 5: due 11/13/2008. 6.3.1 (only the part for (6.3.4)), 6.3.14, 7.1.4, 7.2.2.
- Hwk 6: due 12/4/2008.

Back to top |
---|

(1) a report stating your results, conclusions, and graphs if any; (in hardcopy)

(2) your code (through email).

- Assignment 1: due 9/11/2008. 1.3.1
- Assignment 2: due 10/21/2008. (You may want to read this demo for some hint.)
- Assignment 3: due 11/11/2008.
- Assignment 4: due 12/4/2008.

Back to top |
---|

- Here's our first demo Matlab program (all .m examples list on this webpage should also runs under Octave). It models the continuous shifting of sin(x) to the right. You can see how to define a vector and a matrix, to make a loop, and to plot curves and surfaces.
- A simple example of using forward/backward-time forward-space discretization to solve the one-way wave problem. Copy and paste the code into a .m file and run it. (The programming style in this example is considered "bad" for matlab programs. I delibrately disintegrated some commands in order to make the code easier to read for beginners. For those who are familiar with Matlab, you should "vectorize" your codes.)
- You can use the following code to save the plots into image files:
Type "help print" to learn about file formats. Option '-depsc' save an eps file in color, option '-deps' will save an eps file in black-and-white. In matlab, you can also save a jpg file with by using the option '-djpeg'. Unfortunately, Octave supports less file formats.
plot(sin(0:0.1:(2*pi)),'r'); % 'r' specifies that the curve be drawn in red print('sin.eps','-depsc'); % save an eps file, which can be used in latex print('sin.png','-dpng'); % save a png file

- How to change directory under Octave? For example, the script "myprogram.m" file is saved under
"C:\Documents and Settings\myusername\My Documents\myprogram.m", you need to change the current working directory
under Octave in order to run the script. Type
Then you can type the filename in Octave to run the script:
chdir('C:\Documents and Settings\myusername\My Documents')

myprogram

- A Matlab demo on error in h-norm for the upwind scheme.
- A Maple demo demo for solutions of 1-D heat equations.
- Solving the minimal surface problem using the finite difference method. This is a nonlinear problem. Detailed description is given in this PDF file. The Matlab code can be found here.

Back to top |
---|

- You need Adobe Reader to open some of the above links.

- The Mathworks (Matlab) There are many Matlab tutorials on the web. Here're a few of them to help you get started:

A Very Elementary MATLAB Tutorial, Matlab Summary and Tutorial, Matlab Tutorial, A nice collection of Matlab tutorials, Matlab programming in Wikibooks - Octave is a free substitution for Matlab. Try this in case you don't have access to Matlab.

Octave in Wikibooks

Back to top |
---|