Latest
Loading...

Source Code

Featured Post

How To Make A Portfolio Website | CodeWithNinju

Hey guys, In this post, we will build a responsive website from start to finish using HTML 5, CSS3, and a little bit of JavaScript & Boo...

Involving Python in the Teaching of Numerical Analysis - 21mca159_Dhaval_Vaghadiya

Involving Python in the Teaching of Numerical Analysis - 21mca159_Dhaval_Vaghadiya































Abstract

In this Case Study we describe the reasoning, strategy and consequences of showing Python as a feature of a third year discretionary Numerica Analysis module taken by undergrad BSc Mathematics understudies at the University. In particular we focus on how we have used programming mini-tasks to engage and prepare students for using Python to complete a more significant piece of coursework, taken later in the course. These mini-tasks are marked electronically using the Dewis e-assessment system which provides the students with immediate and tailored feedback on their Python code.

KEYWORDS : Python, programming, e-assessment, numerical analysis.

1. Introduction

In a recent report, Bond (2018) recommended that computer programming becomes a core part of mathematics degrees. For many years, students on the BSc Mathematics course at the University. Bristol's Universities is already using the Maple (2019) computing environment as a combination of a computer algebra system and a programming language. In the first two years of the three year course, Maple was used primarily as a symbolic engine and for visualisation of solutions. A short course on computer programming was included in one of the first year modules but, for the students’ first two years of study, their use of Maple as a programming language was limited. However, in their third year, students taking the optional Numerical Analysis module were required to create and develop their own Maple programs. 

In 2018 it was decided to introduce Python into the BSc Mathematics course. There were a number of reasons that led us to this decision. Firstly, although Maple can be used as a programming environment/language, it was felt that this was not its primary function. As such, we were not exposing students to a typical programming environment. Secondly, outside of Mathematics higher education, Maple is not a widely known package and hence a student’s experience of Maple is not necessarily significant to potential employers. In addition, there is less information and support for Maple online (via GitHub for example, https://github.com/) than for other languages (RankRed, 2019). In contrast, Python has become one of the most popular programming languages (The Economist, 2018) and as with Maple, Python has capability for symbolic mathematics using the SymPy package (Meurer et al., 2017).

Having settled on the choice to bring Python into the BSc Mathematics educational program, we distinguished a reasonable pilot course to be the discretionary Level 6 Numerical Analysis module. The module's plan currently represented a few understudies' absence of trust in PC programming by apportioning part of the coursework to the culmination of smaller than expected undertakings all through the primary semester. These small scale errands furnished the understudies with layout code for them to adjust to carry out additional difficult assignments. Saving a comparative design for the little undertakings implied that understudies would have the option to will grasps with the fundamentals of Python through an exceptionally scaffolded approach. Our transition to Python likewise implied that Dewis (2012) could be utilized to electronically survey the minitasks. Dewis is a completely algorithmic open-source online e-Assessment framework which was planned and created at UWE (Gwynllyw and Henderson, 2009). The e-evaluation of PC programs had previously been utilized at UWE for various years involving the Dewis framework in a task including a coordinated effort of the Mathematics and Computer Science gatherings (Gwynllyw and Smith, 2018). In that undertaking, the e-appraisal of C-programs was performed with the Dewis framework checking both the result and the design of understudies' PC programs.

2. Methodology

2.1. Overview of the Numerical Analysis module

In this Case Study we considered the 30 credit optional module Numerical Analysis, which is available to final year students on the BSc (Hons) Mathematics course at UWE. The module covers the implementation and analysis of a number of numerical methods applied to a range of mathematical problems and is taught over the whole academic year. Each week, students attend a two hour lecture, and a one hour computing lab. Additionally, all students are timetabled to an optional one hour drop-in session for the module.

The first semester concentrates mainly on the numerical solution of initial value problems (IVPs) and covers the topics of

• Runge-Kutta (RK) and Linear Multistep methods (LMM);

• Error analysis – mostly local truncation error analysis (including adaptive time-stepping);

• Linear stability analysis.

Also in this semester students are introduced to the topic of the finite difference method applied to boundary value problems. The second semester concentrates on numerical solutions to partial differential equations.

2.2. Teaching Approach of Python

The implementation of the teaching of Python started in induction week, where all final year Mathematics students were invited to an ‘Introduction to Python’ course run by a team of academics from the mathematics group. Those final year students who had chosen the Numerical Analysis module were informed beforehand that participation at this day-long course was considered to be essential. This introduction to Python course was through the Spyder integrated development environment (IDE). This IDE was chosen due to its simplicity and shallow learning curve. Although this introductory course was not written specifically for the Numerical Analysis module, a part of the course content was motivated by the requirements of that module. The overall syllabus of this course was:

• creating and running simple scripts;

• basic commands in Python; MSOR Connections 18(2) – journals.gre.ac.uk 27

• the process of identifying and correcting bugs;

 • variables and data structures (including lists);

• loops;

• logic and conditional statements;

• creating and using user-defined functions;

• importing libraries and files.

For most students this was their first exposure to Python. However all students would have been introduced to programming basics, albeit using Maple, in their first year at UWE. 

In the Numerical Analysis module itself, the educating and practice of Python was concentrated inside the principal semester. In the subsequent semester, understudies were provided with Python code to carry out the strategies with very little coding changes expected on their part. Standard Python was utilized any place conceivable to execute and dissect mathematical strategies without including extra libraries. For executing the genuine mathematical plans (RK and LMM), as portrayed in Section 2.1, understudies were provided with three documents, as displayed in Table 1, that they were expected to adjust.



The Numerical Analysis module acquaints understudies with various parts of PC programming. For instance, all through the semester, understudies were presented to the utilization of circles, both of fixed number of cycles and, for the instance of variable time-venturing, contingent (while) circles. Straight soundness examination practices expected understudies to decide dramatic development/rot and subsequently, in delivering graphical result, they needed to consider the utilization of log scales. Understudies were expected to utilize complex factors in their calculation of straight strength edge values (for example having communicated a coupled arrangement of genuine esteemed starting worth issues as a couple of decoupled, perhaps complexvalued, beginning worth issues). To carry out the mathematical strategies, understudies should have been capable in the utilization of clusters (records). This elaborate the instance of static exhibits (fixed known length commonly for the instance of fixed time steps) and dynamic clusters (normally for the instance of variable timestep strategies) and to perceive contrasts in their control. Along with the utilization of clusters (records), understudies are presented to the utilization of rundown cognizance (developing exhibits in a succinct way in one articulation joining circles and restrictive explanations). In the inclusion of limit esteem issues, understudies needed to recognize the portrayal of a lattice by a rundown of records. In expansion they were acquainted with capacities from the 'numpy.linalg' library for settling a direct framework. We ought to take note of that the Numerical Analysis module was not expected to address a completely far reaching seminar on programming, yet rather the significant fundamental programming abilities applicable for mathematical investigation. New ideas were acquainted when significant with the material being covered.

2.3. Assessment overview

The assessment in this module is composed of an end-of-year exam (75% of the module mark) and a coursework (25% of the module mark). The coursework is partitioned into two parts as follows: Part One: worth 20% of the coursework mark takes the form of four mini-programming tasks and has four staggered deadline dates throughout the first semester. The main aims of these mini-tasks are to • encourage student engagement with the programming throughout the first semester; • prepare students for the more significant programming task in Part Two of the coursework. Part Two: worth 80% of the coursework mark is a hybrid written report/programming coursework with a mid-February deadline. Most of this coursework involves a given mathematical problem (typically in the form of coupled IVPs) and a given numerical method. Students are required to construct the numerical method in a form suitable to the problem. They are required to perform both theoretical and empirical analysis of the results. This analysis may include stability and/or local truncation error (LTE) considerations and require the students to comment on unusual behaviours in their results.

2.4. e-Assessment of Python

Given the fundamental motivations of Part One of the coursework (commitment and readiness) we felt it was fundamental that the stamping and criticism for each of the four little errands to be just about as quick and strong as conceivable (Race, 2014). We had utilized this parceling of the coursework model for various years (utilizing Maple). Already a manual checking process was utilized however the responsibility in question in handling these understudy entries, brought about hardships in delivering opportune input. In the change from Maple to Python, it was chosen to execute quick electronic checking and criticism of the Part One small undertakings to resolve the above issue. The past organization of Dewis to e-evaluate PC code in C (Gwynllyw and Smith, 2018) implied that the improvement time expected for Dewis to e-evaluate Python was fundamentally decreased. The vast majority of, truth be told the Dewis code for checking C projects is no different for Python. Vital changes to the code incorporated the execution of another arrangement of 'prohibited catchphrases' for Python, or at least, watchwords in the understudy's accommodation that were not considered security reasons. With Python being a deciphered language, instead of C being a gathered language, there were different changes expected to guarantee that memory and CPU limiters were applied to any execution of the understudy's code on the Dewis server. It ought to be expressed here that any such execution is made in a sandbox climate on the Dewis server to shield the server from malevolent assault.

3. Results

With Part One of the coursework, understudies were emphatically prescribed to involve the week by week drop-in meeting to talk about any issues they had with their entries. The aim of this piece of the coursework was to support interest and conversation. Whenever during which these minitasks were open, understudies could get to their Dewis input which incorporated a connection to recover their MSOR Connections 18(2) - journals.gre.ac.uk 31 submitted code. This worked with the criticism cycle with understudies utilizing this component to talk about their code accommodation with the scholarly working. Toward the finish of the set-up of Part One small scale assignments, we researched every one of the situations where understudies' code was in blunder, to decide if the input they got was fitting to their accommodation. This was viewed as the situation. Likewise, we perceived further potential roads for improving criticism which is to be carried out in later years. Further increases to the small scale assignments are arranged in view of our involvement with checking Part Two of the coursework. For instance, from denoting the 2019/2020 coursework, obviously understudies battle to execute a LTE assessor based on Richardson's extrapolation. Subsequently we intend to incorporate an extra small scale task for acquiring LTE assessors. Our experience of normal understudy mistakes in the coding of LTE assessors will be utilized in the plan of this undertaking's stamping and input instruments.

4.   Discussion

Following the successful introduction of Python into the NumericalAnalysis course, it was decided to teach Python, instead of Maple, to our first year Mathematics students in the 2019/20 academic year. Python was taught within an existing Calculus and Numerical Methods course and students attended a two hour computer practical class every week for the first semester. The aim of the course was to learn Python while performing mathematical investigations. Students were introduced to the SymPy, NumPy and Matplotlib libraries which provide extra commands for symbolic and numerica calculations and plotting. Towards the end of the course programming concepts were introduced such as functions, conditional statements and loops.

Python has been used for the two most recent runs of the Numerical Analysis module. For both runs, the final year students have had extensive exposure to Maple at previous levels, but neither have benefitted from our newly introduced Python teaching in the first year. Hence, it is encouraging to note that we have not detected any decrease in student performance nor understanding in programming when compared with previous years’ module runs (when Maple was used). This is evidenced by average coursework marks and pass rates for this module being at similar levels to previous years. Student feedback from end of year module evaluations shows that the use of Python has been very positive; students recognise the importance of learning a programming language that is relevant to industry. Students have also stated that they appreciate the Dewis-generated feedback augmented by tutor support in the drop-in sessions.

Having introduced Python in the first year of the BSc Mathematics course the students will develop their skills further through its implementation in second year modules from the 2020/21 academic year. Further, the teaching of Python is embedded into our new problem based learning curriculum which will roll out from 2020/21 onwards; Dewis mini tasks will be used to support students learn Python in their first year, which will enable more challenging tasks to be set throughout the rest of their studies.

5. Reference

Learning with Python 1st Edition, Kindle Edition

by Chris Meyers Allen Downey, Jeffrey Elkner (Author) - Visit Now To Buy Book

Python for Everybody: Exploring Data in Python 3

by Dr. Charles Russell Severance (Author) - Visit Now To Buy Book 


No comments:

Post a Comment