Week 1: January 24 and 26, 2024.
In-person Instruction: January 24 and 26.
Week 2: January 29 and 31. February 2, 2024.
In-person Instruction: January 29, 31, and February 2.
See, in particular, the segment (about 5 mins in) where the reviewer cooks dinner and sets a bunch of (virtual) timers above the pots on the stove.
Unpack, then look at the README.txt file.
This version contains scripts for:
Week 3: February 5, 7, and 9, 2024.
In-person Instruction: February 5 and 7.
In-person Review/Homework/Computer Assistance: February 9.
Week 4: February 12, 14, and 16, 2024.
In-person Instruction: February 12, 14 and 16.
In-person Review/Homework/Computer Assistance: February 16.
Week 5: February 19, 21 and 23, 2024
In-person Instruction: February 19, 21 and 23.
Week 6: February 26 and 28, and March 1, 2024
In-person Instruction: February 26 and 28.
In-person Review/Working Session: March 1.
Week 7: March 04, 06, and 08, 2024.
In-person Instruction: March 4 and 6.
In-person Review/Working Session: March 8.
Week 8: March 11, 13, and 15, 2024.
In-person Instruction: March 11 and 13.
Midterm I Exam: March 13.
Solutions: Midterm 1 Exam, Fall Semester 2023 (pdf).
NOTE: You have 12 hrs to complete and return the exam. Please make sure your name and e-mail are clearly written on the first page.
Open book and open notes. University rules on academic integrity apply.
Three questions covering linear matrix equations, Python programming, and linear algebra.
Instructions for Submitting Midterm I: See details on ENCE201 home page.
Week 9: March 18, 20 and 22, 2024.
Week 10: March 25, 27 and 29, 2024.
In-person Instruction: March 25 and 27.
In-person Review/Homework Assistance Session: March 29.
Points to note:
Question 1: In part 1 you need to find a rough estimate of the interval containing the smallest positive root of f(x) = x - tan(x) = 0.
A straightforward way of doing this is to plot two lines: y1(x) = x and y2(x) = tan(x), and then look for a positive value of x where the two lines intersect (i.e., just less than 3 pi / 2).
Question 5: This question is an extension of a homework problem from Fall Semester 2023.
Click here
for the problem statement and my solution at that time.
You can find the detailed implementation of PrintMatrix() in python-code.d/linear-algebra/TestPrintMatrix.py.
Notice that the code works for both vectors (i.e., one-dimensional numpy arrays)
and matrices (i.e., two-dimensional arrays in numpy).
The trickiest part of this question is getting the equations of equilibrium right,
and then inserting them into the behavior matrix at the right position without making any mistakes.
We use the notation axy to represent equation x and position y to help minimize these concerns -- still,
this approach will only work well when the number of equations is small.
One way of mitigating these challenges is to define two arrays "equilibrium" and "destination",
with the former representing individual terms in the equation of equilibrium,
and the latter capture the mapping (or destination) of these terms into the matrix A, i.e.,
# Element and destination arrays ... nonodes = 6; # <-- number of nodes in structure .... maxterms = 3; # <-- max no terms in an equation .... equilibrium = np.zeros(( 2*nonodes, maxterms )) destination = np.zeros(( 2*nonodes, maxterms )) PrintMatrix("Equilibrium", equilibrium ); PrintMatrix("Destination", destination ); # Node A ... equilibrium[0][0] = 1 # < --- equilibrium in x direction ... equilibrium[0][1] = 1/math.sqrt(2) equilibrium[0][2] = 1 destination[0][0] = 1; destination[0][1] = 4; destination[0][2] = 10;
Assembly of matrix A can now be automated, i.e.,
# Allocate memory for A matrix ... A = np.zeros(( 2*nonodes, 2*nonodes )) # Systematically assemble A matrix from equilibrium and destination arrays ... for row in range(2*nonodes): for col in range(maxterms): eitem = equilibrium[row][col]; ditem = int( destination[row][col] ); if eitem != 0 or ditem != 0: A[row][ditem-1] = eitem; PrintMatrix("A", A);
Week 11: April 1, 3 and 5, 2025.
In-person Instruction: April 1 and 3.
In-person Review/Homework Assistance Session: April 5.
Week 12: April 8, 10 and 12, 2024.
In-person Instruction: April 8 and 10.
In-person Review/Homework Assistance Session: April 12.
Week 13: April 15, 17 and 19, 2024.
In-person Instruction: April 15 and 19.
Points to note:
Question 1: Click here to download a zip file of the Python code (Version: 2024-04-22).
Points to note:
Spatial View of Motor Vehicle Accidents:
The purpose of this view is to understand where motor vehicle accidents occur?
To this end, a detailed view of the main streets in Lower Manhattan:
For details, see geopandas/TestMajorStreetsNYC.py.
A snippet of the main streets datafile is as follows:
# String representation of geometry ... --- 3: Borough --> Manhattan ... --- : Route Name --> Amsterdam Avenue ... --- : WKT Geometry --> MULTILINESTRING (( -73.98761512117859 40.77041544311091, ... )) ... --- : Route Type --> Major Streets ... --- : Route Sub --> Major Street ... --- : Route State --> Existing ... # Geometry converted to a geopandas object ... --- Main Street: --- Name ---> Amsterdam Avenue ... --- Length ---> 7562.23 meters ...
Temporal View of Motor Vehicle Accidents:
The purpose of this view is to understand when motor vehicle accidents occur?
A toy implementation of a heatmap for weekly measurements:
For details, see charts/TestHeatmap01.py.
Preliminary Results:
Spatial Distribution of Motor Vehicle Accidents:
Temporal Distribution:
Week 14: April 22, 24 and 26, 2024.
In-person Instruction: April 24 and 26.
NOTE: You have 12 hrs to complete and return the exam. Please make sure your name and e-mail are clearly written on the first page.
Open book and open notes. University rules on academic integrity apply.
Instructions for Submitting Midterm II: See details on ENCE201 home page.
Week 15: April 29. May 1 and 3, 2024.
In-person Instruction: April 29 and May 1.
In-person Review/Hands-on Laptop Session: May 3.
Week 16: May 6 and 8, 2024.
In-person Instruction: May 6 and 8.
In-person Review/Hands-on Laptop Session: May 6.
Final Exam
NOTE: You have 24 hrs to complete and return the exam.
Please make sure your name is clearly written on the first page.
Open book and open notes. University rules on academic integrity apply.
Five questions covering solution of linear matrix equations, least squares analysis,
roots of equations, and numerical integration with Trapezoid Rule, Simpson's Rule,
Gauss Quadrature and Romberg Integration.
Last Modified: March 23, 2024,
Copyright © 2024, Department of Civil and Environmental Engineering, University of Maryland.