1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
\section{Algorithmic thinking}\label{algorithmic-thinking}
\subsection{Learning Objectives}\label{learning-objectives}
By the end of this lesson, students will be able to:
\begin{itemize}
\tightlist
\item
Apply algorithmic thinking to solve engineering problems using
computational tools.
\item
Translate engineering problems into structured programming logic.
\item
Use software tools to implement, test, and refine engineering
solutions.
\end{itemize}
\subsection{Define the Problem}\label{define-the-problem}
Like many other classes we need to frame the problem before working it.
So before jumping straight into coding or building models, clearly
define the engineering problem.
\begin{itemize}
\tightlist
\item
\textbf{List knowns and unknowns.} What inputs are given? What outputs
are required?
\item
\textbf{Establish system constraints and assumptions.} Identify
physical laws, design requirements, and performance limits.
\item
\textbf{Clarify computational objectives.} What are you trying to
calculate, simulate, or optimize?
\end{itemize}
\subsection{Think Algorithmically}\label{think-algorithmically}
Since we are going to use computers to calculate our solution we first
need to break the problem into logical steps that a computer can follow.
\begin{itemize}
\tightlist
\item
\textbf{Define the inputs and outputs.} What variables will the
program take in, and what results will it produce?
\item
\textbf{Break the problem into sub-tasks.} Identify steps such as data
input, logic processing and output.
\item
\textbf{Outline the algorithm.} Write pseudocode or flowcharts that
describe the computational steps.
\item
\textbf{Identify patterns or formulas.} Can loops, conditionals, or
equations be used to automate parts of the solution?
\end{itemize}
\textbf{Example:} For processing stress-strain data: 1. Import data from
a file. 2. Convert force and displacement to stress and strain. 3. Plot
the stress-strain curve. 4. Identify the yield point or modulus.
\subsection{Write \& Execute the Code}\label{write-execute-the-code}
\begin{itemize}
\tightlist
\item
\textbf{Choose the right tools.} Are there libraries I can use to get
to my objective more effectively?
\item
\textbf{Write modular code.} Use functions to separate different tasks
(e.g., reading data, computing values, plotting).
\item
\textbf{Check for syntax and logic errors.} Debug line-by-line using
print statements or a debugger.
\end{itemize}
\textbf{Example:} Write a Python script that uses NumPy and Matplotlib
to load a CSV file, compute stress and strain, and generate plots.
\subsection{Test and Validate}\label{test-and-validate}
\begin{itemize}
\tightlist
\item
\textbf{Assess the feasibility of your results.} Do the values align
with expected physical behavior?
\item
\textbf{Compare against established benchmarks.} Validate solutions
using experimental data, literature values, or known theoretical
limits.
\item
\textbf{Check units and scaling.} Ensure computations are consistent
with physical meaning.
\end{itemize}
\textbf{Example:} If your plot shows stress values in the thousands when
you expect hundreds, check unit conversions in your formula.
\subsection{Case Study: Simulating a Spring-Mass
System}\label{case-study-simulating-a-spring-mass-system}
\textbf{Scenario:} Model the motion of a mass-spring-damper system using
a numerical solver.
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\textbf{Define the Problem:} Set up the differential equation from
Newton's Second Law.
\item
\textbf{Develop a Strategy:} Discretize time, apply numerical
integration (e.g., Euler or Runge-Kutta).
\item
\textbf{Execute the Code:} Write a Python function that computes
motion over time.
\item
\textbf{Test the Model:} Compare results with analytical solutions for
undamped or lightly damped systems.
\item
\textbf{Refine the Model:} Add adjustable damping and stiffness
parameters.
\item
\textbf{Troubleshoot Issues:} If the model becomes unstable, reduce
the time step or use a more accurate integrator.
\end{enumerate}
|