Mandatory assignment due 13 November - 2024

2. Mandatory assignment due 13 November - 2024#

  • Please organize you project in a fork of the repository at: MATMEK-4270/mandatory2. You should start by changing the badge in the README to reflect your own work.

  • Collaboration/discussion among students is encouraged, but each student need an individual fork of the repository.

  • You need a green badge in order to pass the mandatory assignment.

This mandatory assignment is probably mostly about reading and understanding code. The assignment’s repository contains one single Python module galerkin.py of approximately 400 lines of code plus some tests. In these lines the module implements a software framework for the Galerkin method that can be used both for function approximation and for solving ordinary differential equations (of order up to 2). The framework is very similar to shenfun, but highly simplified since it only works for one-dimensional ordinary differential equations of order less than or equal to two. The framework is also quite similar to the finite element framework FEniCS. You will find a lot of the implemented methods have a direct analogy in both frameworks. For example, evaluate_basis_function, has an analog method called evaluate_basis both in FEniCS and shenfun. There are also analog methods to evaluate_basis_all and evaluate_derivative_basis_function in both the frameworks.

The implemented framework in galerkin.py is meant to illustrate that the Galerkin method is a highly structured method, where everything falls out of choosing basis functions. Most of the framework is in place, but you need to fill in some of the methods in order for all the tests to pass. The intention is that you need to read and understand the code in order to add the correct methods. You do not need to add more methods than those that are already missing (raise NotImplementedError), but it does not hurt either.

The assignment is passed when the badge turns green. Good luck:-)