Modern applied mathematics modelling cannot be complete without numerical simulations. Here you will learn the basics of performing these simulations efficiently and reliably. In many cases numerical models put high pressure on both software and hardware. Therefore it is important to be able to utilize the strengths of both to a maximum extent.
You will find the official syllabus on the course USOSweb page.
The final grade will be a weighted mean of the mid-term exam (May 12th) with weight 1/3 and of the final exam (TBA) with weight 2/3. You need to earn 50% of the total to pass. Both mid-term and the final exam will consist of several scientific computation problems to be solved a vista in the computer lab.
Each week you will be assigned some homework during the classes (only a short reminder will be posted online). Please do it, and in case of difficulties turn to my office for discussion. You will not get any extra points for your homework done but the experience says that those who do homeworks routinely score much better at the exam...
A*B
fsolve
. Stopping criteria and computing the condition number (see TEXTBOOK, the beginning of Chapter 7.6). Chandrasekar equation solver: avoiding loops, precomputing, using global variables. Timing your code. See also: TEXTBOOK, Example 7.6.2.
Homework: time our Chandrasekhar solver with fsolve
nonlinear solver and verify if the depenedence is N3. Experiment with various values of c and derive the dependence of the cost on c.
glpk
, qp
, sqp
. Fitting reaction parameters or why should we care for more than computational effort only. Which of best fits is the best? Homework: time our Chandrasekhar solver with fsolve
nonlinear solver vs. our implementation of the Newton's method. Experiment with various values of k. Extra homework: time both solvers in both MATLAB and Octave and judge if JIT compiler helps.Homework: compute condition numbers of all least squares problems we solved. How would you assess the conditioning of the nonlinear least squares fitting?
lsode
(MATLAB has different functions and slightly different syntax, but also a very good manual to start with, if you have to). Tuning ODE solver's working parameters and why this is more art than science. Van der Pol equation: solution and visualization. Homework: Examine very long time behaviour of the norm of the solution to Van der Pol equation, i.e. |y(t)|2+|y'(t)|2. What happens when epsilon=0? Aren't you surprised? How can you verify if you obtain correct results? Extra homework: write your own function odesolve
with uniform syntax that wil work equally well in both MATLAB and Octave (so that the user will get an ODE solver which is compatible with both environments). Depending on whether it was called within Octave or MATLAB, odesolve
will use an appropriate solver (lsode
in Octave). Ensure the user can always pass as the right hand side a function of the form F(t,Y) - both in Octave and in MATLAB. Think about a consistent set of options to tune the behaviour of the underlying solver(s) without additional knowledge of internal details of odesolve
.\
) or iterative methods (pcg
, pcr
, gmres
)? Preconditioning. 1D laplacian as a sparse matrix. Creating 2D Laplacian on uniform mesh using kron
. Homework: read, how to implement nonzero boundary conditions to our diffusion equation solver.
plot
, semilogy
, mesh
, contour
, etc.) Graph annotation. Why ill-designed plots can hurt you. More on plotting: TEXTBOOK, Chapter 6. Finite difference scheme for diffusion equation: 2D case with constant diffusion. Caution: there are much more efficient ways to solve diffusion equation. (They, however, require additional knowledge we cannot afford). Implementation and visualization in Octave (2D case). Implement 3D diffusion as described and check experimentally how large problems you can solve on your computer. Compare with 2D case. Extra homework: read the rest of the diffusion equation chapter and learn how we can significantly improve the performance of our solvers in both 2D and 3D as well!For Octave, Paul Nissenson from UC Irvine, has created a series of Octave tutorial videos, all to be watched on YouTube. Enjoy!
You can follow many online videos which cover various usages of MATLAB and come directly from the MathWorks, the producer of MATLAB. Many of them are still free to view. I recommend you to start with:
You can find even more videos on MATLAB YouTube channel. You can find more links to demos, books and tutorials on Mathworks' web page with learning resources.