Welcome to the GitHub repository for CEE 244: Programming for Engineers, a course offered by the Department of Civil and Environmental Engineering at UMass Amherst. This course introduces essential programming concepts and practical applications for engineers, using Python as the primary language. The course uses Google Colab as an accessible, cloud-based programming interface. While the examples and exercises are occasionally tailored to Civil Engineering contexts, the foundational programming concepts covered are broadly applicable and beneficial for all engineers.
Created for Fall 2024 Semester.
This repository contains lecture materials, code examples, and exercises designed to teach students the fundamentals of programming and its application in solving engineering problems. Each module introduces new concepts and includes practical examples and exercises.
Description:
Introduces Python syntax, basic operations, data types (integers, floats, strings, and lists), and variable usage. The module emphasizes foundational concepts necessary for programming logic and computation.
Topics:
- Arithmetic operations
- String manipulation
- Input/output operations
- Lists and basic data structures
Description:
Explores flow control statements like conditional statements (if
, else
, elif
) and loops (for
, while
) to build logic in programs.
Topics:
- Boolean operations and comparison operators
- Conditional statements
- Loop structures
- Nesting and combining conditions
Description:
Introduces modular programming through functions and object-oriented programming basics with classes. Explains code reusability and structure.
Topics:
- Defining and using functions
- Function arguments and return values
- Classes and objects
- Methods and constructors
Description:
Covers the concept of Python modules to organize code. Includes importing standard and custom modules and using library functionalities.
Topics:
- Importing and using modules
- Exploring Python Standard Library
- Creating custom modules
Description:
Focuses on data visualization and analysis using Python libraries such as matplotlib
and seaborn
. Demonstrates creating various plots and performing statistical analysis.
Topics:
- Line, scatter, and bar plots
- Histograms and distributions
- Subplots and annotations
- Introduction to
pandas
for data manipulation
Description:
Explores linear algebra concepts and their implementation using numpy
. Essential for solving engineering and scientific problems.
Topics:
- Vectors and matrices
- Matrix operations (addition, multiplication, dot product)
- Solving linear equations
Description:
Introduces symbolic computation with sympy
and numerical methods for solving mathematical problems.
Topics:
- Symbolic expressions and simplification
- Solving equations symbolically
- Numerical evaluations and approximations
Description:
Introduces basic machine learning concepts and techniques using sklearn
. Covers simple models like linear regression and explores overfitting and testing.
Topics:
- Linear regression, logistic regression, neural networks
- Training and test datasets
- Mean Squared Error (MSE) evaluation
Description:
Covers statistical simulation techniques to model uncertainty and variability in engineering systems.
Topics:
- Monte Carlo simulations
- Random number generation
- Risk and uncertainty analysis
There are some applications in the applications folder. There could be more than the ones listed here.
Simulates and animates a chaotic double pendulum system resembling a stick figure named "Freddy." This demonstration showcases the principles of chaotic motion through matplotlib animations.
Key Features:
- Models physics with parameters like gravity, pendulum lengths, and initial angles.
- Animates stick figure components (head, arms, legs) using double pendulum equations.
Learn more here.
Solves the classic Eight Queens problem using a recursive backtracking algorithm. The goal is to place eight queens on a chessboard without conflicts.
Key Features:
- Validates queen placements using row, column, and diagonal checks.
- Visualizes solutions on a chessboard with seaborn heatmaps.
Learn more here.
Interacts with an open-source language model (Llama 3.1) via a user-friendly interface. Experiment with the system and user prompts to observe changes in responses.
Key Features:
- Configure system behavior with custom prompts.
- Explore real-time interaction with an advanced language model.
More details on Llama 3.1.
Analyzes internal forces in truss structures using principles of statics. This application calculates member forces, reactions at supports, and visualizes the results.
Key Features:
- Defines nodes, edges, supports, and loads for a truss.
- Solves statically determinate trusses with equilibrium equations.
- Visualizes the structure and annotated forces.
This tool serves as an educational resource for courses in statics and structural analysis, helping students understand force distribution in truss systems.
- Clone the repository:
git clone https://github.com/your-username/CEE244-Programming-for-Engineers.git
- Navigate to the relevant module folder.
- Open the
.ipynb
files in Jupyter Notebook or Google Colab. - Follow the instructions and complete exercises provided in the notebooks. Here’s a concise version for the README:
To open notebooks directly from GitHub in Google Colab:
- Open Google Colab.
- Go to File > Open Notebook.
- Select the GitHub tab.
- Paste the GitHub URL of the notebook (e.g.,
https://github.com/egemenokte/Programming_for_Engineers/blob/main/P1_Python_Basics_Data_Types.ipynb
) and press Enter. - Click on the notebook name to open it in Colab.
Example:
To open the P1: Python Basics and Data Types notebook, paste:
https://github.com/egemenokte/Programming_for_Engineers/blob/main/P1_Python_Basics_Data_Types.ipynb
Contributions to enhance the materials or suggest improvements are welcome! Please submit a pull request or open an issue for discussion.
This project is licensed under the MIT License - see the LICENSE file for details.
This resource was created for Fall 2024 semester. Large language models were used to help with the creation of this readme file.