# Homework¶

Homework problems are due by 6:00 pm on the date indicated. Homework assignments will consist of two types of problems:

*Analytical problems*:

- Show your work. If you used a calculator or computer to help solve a problem, state what you used.
- Write your answers legibly (or type them out). I will take off points for problems that cannot be read.

*Programming problems*:

- All computational work must be accomplished in functions and scripts. Aside from running each script at the Matlab prompt, no other commands should be required.
- All Matlab scripts should begin with the
`clear`

command, to ensure that it does not depend on externally-defined variables. - All Matlab files must have your name in the comments, and all Matlab functions must be commented to fully describe arguments, outputs and the purpose of major code blocks.
- If specified in the assignment, your file names
*must*match those requested, to simplify grading.

I recommend that students work together to discuss general approaches for problems. This may include general proof strategy, general code organization, or explanation of topics from lecture or the textbook. However, specific details on solving problems or implementing programs must not be discussed with anyone except the instructor. All work turned in for credit must represent your own individual effort, and must be in keeping with the SMU Honor Code.

Examples of allowed/disallowed collaboration:

*Proofs*: You can discuss the strategy of any proof (e.g. proof by contradiction, important definitions from the book, etc.), including any “tricks” that may be required. However, all actual writing of the proof and all justification of steps must be done on your own, and may**not**be copied from another student.*Codes*: You can discuss the code structure, including which functions are needed, which algorithms to use, and how functions should interact with one another (e.g. input/output arguments). However, you must write all codes yourself, using your own personal variable/fuction names, comments, and implementation details.

**Turning programming problems in:**

Before 6:00 pm on the date indicated, you must upload a single ”.tgz” or ”.zip” file to Canvas, containing all Matlab functions and scripts as separate ”.m” files, and all requested input, output and diary files as ”.txt” files.

**Turning analytical problems in:**

Before 6:00 on the date indicated, you must upload a single ”.pdf” file to Canvas, with your responses to all analytical homework problems.

## Assignments¶

Homework 1:

`Nonlinear solvers`

(due Feb. 9)Written Solutions:

`Written problems`

Matlab Solutions:

`prob3.m`

,`prob4.m`

,`newton.m`

,`steffensen.m`

,`broyden.m`

Python Solutions:

`prob3.py`

,`prob4.py`

,`newton.py`

,`steffensen.py`

,`broyden.py`

Testing scripts:

`test_steffensen.m`

,`test_broyden.m`

,`test_steffensen.py`

,`test_broyden.py`

Homework 2:

`Interpolation Part I`

(due Feb. 23)Written Solutions:

`Written problems`

,Matlab Solutions:

`hw2.m`

,`Newton_interp.m`

,`Hermite_interp.m`

Python Solutions:

`hw2.py`

,`Newton_interp.py`

,`Hermite_interp.py`

Testing scripts:

`test_interp.m`

,`test_interp.py`

Homework 2b:

`Interpolation Part II`

(**not**due)`Solutions`

– note that these say “HW #3”, and that problem 2 listed in these solutions is**not**part of this homework (the material was not covered in class).Homework 3:

`Numerical Integration and Richardson Extrapolation`

(due Mar. 23)Solutions:

`Written problems`

Matlab Solutions:

`prob3.m`

,`composite_quadrature.m`

,`Simpson.m`

,`RichSimpson.m`

,`OpenNewtonCotes5.m`

,`RichOpenNewtonCotes5.m`

Python Solutions:

`prob3.py`

,`composite_quadrature.py`

,`quadratures.py`

,`OpenNewtonCotes5.py`

,`RichOpenNewtonCotes5.py`

Homework 4:

`Orthogonal Polynomials`

(due Apr. 6)Written Solutions:

`Written problems`

Matlab Solutions:

`hw4.m`

,`myquad.m`

,`composite_quadrature.m`

,`Gauss3.m`

,`Simpson.m`

,`hw4_test.m (my script used to test your function)`

Python Solutions:

`hw4.py`

,`myquad.py`

,`composite_quadrature.py`

,`quadratures.py`

,`hw4_test.py (my script used to test your function)`

Homework 4b:

`Trigonometric Polynomials and Derivative Approximations`

(**not**due)Solutions:

`Written problems`

(note that these are incorrectly titled ‘Homework #6 Solutions’)Homework 5:

`Initial Value Problems`

(due April 20)Written Solutions:

`Written problems`

Matlab Solutions:

`AB3_step.m`

,`TS3_step.m`

,`hw5.m`

,`check_hw5.m (my script used to test your function)`

Python Solutions:

`AB3_step.py`

,`TS3_step.py`

,`hw5.py`

,`check_hw5.py (my script used to test your function)`

Homework 6:

`Initial Value Problems II`

(due May 4)Written Solutions:

`Written problems`

Matlab Solutions:

`RK3_step.m`

,`hw6.m`

,`check_hw6.m (my script used to test your function)`

Python Solutions:

`RK3_step.py`

,`hw6.py`

,`check_hw6.py (my script used to test your function)`