1. Introduction
Modern programming languages such as Python are prevalent across many science and engineering fields and are commonly used for task automation along with processing, analyzing, and visualizing data. In Albrecht’s 2021 study, GitHub, a cloud-based service that allows developers to store and manage code, was used to identify that from the 1,500 users who self-described as Chemical Engineers, sharing files in over 16,000 repositories, Python was the most popular development language (Albrecht, 2021). Similarly, The TIOBE Programming Community index is an indicator of the popularity of programming languages, with Python remaining at or near the top from 2018 up to the present (TIOBE Index for June 2023, n.d.). From an education perspective, the increasing availability of resources for teaching with Python make this an encouraging time for educators with backgrounds in science and engineering, among others, to integrate the use of basic or intermediate level programming into their courses.
Examples include the open-source textbook developed by Weiss (Weiss, 2021), which introduces programming fundamentals and provides sample coding exercises specific to an undergraduate chemistry curriculum, or the textbook by McClarren (McClarren, 2018) (not open-access), which offers a similar structure, but focuses on nuclear physics programming problems in the second half of the book. With chemical engineering in mind, open-source packages such as PyChemEngg have been created to promote programming based problem solving specific to this field (Gill, 2021), with reported examples of the integration of Python into chemical engineering laboratory experiments (Herrmann et al., 2022), synergistically with the Aspen Plus Dynamics software (Yamanee-Nolin et al., 2020), and via Jupyter Notebook (Jupyter Home Page, n.d.) (e.g., OpenChemE [Triandafilidi et al., n.d.]) or Google Colaboratory to study chemical reactor design (Sawaki et al., 2020) and various other core topics (Bascuñana et al., 2023; Boukouvala et al., 2020). Despite the existence of these types of resources, more work can be done to not only amass open-access content, with educators in mind, but also to ensure dissemination of the methods with which such resources are being used, highlighting the possibility of reusing methods and materials within and across disciplines.
More recently, with the advent of Artificial Intelligence (AI) and Large Language Models (LLMs), additional studies have been conducted on the incorporation of these tools into the course curriculum of Chemical Engineering or related disciplines. For instance, Tsai et. al. (Tsai et al., 2023) describe how Chat-GPT can be used with more structured, simpler problems both in the classroom and as an additional self-study tool. While the authors recommend the use of LLMs for code-based problems in various core Chemical Engineering courses, it was noted that students must still have a foundation understanding of both the problems being solved and the language the code is being generated in. While the study carried out in the current work presented here is prior to the widespread availability of such tools, their incorporation will be useful both for the course described here and for the use of programming in the classroom in general.
With the learners in mind, programming has been described as a cumulative and hierarchical skill, where stepwise instruction greatly builds upon itself as students progress from introductory to more advanced concepts (Hu et al., 2021). As this skill is not formally developed in core courses beyond an introductory computer science course, it was observed that Chemical Engineering (CHE) students at the University of New Brunswick (UNB) lack the confidence and motivation to apply coding to solve complex problems in upper-year courses or technical electives. While the use of programming is generally accepted and often encouraged as a method to solve problems in courses in the UNB CHE curriculum, e.g., for certain final-year, capstone design projects, it is very rarely mandated. Students often use software with built-in solvers such as Polymath (Polymath Plus: Math-Solver for Students, Scientists, and Engineers, n.d.), but these tools are limited in their functionality when approaching more advanced problems. Polymath is also not used frequently by engineers in process industries, as more sophisticated software is preferred.
In this work, a gradual, multi-stage method was used to divide the programming component of the Introduction to Nuclear Engineering course into discrete installments. In structuring the delivery of the coding portion, aspects from the flipped classroom, or inverted classroom, methodology were used, where activities traditionally conducted in the classroom are completed by the students on their own (or with peers) outside of class time (Lai & Hwang, 2016). For instance, “Background Readings” were developed as self-study guides, allowing students to be responsible for their own learning process, which was then assessed with low value “Coding Exercises” and subsequently the coding portion of Assignments. While this approach lacks the second type of activity for a flipped classroom, i.e., spending time in class reinforcing the content that was learned out-of-class (Lai & Hwang, 2016), this is a partial or hybrid flipped classroom approach, as the teaching assistant and instructor were available for one-on-one consultation and review of student generated code on an as-needed, appointment basis.
The goal of this coding addition was to introduce a diverse set of programming skills, covering many of the areas that will be useful for graduating students not only with a general CHE degree but also for those pursuing a career in the nuclear industry, where engineers frequently work on writing and editing codes and completing software quality assurance. With a strong coding component, this course positions students with a high caliber of technical knowledge in nuclear engineering fundamentals and a proficiency in programming fundamentals that can be scaled up to more advanced tasks outside of the classroom. In merging the technical content with programming, many lessons were learned and are shared here. While some of the discussion in this paper is focused on stream-specific content, the general approach presented can be applied to any individual course, particularly one that is already requiring students to draw from their fundamental undergraduate chemical engineering background to introduce a specialization.
2. Literature Review
2.1. Course Overview
Introduction to Nuclear Engineering is a technical elective, open to third- and fourth-year Chemical Engineering students (open to Civil and Mechanical Engineering students as of 2023) that is cross-listed as a graduate-level course. This is the only required course for the Nuclear Power Option in CHE at UNB. A student receives the Nuclear Power Option designation on their transcript following the completion of four technical electives in the subject area of nuclear engineering. The goal of this program option is to train students who will support safe operation of the existing nuclear reactor fleet and support evolution of nuclear power production to include small modular reactors (SMRs). More information on this program stream is available here: https://tinyurl.com/UNB-CHE.
As Introduction to Nuclear Engineering is a comprehensive introductory course, a wide breadth of material is covered. The topics include, nuclear reaction kinetics, radioactive decay and fission, nuclear interactions (neutron scattering, and absorption), and the basics of nuclear reactor physics, such as neutron diffusion and elementary reactor theory. Other topics include an overview of Generation III nuclear reactors and select advanced Generation IV nuclear reactor designs (e.g., small modular reactors, or SMRs), fuel burnup, fission product poisoning, and refuelling. Some of the limitations of using a traditional, non-computational approach to deliver this diverse course material include:
-
Repetitive calculations.
-
Limited analytical solutions for ordinary differential equations (tedious derivations).
-
Difficulty visualizing data such as the solutions to the neutron diffusion equation for different theoretical reactor core geometries.
The course is cross listed as undergraduate/graduate, with additional requirements at the graduate level, such as a major project and thus an adjusted grade distribution on the other assessments. The typical course size ranges from 15-40 students, with undergraduate students comprising ~75% of the class, with the remaining students at the graduate level. The graduate students enrolled in this course are typically completing non-research focused, course-based Master of Engineering, or MEng, degrees. Most of the undergraduate students are completing the final year of their degree programs (fourth- or fifth-year students), with < 10% of undergraduate students completing their third year of Chemical Engineering, and < 5% of the students completing their third or fourth year in the Department of Mechanical Engineering.
In developing the content to merge programming into this course, it was assumed that students had previously taken an introductory computer programming class, generally at the first-year undergraduate level from the Faculty of Computer Science. At UNB, this was traditionally (prior to 2021) taught using MATLAB but has since transitioned to Python. To incorporate coding in Introduction to Nuclear Engineering, the course uses the Python programming language. The bulk of the course consists of units covering various Python packages, with the application of the tools learned in each unit to solving problems in the main theory sections. All coding-related content used throughout the course is open access can be found in the following public GitHub repository: https://github.com/o-plz/nucleareng-course.
2.2. Programming in Nuclear Engineering
While Nuclear Engineering is a standalone engineering degree at various universities globally (e.g., Ontario Tech’s Nuclear Engineering undergraduate program is accredited by the Canadian Engineering Accreditation Board, or CEAB), select topics from this type of curriculum are often incorporated into a handful of courses in degree programs such as Chemical, Mechanical, or Materials Engineering, to list just a few. At UNB, the Nuclear Power Option is a concentration of specialization that has been offered in the Department of Chemical Engineering since 2021. In this option, fundamental chemical engineering concepts such as thermodynamics, fluid mechanics, and transport phenomena are applied more specifically to the behaviour of nuclear systems. While much of the discussion outlined here is in the context of nuclear engineering applications, the approach and programming skillset are broadly applicable to CHE and other related disciplines.
The nuclear industry uses software and codes to support execution of analytical, scientific, design, or monitoring/compliance verification tasks. With modern computing capabilities, use of these tools has risen significantly in recent years. It is increasingly emphasized that engineers have developed fundamentals and understanding in programming, even if the application of that skillset is not immediately expected to be critical to the specific job or role responsibility.
Most numerically intensive qualified codes and programs used for design, analytical, or scientific applications in the nuclear industry (CSA Standard for Quality Assurance of Analytical, Scientific and Design Computer Programs, 2016) are written in Fortran, C/C++, or sometimes a mixture. It depends upon the specific toolset’s design requirements and intended application. Even if the user of the code is not directly programming or performing software quality assurance, having a strong understanding of programming fundamentals is highly valuable.
Regardless of the exact programming language background, if a task requires use of an engineering code or software, a robust understanding of programming fundamentals supports knowing how to identify and debug code error messages, warnings, and runtime failures, or even to understand and modify input file loops and logic statements. Most importantly, if software is used to model or simulate physical theory and phenomena (e.g., reactor physics or deterministic safety analysis applications), the code output must be understood from an expected physical phenomena/behaviour standpoint and must be programmed and executed properly. When unexpected simulation results are encountered, effectively making the distinction of whether the result is physical or the result of a non-physical code response requires a balanced comprehension of the code’s physical theory, the application in which it is being used, as well as its programming and that of any supporting scripts being used to execute it.
Beyond the need for fundamentals, modern languages that have features such as object-oriented programming, e.g., C++, Python, Perl, etc., can improve engineering task execution. For example, the ease of new user introduction to the Python language allows for rapid development and deployment of modules and scripts, thus making it an effective tool for increasing the net output/efficiency of many tasks. Examples of how Python can be used in the workplace by Chemical Engineers have been published (Albrecht, 2021), and include:
-
Automated comment extraction (highlighted text excerpts, section number, page number, paragraph, and comment) from shared technical reports.
-
Process data extraction, filtering, processing, and visualization, including statistical analysis, outlier rejection, etc.
-
Automated input file generation, manipulation, data exchange between codes, and parallel execution scripts for more numerically intensive and qualified analysis toolsets.
-
Advanced data visualization such as 3-dimensional plotting.
-
Automated regression or machine learning tasks for a variety of modeling setup tasks to reduce time spent by an analyst repeating simulations to manually converge upon a desired output parameter.
3. Methods and Context
From a course and curriculum development perspective, the activities in this course were structured to bridge the divide between the introductory computer science course and subject-relevant code development. Introducing programming into the Introduction to Nuclear Engineering course allowed tedious and repetitive “hand calculations” to be scaled back, leaving time for more interesting problems.
On a practical level, engineers in the nuclear industry working on writing, editing, and completing quality assurance for codes need to know programming fundamentals. As this course is required for completing the Nuclear Power Option in Chemical Engineering at UNB, this work investigates if senior level students can be motivated to overcome hesitation to use code via coding examples that are relevant to the type of programming that will be expected of them in a post-graduate setting. Table 1 summarizes where the different programming themes were incorporated into the course theory. It should be noted that this is a 13-week course, where not all sections of the course (Table 1) were of equal length.
3.1. Course Learning Outcomes
The theory-based learning outcomes for the course were:
-
Understand interactions of radiation with matter,
-
Understand the nuclear fission process,
-
Evaluate elementary radiation and neutron interactions,
-
Understand the operation of various nuclear power reactors,
-
Understand nuclear fuel cycles and options for used fuel.
The programming-specific learning outcomes were:
-
Have solid knowledge of coding best practices,
-
Be familiar with an integrated development environment (IDE),
-
Understand different data types,
-
Work comfortably with:
-
Lists and tuples,
-
Functions and classes,
-
ODE solvers,
-
Data frames,
-
Plotting packages.
-
-
Understand basics of checking for errors and verifying code.
3.2. Software and Textbooks
All software used in this course is free and open source. This includes Python 3 and the various scientific libraries. The Eclipse integrated development environment (IDE) (Eclipse Foundation Homepage, n.d.), with the PyDev (PyDev Homepage, n.d.) plugin was selected as the programming environment. While Eclipse is better-known for its Java IDE, the clean importing of packages and easy-to-use user interface made this a logical choice for a class with limited IDE experience. As well, this was the environment that the instructor was the most familiar with, allowing for convenient software troubleshooting. Eclipse is available for Mac and Windows systems. Although the use of the Jupyter Notebooks (Bascuñana et al., 2023; Boukouvala et al., 2020; Triandafilidi et al., n.d.) is a common approach for introducing students to coding in highly technical courses (Domínguez et al., 2021; Weiss, 2021), one of the objectives of this course was to familiarize students with a full range editing environment. From the perspective of providing students with the type of training that will allow them to transition their skills to a workplace, it should be considered that tools that make it easier to create a program can also have very little resemblance with the tools used in industry (Vihavainen et al., 2014). Although there are numerous, free comparable “industry strength” programming environments available for the Python programming language, there are enough overall similarities such that experience with one IDE makes the transition to another significantly easier.
In the review of python incorporation into Chemical Engineering curricula by Boukouvala et. al. indicate that a growing number of undergraduate programs are relying on Jupyter Notebooks, particularly with tools such as Google Colab or Microsoft Azure Notebooks to avoid the need for students to install Python and Jupyter (Boukouvala et al., 2020). While this is a reasonable and conservative approach, focusing on using tools with support from on-line hosted instances of Jupyter Notebooks or using packages such as Anaconda where Python is pre-installed, the approach in this work was to teach the full range of fundamental skills, including use of an editing environment. While both Jupyter Notebooks and LLMs streamline a plug and play approach to coding, IDEs provide the ability to manage and organize projects with many coding files, superior code debugging, and better code quality optimization.
As content was assembled from multiple additional sources, including package-specific documentation (Python Homepage, n.d.), there was no mandatory textbook for the course; however, “Computational Nuclear Engineering and Radiological Science Using Python” by Ryan McClarren (McClarren, 2018) was recommended to the students. The first six chapters of this text provide a condensed introduction to many of the topics relevant to this course, including plotting with Matplotlib, working with arrays using NumPy, and using various modules from SciPy. Although similar texts with a strong focus on the fundamentals of programming in Python exist (e.g., Hill’s “Learning Scientific Programming with Python” [Hill, 2020]), these are not targeted towards a chemical engineering audience. In the context of a course in UNB’s Nuclear Power option in Chemical Engineering, McClarren’s book, the latter of which provides examples of nuclear (albeit, nuclear physics) themed problems, was identified as a good reference text.
3.3. Teaching Methodology
To accommodate the addition of a coding component, the grade distribution was modified as shown in Table 2. Two offerings of the course without a coding component (Fall 2019 and Fall 2020) are discussed as a comparison to the two offerings with a coding component (Fall 2021 and Fall 2022). For the grade breakdown with coding, the 2021 values are provided in Table 2, as some minor changes were made to the grade breakdown in 2022, which are discussed in the Results section of this paper. The assessments with coding integration are the Assignments and Coding Exercises for the undergraduate and graduate students and additionally the course project for the graduate students. There was no coding integration into the midterm or final exam.
Prior to 2019, which laid the groundwork to the formal revival of the Nuclear Power Option in the Department of Chemical Engineering in 2021, this course was provided very infrequently (previous offering was in Fall 2014).
Students were provided with Background Readings (BR) for self-study, which directly tied into Coding Exercises. These exercises were low-stakes formative assessments, requiring students to write a code to solve a slightly more difficult problem than that presented in the Background Readings. A common strategy when introducing coding to new programmers is having them first run and modify existing code created by the instructor, eventually working their way up to writing their own code (McDonald, 2021). The full worked solution to the BR was provided as part of the self-study component. The code, generated by the instructor, was available in a code user guide type format within the BR. Lastly, a coding component was added to each of the four core course assignments, which were staggered in delivery with the Coding Exercises.
A typical timeline for the delivery of each stage was two and a half weeks. Students would receive access to a Background Reading at the same time as a Coding Exercise (CE), which was due one week after release. The Assignment related to the CE would be released less than a week after the CE was submitted. Students were given 1-1.5 weeks to complete an Assignment.
3.3.1. Background Readings
The main delivery mechanism for the Background Readings (BRs) were written guides, typically less than 10 pages in length. The BRs were custom designed for this course, with some material following the content from the first few chapters on programming fundamentals from McClarren’s textbook (McClarren, 2018), but most of the material tailored specifically for this course. BRs were developed using concepts from a flipped classroom (hereafter “FC”) approach, where students are given materials for self-study, with the expectation that they will learn some concepts and practice these outside of in-class sessions. As the cycle is only somewhat completed here, with sparse optional tutorials and a recent addition of an in-class, live coding session, this approach borrows certain elements from the FC method. The use of a FC, or select concepts from this teaching style, has been well-documented in computer programming classes; however, the scope is typically much larger, with these being full-term introductory programming courses (Baldwin, 2015; Knutas et al., 2016; Tyler & Yessenbayeva, 2018).
The BRs included content such as:
-
Software and package installation guides (written and occasionally in video form),
-
Screenshots of the Eclipse IDE Workbench,
-
Links to external package documentation (e.g., from Python.org [Python Homepage, n.d.]),
-
Explanations of fundamental programming concepts,
-
Programming style suggestions,
-
Worked coding examples (excerpts of source code, and console output),
-
Brief mathematical foundational theory as relevant to the specific packages.
For instance, BR 1 served as a comprehensive introduction to downloading Python and the Eclipse IDE, configuring Eclipse for Python via the PyDev plugin, and using the different features of the Eclipse workbench, including: creating a new project, creating and editing a script in the editor, and running the script (starting and stopping a run in Eclipse). For software or package installation, walk-through screen-sharing videos were occasionally provided (~2 videos, each 15-20 min in length). Additional resources such as style guides or articles on programming best practices were also supplied (Wilson et al., 2014). Figure 1 shows the general style of one of the Background Readings (BR 2).
Care was taken to ensure that the BRs and accompanying code were clearly presented and well-organized, providing a succinct learning environment. The importance of the presentation of the material, e.g., the use of tables, figures, screenshots, etc., where there is an absence of traditional student-instructor interaction, has been noted by McCord and Jeldes (McCord & Jeldes, 2019), who used a FC approach with MATLAB in a computer science course for non-majors. For example, the introductory BR that described the install of Python and Eclipse was accompanied by a walk-through video of setting up the workspace inside the IDE. The BRs also showed various plots, particularly when tasks such as data filtering, followed by visualizing was required, such as those shown in Figure 2.
The complete Python source code files created by the instructor for each BR were also made available for the students to view and edit in the Eclipse IDE. Some of the BRs featured instructor code that the students were encouraged to duplicate, followed by making modifications, when completing the next stage of coding work (Coding Exercises). The screenshot in Figure 2 shows the incorporation of source code into a BR. The BRs were not graded, serving either as a step-by-step guide for beginners, or reference material when completing the Coding Exercises (CEs) for students who were more comfortable with programming.
3.3.2. Coding Exercises
Each CE had a 1% value toward the overall course grade. Figure 3 summarizes the main topics covered by each of the 4 CEs, along with a grouping of more fundamental programming concepts for CE 1 and CE 2 and the use of programming methods and packages likely to be relevant for future use outside of this course, i.e., in industry. While the content in the BRs is meant to remain largely the same for each iteration of this course (with minor modifications for continuous improvement), the examples in the CEs were sometimes modified to a greater extent, sometimes changing the problem entirely, particularly for CE1, which only covers very basic programming fundamentals. As the CEs were created in tandem with the final assessment stage, i.e., the coding portion of Assignments, the amount of modification to the problem in the CE often depended on the modification to the content of the subsequent Assignment. The scope of each CE, however, did not deviate from the summary in Figure 3.
Coding Exercise 1: Introduction to Python and the Eclipse IDE
Along with BR 1, Coding Exercise 1 introduced the programming fundamentals summarized in Figure 3, in addition to basic commands (e.g., print, input, etc.) and Eclipse keyboard shortcuts (e.g., toggling comments on/off). In the Fall 2021 offering, students were asked to make a list of strings that contained several elements from the periodic table and assign the list to a variable. This was repeated for a second list of adjectives. The script was then required to prompt the user to enter two numbers, one that will be used to pick a location (choose an element) from the first list and one that will be used to pick a location (choose an adjective) from the second list. The script would inform the user the valid range of numbers that could be selected. Students who were more comfortable with programming created loops that would continue to ask the user for input until a valid option was selected.
Coding Exercise 2: Branching, loops, and functions
BR 2 and CE 2 corresponded to the first theory module in the course (Table 1). In CE 2, which focused on branching and loops, and introducing functions, students were asked to create two functions. The first function must use the atomic mass number (A) and the number of protons (Z) in a nucleus as the input and returns the ratio of neutrons to protons, N/Z. The second function must use an isotope’s proton number and N/Z to determine if the nucleus is likely to be stable based on provided criteria for this ratio. The Periodictable package (Extensible Periodic Table - Basic Usage, n.d.) was optionally introduced to allow students to access chemical and some nuclear properties for elements and isotopes, including molecular weight, density, atomic number, neutron absorption cross-section, etc. The script must then run for a list of several isotopes. CE 2 remained relatively unchanged for Fall 2021 and Fall 2022, analogously to Assignment 1.
Coding Exercise 3: ODE solver and Matplotlib
In Fall 2021 and Fall 2022, CE 3 asked students to solve a radioactive decay chain problem, calculating the amount of intermediate and final daughter products produced by the decay of some initial amount of a radionuclide. The three coupled ODEs had to be solved via the solve_ivp function (Solve_ivp Documentation, n.d.) in the SciPy package. The changes in the concentration of each isotope over a period were then plotted using Matplotlib. Students were required to use multiple functions to achieve this, instead of a “free form” code approach, as was permitted in CE 1 and CE 2. The Radioactivedecay package (Radioactivedecay Overview, 2020) was also introduced. This is similar to the Periodictable package (Extensible Periodic Table - Basic Usage, n.d.) that was (optionally) introduced in CE 2 but is more relevant for radioactive isotopes. Students used the package to obtain radionuclide half-lives and the decay products. A different parent isotope species was chosen in each of the course offerings.
Coding Exercise 4: Pandas and reading/writing files
The final Coding Exercise (CE 4) required students to write a function to calculate the neutron flux for a point source reactor, given diffusion coefficient and length for a beryllium moderator material. Students then had to read a file containing data for the neutron flux for the same reactor type, but with a heavy water (D2O) moderator, where the data required cleaning up (e.g., removing zeros, missing values, obvious outliers, etc. that had been pre-populated by the instructor). A DataFrame was created for the beryllium and D2O moderator neutron flux data, and Matplotlib was used to plot the values as a function of the reactor radius. The 2021 and 2022 course offerings had the same type of problem for this CE, with minor modifications to the type of moderator (e.g., light water instead of heavy water) and the geometry of the reactor (e.g., flat plane instead of point source).
3.3.3. Assignments
Each of the course Assignments was released following at least one Coding Exercise. As these are more challenging applications of the two previous stages, students are given the option to complete Assignments in pairs, including both the coding and theory portions. Each Assignment was worth 4% of the overall course grade and the coding portion accounted for 25% of an Assignment’s value. Thus, the coding sections of all four Assignments was planned to contribute 4% to the course grade. This would result in a total of 8% (4% from CEs + 4% from Assignments) based on code development. A summary of this three-stage approach is shown in Figure 4. As described in the Results section, due to time constraints in the course, the final assignment did not have a coding component in either 2021 or 2022.
3.3.4. Graduate project
Although Introduction to Nuclear Engineering is cross listed as undergraduate and graduate, the average graduate student complement is typically ~16%. Nearly all graduate students in this course are completing a course-based master’s degree in chemical engineering. Differentiation for the graduate level students is via a project (Table 2). This typically consists of a combination of calculation-based and literature survey work, with 25% of the project’s value attributed to a coding component.
3.3.5. Evaluating coding content
It was emphasized throughout the course that while this is not a programming course, students should aim for their codes to be clear, simple, well-tested, error-free, and well-documented. Students were required to submit their source codes, where they were evaluated based on two main categories, 1) formatting and syntax clarity, and 2) performance:
Formatting and syntax clarity
-
Names chosen for variables, functions, etc. effectively convey their purpose and meaning.
-
Code layout is readable and consistent (code indentation, wrapping of long lines, etc.).
-
Comments guide user/collaborator through the code.
-
Code duplication is minimal (functions/routines used).
Code performance
-
Flow path and choices are logical, meaning it is easy for the user (or collaborator) to understand how to run your code (input data, generate the desired output, etc.).
-
The code runs without major errors.
-
The code has been tested/verified.
Initial exercises were evaluated equally (50/50 formatting/performance) between the two categories, but as students progressed through the course, more emphasis was placed on code performance, i.e., 30/70 formatting/performance. The evaluation breakdown was updated for each type of assessment that involved code development.
4. Results
4.1. Student surveys
The goal of sharing data obtained from this coding integration is not to provide significant inferences of trends from the student surveys or a statistical analysis of the academic performance. A discussion of the student survey responses is provided to show that incorporating coding, even if this occurs late in the students’ academic journey, is achievable. Student grades for several offerings prior to and after incorporating coding are presented to simply show that such an integration is possible without a substantial impact on student academic performance. Students were able to follow the materials provided and perform adequately on all coding assessments throughout the course. Although additional offerings would generate more data beyond the relatively small sample size discussed here, the broad course scope and hierarchical structure (where it is tied to an option stream as a pre-requisite) make it unlikely that significant changes will be made to how the coding is incorporated. As a result, it is not expected that learning efficacy or outcomes would be impacted in the next several offerings of the course, even with minor adjustments or optimizations.
To gauge student perspectives of the addition of programming into the Introduction to Nuclear Engineering course, they were given an anonymous survey in each of the 2021 and 2022 course offerings. From the cumulative 49 students in both years, 39 students completed the survey. Students were polled on whether their confidence in writing code in Python to solve problems throughout the course had changed relative to the start of the course, with the results summarized in Table 3.
The Fall 2021 class was asked to rate the difficulty level of two typical upper assessment levels, i.e., a Coding Exercise and the coding portion of an Assignment, using four difficulty criteria: easy, medium, difficult, or very difficult. Data for this portion of the survey are not available for the Fall 2022 class. The results from this portion of the survey are presented in Figure 5 for the two stages of assessment.
The 39 total respondents from both the 2021 (29 surveys completed) and 2022 (10 surveys completed) course offerings were asked to provide overall comments or feedback on their experience with programming in this course. A summary of the open-ended, general comment section at the end of the survey from both 2021 and 2022 is provided in Figure 6 via a “word cloud”. The replies from the 39 total surveys that were completed were manually grouped together, where possible, resulting in 12 phrases. The sizes of the phrases in Figure 6 represent the number of occurrences of that phrase, ranging from two to six occurrences.
4.2 Academic performance
The averaged performance of the students on the Coding Exercises, which were completed individually, and Assignments, which were completed (optionally) with a partner, is shown in Table 4. For comparison, the average grades for the assignments from 2019 and 2022 are also provided. As shown in Table 2, the grade value of assignments was 15% in 2019 and 2020, increasingly to 16% in 2021 and 2022 (25% of each assignment’s value associated with a coding component in the latter two years). Assignment 4 did not include a coding component in either 2021 or 2022. It should be noted that the decrease in the number of students enrolled in the course in 2022 is reflective of a proportionate decrease of student enrollment in the Department of Chemical Engineering at UNB that year.
Distribution of the grades from two course offerings prior to the introduction of coding into Introduction to Nuclear Engineering (Fall 2019 and Fall 2020) are plotted alongside the distributions for two course offerings after coding was introduced (Fall 2021 and Fall 2022) in Figure 7.
5. Discussion
5.1. Student surveys
For the portion of the poll relating to whether their confidence in writing code in Python to solve problems throughout the course had changed relative to the start of the course, roughly one third of the class indicated that they remain uncomfortable with programming, the majority communicated an increase in comfort level. For the portion asking the class to rate the difficulty level of two typical upper assessment stages, only 3.4% of students found the coding portion of both type of assessment levels “easy.” This shows that the coding content was sufficiently challenging. One of the facets of the gradual approach is not only simplifying tasks, but also highlighting their complexity, as struggling to complete the more difficult components of a task can lead to robust learning (Reiser, 2004).
Only a few students (3.4%) found the transition to the upper-most assessment stage to be “very difficult.” The data also show a decrease in perceived difficulty level from 65.5% of the class finding the CEs “difficult” to only 31% of students indicating that the coding on the Assignments was “difficult;” however, some of this shift can be attributed to roughly one third of the class electing to complete the Assignments in pairs, versus the individually completed CEs.
For the final portion of the survey, the typed comments were summarized. Students, particularly in Fall 2021, commented that while the self-study BRs were useful, there was a lack of dedicated in-class time allotted for coding. A handful of optional tutorials were offered by the course teaching assistant; however, as these were not mandatory, they were typically not well-attended. This was addressed by running a coding activity for the entirety of a class in the middle of the Fall 2022 term, simulating a tutorial format. Students were allowed to complete the activity in pairs, with both the instructor and the teaching assistant monitoring student progress. The activity featured problems that were very similar to an upcoming assignment, focusing on the use of functions to avoid repetition of code segments. Although due to the dense course content, in-class time throughout the term was generally dedicated to lectures or in-class activities on non-coding related material, the survey results support the addition of more coding time into classroom activities.
Students also frequently commented about the low grade-value, steep learning curve, and lengthy completion time, particularly for beginners, to write a script to solve a problem, mainly referencing the assignments. The grade value to the overall coding portion of the course was increased from 8% to 10% in Fall 2022, which, in combination with the in-class coding session, appears to have resolved this concern. For clarity, the contribution to the coding portion from the assignment (1% per assignment), remained the same, while the total value of the Coding Exercises increased from 4% (1% per CE) to 6% (1.5% per CE). Students found the BRs quite useful as a self-study tool and felt that the sequence of coding incorporation in the course was effective.
Finally, the free-form responses had a theme that exposure to programming, particularly this late in their academic careers, was difficult, at times leading to the conclusion that the students do not like writing code. Although this seems like a negative outcome to integrating coding into the course, other authors have written on the importance of “normalizing struggles in learning to code,” highlighting the importance of instructors conveying the message that setbacks and difficulties are a normal part of learning programming (Hu et al., 2021). Such conversations were frequent throughout this course, emphasizing that “failure” is part of the process when generating code. A few students commented that the coding portions of the course were challenging, but in a positive way.
5.2. Academic performance
As CE 1 focused more on introducing Python and the Eclipse IDE, the discussion here is targeted more on the remaining three CEs. In both the 2021 and 2022 offerings, students performed consistently across CE 2 – CE 4. When comparing the average grades for the Assignments, analogous to the CE 1, students performed well on Assignment 1 in all four course offerings. Some of this can be attributed to the nature of the course content, where a shift to more challenging content takes place for Assignment 2 and beyond. The grades for Assignments 2 and 3 do not show notable changes upon the introduction of the coding component when comparing student performance in 2019 and 2020 to that in 2021 and 2022. Interestingly, the largest change in the assignment grades can be observed for Assignment 4, which did not contain a coding component in any of the offerings. This can be attributed to the nature of the content of Assignment 4 (Reactor Statics and Dynamics from Table 1), which is conceptually more challenging. As the course progressed, there was more focus on this material via (non-coding) in-class activities.
In general, the distributions of the grades are quite similar for all four offerings, with a few notable exceptions. There were fewer students achieving final grades of A and A- in 2019 and 2020, prior to the introduction of the coding component to the course, and more students achieving grades of B and C+. The class averages (not shown in Figure 7) do not show much variation from year to year, with the letter grade ranging from a B to B+ (72-78 %) in all four years, i.e., 72 % average in each of 2019 (43 students) and 2020 (31 students), 74% average in 2021 (34 students), and a 79% average in 2022 (15 students).
As Introduction to Nuclear Engineering is focused primarily on non-coding-based fundamental concepts, the addition of coding activities to the course should provide added value to the students without negatively impacting their overall learning outcomes. While there is a risk of overwhelming students with the increased workload from the inclusion of coding content, the negligible change in both assignment and overall grades demonstrates the success of the current approach for blending coding into the course structure.
5.3. Instructor reflection
One of the main lessons learned from this work is that a structured programming component can be added to a course with one instructor and minimal teaching assistants (depending on class size). The preparation required for this type of integration may seem daunting or intimidating, particularly where examples can be found with larger teams of instructors that have contributed to the development of the coding component (Arjmandi et al., 2023; Herrmann et al., 2022). In the method described here, the type of tools developed and the way in which they were used, starting off with a self-study focus, allowed for a high degree of reusability during the second offering of the course. Designing Background Reading content for each Coding Exercise, and ensuring a direct through line to each Assignment, in addition to development of the sample code, was a large amount of upfront work. In the second course offering following the code integration, while there were some adjustments of the examples used in the BRs or movement of content from one BR to another, this was mainly an exercise in continuous improvement. As the BRs are self-study tools, effectively serving the function of modular user manuals that are not graded, they are able to remain reusable, a key facet of making an FC or FC-type approach sustainable (Urquiza-Fuentes, 2020). In a 2015 paper on flipping the classroom for a programming course, Baldwin comments that while, traditionally, materials such as readings a video lectures that are needed for self-study are developed by the instructor for each course, if such content becomes widely enough available as open educational resources, this barrier to entry to teaching coding could be greatly reduced (Baldwin, 2015).
Some experiences in programming-focused courses have shown that students were not satisfied with a FC approach for an introductory programming course without extensive pre-planning (Baldwin, 2015), and that the students had difficulty with achieving independent engagement, particularly if they had a lack of experience with self-directed study (Isomöttönen et al., 2013). The more limited scope for the use of coding in the course described in this paper allowed the BRs to be well-received by the students, allowing them to successfully complete the programming portion of the Assignments. The CEs acted as short exercises that were derived from the instructor commentary in the BRs. The assessment of the paired coding work in the Assignments allowed students to demonstrate what they had learned. Students were not responsible for self-study for most of the course, with the remaining course theory covered during class time via traditional lectures or in-class activities. McCord and Jelde, who describe a flipped class methodology for teaching MATLAB in only one half of a first-year numerical methods course for non-computer science majors (McCord & Jeldes, 2019), show that learners in a flipped classroom model had an increase in performance when compared to learners in a traditional classroom setting.
A long-term objective of this work is to further incorporate coding into UNB’s Chemical Engineering program, allowing students sufficient opportunities to build onto their existing skills. Adding coding into an individual course can act as a pilot exercise, with multiple instructors or course designers working to improve the course. A similar format can then be onboarded in multiple additional courses. This concept can also be scaled up to a standalone programming course for chemical engineers, as seen in the “Advanced Programming for Chemical Process” course, created by Santos et al (Santos et al., 2018). or the “Python for Chemical Engineering Calculations” course developed by Gor (Gor, 2022).
Some of the more practical challenges encountered while integrating coding into the Introduction to Nuclear course included:
-
Conveying the utility of a code-based approach to problem solving without larger scale projects. Smaller-form problems are less challenging; however, don’t show utility of writing a script versus doing “quick” hand calculations.
-
Errors in the submitted student codes were often not the result of improper execution nor from a lack of understanding of the required tasks, but purely due to syntax. More exercises involving the debugging of pre-written code are needed.
Students were reluctant towards the use of functions, electing for repetition. The initial learning curve of writing functions was considered more effort than re-using existing code. It should be noted that the years for which the results are reported in this work are before the more widespread use of Artificial Intelligence or Large Language Models, thus the impact or benefit of these tools was not assessed as part of this study.
6. Conclusion and Future Work
Many engineers in industry either work with existing in-house or third-party codes, contribute to code development, use programming to increase the efficiency of their everyday tasks, or are involved with software quality assurance. The research question was if a diverse set of programming skills, covering many of the areas that will be useful for graduating students interested in pursuing a career in engineering, with some of the focus specific to the nuclear industry, can be incorporated into a senior level chemical engineering course. The activities in this course were structured to bridge the divide between a first year, introductory programming course and subject-relevant code development. Based on the student feedback, the first two iterations of this approach proved to be of value to the students without being overly challenging. There was also some success with replacing the more traditional “hand-calculations,” leaving space for more interesting problems.
Asking students to adopt coding as a means of solving challenging problems for the first time in their degree program, particularly in a senior level course, has a potential danger of a lack of “buy-in.” The baseline risk of a lack of interest due to “fear of the unknown” is lower in a niche technical elective course, where the code-based approach to problem-solving is framed in the context of the subject matter that students have chosen to study. This avoided the well-known issue of programming without purpose and capitalizes on the student’s autonomy to study subject matter that is of specific interest to them. The Introduction to Nuclear Engineering course is generally the students’ first exposure to terminology and concepts in the field of nuclear science, where some of the topics are not taught in other courses within chemical engineering.
The four programming areas targeted in this course (Figure 3) were emphasized and built upon using the three stages of the structure shown in Figure 4. While this approach resulted in a strong focus on each fundamental area of programming, more links between these topics, for instance, more recurring use of the same concepts (even as specific as students re-using the structure of previously written functions) from one CE or Assignment to the next, are needed, though this is somewhat limited by the dense course content. An additional goal for future iterations of this course is to provide more differentiation for students who are already comfortable with programming; this diversity will become increasingly important as students who will be exposed to Python within the first year of the degree along with other core courses will eventually take the Introduction to Nuclear Engineering course.
Lastly, while the time period over which data were collected in this study is prior to the widespread use of AI and LLM’s, the incorporation of these into both writing coding problems from the instructor’s perspective and solving or debugging the presented problems from the learner’s perspective. Some useful recently applications of such platforms have been mentioned in the literature in this work and will be further explored within the context of future iterations of this course.
Acknowledgments
Ms. Grace Fishbein from the Atlantic Computational Excellence Network, the Atlantic Canada branch of the Digital Research Alliance of Canada, is thanked for many fruitful discussions. Ms. Cassidy Perry is thanked for coordinating the course GitHub repository materials, which can be found here: https://github.com/o-plz/nucleareng-course.