Contents
2 Workbook Questions [20 points total] 3
1 Project Outline
The term project is divided into three section, each with a corresponding Jupyter workbook. Each workbook will ask you to investigate various aspects of numerical methods or PDEs. You will then be expected to submit a PDF report for each workbook, answering the questions. You are also expected to submit your workbooks (.ipynb files) along with your reports. The code, if run by the instructors / TAs, should reproduce the figures included in your reports. You will submit the documents to Gradescope.
Notes about Grading Your grade on the reports will depend on:
- The over-all organization of your work
- The completeness and clarity of your answers
- How well you substantiate your claims with results (i.e. soundness of, and reference to, numerical findings), and how you connect the results to the underlying mechanics.
- How well you present your numerical findings (i.e. quality of graphs [note: quantity is not the same as quality!])
Note about Figures Take care with your graphs. Some things to consider are:
- labeling (what is plotted on the axes? What are their units [if any]?)
- legibility (labels, axis numbers, etc should be large enough to be easily read when included in the report
- captions are a useful way to give a (brief) explanation of what is shown in a figure.
2 Workbook Questions [20 points total]
- (a) [2 marks] Suppose that we have a spatial domain x [0,1]. Using u(x) = sin(2x), numerically compute the derivative for three grids:
- {0,0.1,0.2,,0.9}
- {0.05,0.15,0.25,,0.95}
- {0,0.1,0.2,,1.0}
A partial solution is provided in the workbook that computes the derivative for the first grid. Create a plot comparing the three solutions (basic plot started in sample solution). What differences, if any, are there between the three solutions, and what causes them?
You should create a final plot that shows the three derivatives together to support your answer.
(b) [2 marks] Consider the function u(x) = exp(x2) on a series of grids ranging from x [1,1], x [2,2], x [3,3], and x [5,5], each with the same spacing of x = 0.1.
Compute du/dx for each grid using the second-order scheme, and plot the derivatives on the same graph. Nominally, these would all be the same (theyre derivatives of the same function). What differences do your observe, and what causes them?
The last case (Lx = 10) is already completed in the workbook.
- [5 marks]
The provided code uses 2nd and 4th order finite difference approximations to compute the derivative of sin(x) for various values of x. The error is then plotted as a function of the resolution, which illustrates the order of convergence. That is, as x decreases, the error in the computed derivative decreases. More-over, the second order scheme decreases at the same rate as x2, while the fourth order scheme decreases at the same rate as x4.
If you change the variable Nmodes to be 10, the code will produce the results for sin(10x).
Describe the change in the error curve, and provide an explanation [hint: what happens for large x?].
The plots of the derivatives (also included in the provided code) may be useful.
- [5 marks] We saw that a basic scheme for stepping forwards in time is
In this question you will investigate the impact of the choice of t on the solution.
For the set of ODEs below, you need to:
- Compute the analytic (true) solution
- Numerically integrate over the specified time range to get the approximate solution.
- Compare the numerical results to the analytic results, and discuss the impact of t
- What can you say about the long-term trend in the error? Is this different from the other cases?
Why or why not?
ODEs to consider:
) from t = 0 to t = 2. u(0) = 0. Use t = 0.01,0.05,0.2 from t = 0 to t = 100. u(0) = 0.01. Use t = 0.001,0.01,0.05. You may want to use a
log-y plot.
= 2 from t = 0 to t = 10. u(0) = 0.. Use t = 0.01,0.1,1.0.
The workbook includes a sample solution for .
- [6 marks]
Consider the following PDE:
- ut = ux
- u(0,x) = exp(x2)
- x [5,5] (periodic domain)
- t [0,10]
Recall that our (simplest) differentiation schemes are:
Putting these into our PDE, we get
The provided code computes a numerical solution for a given x and CFL coefficient. Repeat the process for a selection of CFL coefficients: 0.5, 0.1, 0.01.
What kind of errors do you observe? (i.e. describe the physical appearance of the error terms).
Using trial and error (i.e. pick some numbers to try), how large can you reasonable take your CFL factor? Explain your reasoning. [Note: were not looking for a specific answer here, but rather your reasoning and justification].

![[Solved] MATH 281 -Workbook 1](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[Solved] MATH 281 Workbook 3](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.