0% found this document useful (0 votes)
72 views2 pages

Mathematical Python Teaching Plan

Uploaded by

Sami Akhtar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views2 pages

Mathematical Python Teaching Plan

Uploaded by

Sami Akhtar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Department of Mathematics, University of Delhi

Teaching Plan: DSE courses for B.A. (Prog.) /[Link]. (Physical Sc.) with
Mathematics, and Generic Electives, Semester-5
DSE-1(iii)/DSE-3(ii)/GE-5(ii): Mathematical Python
Weeks 1 and 2: Review of Python fundamentals; Drawing diverse shapes using code and Turtle.
[2]: Chapter 1 (Review: Fundamentals of Python).
[1]: Chapters 1 to 3.

Weeks 3 and 4: Using matplotlib and NumPy for data organization, Structuring and plotting lines, bars,
markers, contours and fields, managing subplots and axes; Pyplot and subplots.
[3]: Chapter 2 (up to page 45).
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]
• [Link]

Week 5: Animations of decay, Bayes, Random walk.


[3]: Chapter 5 (Generating random numbers, pages 134 to 139; page 136 is optional).
• [Link]
• [Link]
• [Link]
• [Link]

Week 6: NumPy for scalars and linear algebra on n-dimensional arrays; Computing eigenspace.
[2]: Chapter 4 (pages 226 to 229).
• [Link]
• [Link]

Week 7: Solving dynamical systems on coupled ordinary differential equations, Functional programming
update fundamentals using NumPy.
• [Link]
• [Link]
• [Link]

Weeks 8 and 9: Symbolic computation and SymPy: Differentiation and integration of functions, Limits.
[3]: Chapter 4 (up to page 96), and Chapter 7.
• [Link]
• [Link]

Week 10: Solution of ordinary differential equations, Computation of eigenvalues, Solution of expressions
at multiple points (lambdify).
• [Link]
• [Link]
• [Link]

Page | 11
Department of Mathematics, University of Delhi

Week 11: Simplification of expressions, Factorization, Collecting and canceling terms, Partial fraction
decomposition, Trigonometric simplification, Exponential and logarithms, Series expansion and finite
differences, Solvers, Recursive equations.
[3]: Chapter 4
[2]: Chapter 5.
[1]: Chapter 6, and 10.
• [Link]

Weeks 12 and 13: Pretty printing using SymPy; Pandas API for IO tools: interfacing Python with text/csv,
HTML, LaTeX, XML, MSExcel, OpenDocument, and other such formats.
[3]: Chapter 4 (pages 97-100).
• [Link]
[2]: Chapter 2 (pages 73-83).
• [Link]

Week 14 and 15: PyLaTeX and writing document files from Python with auto-computed values, Plots and
visualizations.
• [Link]
• [Link]
• [Link]

Essential Readings
1. Farrell, Peter (2019). Math Adventures with Python. No Starch Press. ISBN Number: 978- 1-59327-867-0.
2. Farrell, Peter et al. (2020). The Statistics and Calculus with Python Workshop. Packet Publishing Ltd.
ISBN: 978-1-80020-976-3.
3. Saha, Amit (2015). Doing Math with Python. No Starch Press. ISBN: 978-1-59327-640-9

Computer Lab work:


Weeks 1 to 4:
• Spyder Environment preparation with download, installation of required components.
• Implementation of turtle draw for polygonal shapes.
• Using lists and loops for common functions.
• List manipulation.
• Animating objects.
• Interactive grid.
• Drawing complex patterns.

Week 5: Animated plots for solution of problems: decay function w. r. t. time, conditional probability and
bayes rule, random walk.
Week 6: Solution of linear algebra problems: Systems of equations, eigenvalues and eigenvectors.
Week 7: Newton’s law of cooling, Coupled ODEs with initial conditions.
Weeks 8 and 9: Examples of limits, differentiation and integration of functions.
Weeks 10 to 15: Examples from text references, and similar to those from online sources.

Page | 12

Common questions

Powered by AI

Using Python's Turtle module to draw diverse shapes allows students to gain a visual understanding of programming concepts. It reinforces fundamental skills such as loops, conditionals, and function definitions in a creative and engaging way. By visualizing the outcomes of their code, learners can better grasp abstract concepts, such as geometry and algorithmic thinking, making foundational concepts more tangible and relatable .

Matplotlib is a powerful tool in Python for structuring data and creating visually compelling graphs and charts. It offers a comprehensive set of features for plotting a wide variety of data forms, including lines, bars, and scatter plots. By using Pyplot and subplots, users can manage multiple visualizations on a single canvas, facilitating the comparison of data sets. This tool enhances the ability to identify trends and patterns within data, making it indispensable for analysis in data science and engineering disciplines .

SymPy's symbolic calculus operations have significantly impacted mathematical computation by enabling exact analytical manipulation of calculus problems. Unlike numerical methods which approximate solutions, SymPy derives precise expressions for derivatives, integrals, and limits. This precision is crucial in avoiding accumulation of numeric errors, providing an exact mathematical framework for both theoretical research and practical applications. Ultimately, it improves the accuracy and trustworthiness of computational results in scientific computations .

PyLaTeX offers significant benefits for integrating Python-generated outputs into LaTeX documents. It provides automated ways to include data visualizations, numerical computations, and dynamically generated content, enhancing productivity by reducing manual intervention. This capability supports the seamless creation of documents for academic publications or reports that require consistent and professional formatting. PyLaTeX ensures accuracy and maintains the aesthetic quality of LaTeX without forgoing the computational power of Python .

Animations in Python are valuable for visualizing complex mathematical concepts like decay functions and random walks, as they dynamically illustrate changes over time. This approach aids in comprehending particle movement in stochastic processes and exponential decay in a more intuitive manner, providing a temporal dimension that static graphs cannot convey. Using Matplotlib's animation capabilities, educators can offer students a more engaging and understandable presentation of abstract phenomena .

SymPy's symbolic computation capabilities are highly effective in solving ordinary differential equations (ODEs). By representing variables and functions symbolically, SymPy can manipulate differential equations, allowing for analytic solutions. It provides functions for specifying initial conditions and applying boundary conditions, simplifying the process of finding particular solutions to ODEs. This symbolic manipulation reduces errors and enhances the understanding of the underlying mathematical structures .

Lambdify in SymPy is advantageous for converting SymPy expressions into functions that can be evaluated quickly at multiple points. This is especially useful for numerical computations, allowing for the efficient execution of symbolic expressions with real or complex numbers by compiling the expression into a form that is executed using NumPy, SciPy, or even built-in Python functions. This optimizes performance when handling large datasets or complex mathematical models .

Matrices and eigenvalues are fundamental in analyzing dynamical systems modeled by ODEs because they help simplify the system's behavior. In a linear dynamical system, the system of ODEs can be represented in matrix form, with solutions linked to the matrix's eigenvalues and eigenvectors. The eigenvalues provide information about the system's stability and response characteristics, while eigenvectors outline possible directions of system behavior. Analyzing these properties enables researchers to predict long-term behavior and control oscillations or growth in the system .

Eigenvalues play a crucial role in solving systems of linear equations, as they are involved in decomposing a matrix into its constituent form. Using NumPy's linear algebra capabilities, we can compute eigenvalues and eigenvectors to understand the transformation properties of matrices. This process helps in diagonalizing matrices and solving related linear algebra problems, enabling a more efficient computational approach, particularly for large datasets .

Integrating functional programming principles in Python involves using functions as first-class citizens, facilitating the modularization of code and enhanced reusability. When solving systems of differential equations, applying these principles allows for cleaner and more organized code. For instance, by using functions to represent differential operators and transformations, Python developers can leverage NumPy for efficient computation. This paradigm also supports the use of higher-order functions, such as map and filter, to process collections of data points or results from differential systems .

You might also like