summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kolset <christian.kolset@gmail.com>2025-04-28 11:39:06 -0600
committerChristian Kolset <christian.kolset@gmail.com>2025-04-28 11:39:06 -0600
commit8216a16d78d7aff5bc5a1607694ec3ea24eef64f (patch)
tree97d8f443f6d4abd103a7dcd667cf03d7eba58c3a
parentbfbc5c2cd290336b0432dc2a761370ba36aed76c (diff)
Updated tex files and pdf
-rw-r--r--README.md2
-rw-r--r--book/computingME.pdfbin3596141 -> 3597869 bytes
-rw-r--r--book/module1/array.tex18
-rw-r--r--book/module1/jupyter_lab_notebook.tex103
4 files changed, 77 insertions, 46 deletions
diff --git a/README.md b/README.md
index d6638ca..27ba849 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
- 21# ComputingME
+# ComputingME
Development repository for MECH 305 - Computing for Mechanical Engineers
## Administive
diff --git a/book/computingME.pdf b/book/computingME.pdf
index 03e0722..fcfddc1 100644
--- a/book/computingME.pdf
+++ b/book/computingME.pdf
Binary files differ
diff --git a/book/module1/array.tex b/book/module1/array.tex
index c9fc302..c79c6c0 100644
--- a/book/module1/array.tex
+++ b/book/module1/array.tex
@@ -220,17 +220,17 @@ arrays - Concatenation: \texttt{np.concatenate((arr1,\ arr2),\ axis=0)}
Let's solve a statics problem given the following problem
-A simply supported bridge of length L=20L = 20L=20 m is subjected to
-three point loads:
+A simply supported bridge of length L = 20 m is subjected to three point
+loads:
\begin{itemize}
\tightlist
\item
- \(P1=10P_1 = 10P1​=10 kN\) at \(x=5x = 5x=5 m\)
+ \(P_1 = 10 kN\) at \(x = 5 m\)
\item
- \(P2=15P_2 = 15P2​=15 kN\) at \(x=10x = 10x=10 m\)
+ \(P_2 = 15 kN\) at \(x = 10 m\)
\item
- \(P3=20P_3 = 20P3​=20 kN\) at \(x=15x = 15x=15 m\)
+ \(P_3 = 20 kN\) at \(x = 15 m\)
\end{itemize}
The bridge is supported by two reaction forces at points AAA (left
@@ -245,13 +245,13 @@ point must be zero.
\tightlist
\item
\textbf{Sum of Forces in the Vertical Direction}:
- \(RA+RB−P1−P2−P3=0R_A + R_B - P_1 - P_2 - P_3 = 0RA​+RB​−P1​−P2​−P3​=0\)
+ \(R_A + R_B - P_1 - P_2 - P_3 = 0\)
\item
\textbf{Sum of Moments About Point A}:
- \(5P1+10P2+15P3−20RB=05 P_1 + 10 P_2 + 15 P_3 - 20 R_B = 05P1​+10P2​+15P3​−20RB​=0\)
+ \(5 P_1 + 10 P_2 + 15 P_3 - 20 R_B = 0\)
\item
\textbf{Sum of Moments About Point B}:
- \(20RA−15P3−10P2−5P1=020 R_A - 15 P_3 - 10 P_2 - 5 P_1 = 020RA​−15P3​−10P2​−5P1​=0\)
+ \(20 R_A - 15 P_3 - 10 P_2 - 5 P_1 = 0\)
\end{enumerate}
\subparagraph{System of Equations:}\label{system-of-equations}
@@ -260,8 +260,6 @@ point must be zero.
\begin{cases} R_A + R_B - 10 - 15 - 20 = 0 \\ 5(10) + 10(15) + 15(20) - 20 R_B = 0 \\ 20 R_A - 5(10) - 10(15) - 15(20) = 0 \end{cases}
-⎩
-
\subsubsection{Solution}\label{solution}
\begin{Shaded}
diff --git a/book/module1/jupyter_lab_notebook.tex b/book/module1/jupyter_lab_notebook.tex
index 9688bea..5c06f5d 100644
--- a/book/module1/jupyter_lab_notebook.tex
+++ b/book/module1/jupyter_lab_notebook.tex
@@ -14,17 +14,10 @@ and system console}
\subsection{Setup and Installation}\label{setup-and-installation}
-Installing with Conda using CLI: - \texttt{conda\ install\ jupyter}
-Jupyter can also be installed using a Anaconda Navigator
-
-\begin{verbatim}
-- Launching:
- - From terminal: `jupyter notebook` or `jupyter lab`
- - From Anaconda Navigator or VSCode
-- Navigating the interface:
- - Tabs and file browser
- - Kernel and terminals
-\end{verbatim}
+Jupyter Notebooks can be installed either from the Anaconda Navigator
+home page or directly from your Conda terminal.
+
+Terminal: \texttt{conda\ install\ conda-forge::jupyterlab}
\subsection{Notebook Basics}\label{notebook-basics}
@@ -54,6 +47,68 @@ Jupyter can also be installed using a Anaconda Navigator
Saving and auto-checkpoints
\end{itemize}
+Jupyter Notebooks are files which allows you to combine \emph{Code} and
+\emph{Markdown} cells in one single document. The code cells, allow you
+to interactively run python code and print and plot data in your
+document. If you wish to update or change data your code you can re-run
+the cell to update the output. The markdown cells allows you to write
+text, titles and insert images in your documentation using the markup
+language \emph{Markdown}.
+
+To start a new notebook select
+\texttt{File\ \textgreater{}\ New\ \textgreater{}\ Notebook} or right
+click the file browser and select \texttt{New\ notebook}, this will
+prompt you to select a kernel (the Jupyter notebook ``engine''). For
+now, just select the default Kernel 3. This will start a new fresh
+kernel for us to use. Next, it's recommended to rename the file.
+
+Now that we have a blank notebook we can start to add cells. Add a cell
+and change the type to Markdown. Add a title with the hash symbol
+(\texttt{\#}). As shown below.
+
+\begin{Shaded}
+\begin{Highlighting}[]
+\FunctionTok{\# Title here}
+\end{Highlighting}
+\end{Shaded}
+
+Press \texttt{Shift\ +\ Enter} to run the cell. You just entered created
+your first markdown cell. Now let's do the same but instead select code
+as the cell type, we're going to add some python code to the document.
+
+\begin{Shaded}
+\begin{Highlighting}[]
+\NormalTok{x }\OperatorTok{=} \DecValTok{4}
+\NormalTok{y }\OperatorTok{=} \DecValTok{3}
+
+\NormalTok{x}\OperatorTok{**}\DecValTok{2}\OperatorTok{+}\DecValTok{2}\OperatorTok{*}\NormalTok{y}
+\end{Highlighting}
+\end{Shaded}
+
+Again, run the cell and see what happens. You should've gotten an output
+of \texttt{22}. You can now use the notebook as a calculator, but there
+is so much more we can do.
+
+The order of running code matters. Think of the code cells as code
+snippets. Every time you run a cell variable will be updated. This means
+that the current state of all variables, functions, and imports depends
+on the history of what cells have been executed and in what order. In
+other words, if you run a later cell before running an earlier one that
+defines a variable or function it needs, you will get an error. If you
+change a variable in one cell and rerun it, that new value immediately
+affects the results of any cells that use that variable afterward ---
+but not any previously run results unless you rerun them too. Variables
+and imports persist in memory between cells, but only based on the
+current session state --- if you restart the kernel, you lose all
+previous definitions unless you re-run the necessary cells.
+
+Because of this, it's best practice to; Run cells in order, restart the
+kernel and run all cells
+(\texttt{Kernel\ -\textgreater{}\ Restart\ \&\ Run\ All}) to make sure
+everything works cleanly and predictably and lastly, initialize
+important variables or imports in early cells, so they are always
+defined before they are needed.
+
\subsection{Writing and Running Code}\label{writing-and-running-code}
\begin{itemize}
@@ -115,29 +170,10 @@ Example using interact:
\end{Highlighting}
\end{Shaded}
-\subsection{Productivity Tips}\label{productivity-tips}
-
-Here are some keyboard shortcuts to improve your productivity when
-writing in notebooks.
-
-\begin{longtable}[]{@{}ll@{}}
-\toprule\noalign{}
-Key & Action \\
-\midrule\noalign{}
-\endhead
-\bottomrule\noalign{}
-\endlastfoot
-A & insert cell above \\
-B & insert cell below \\
-M & switch to Markdown \\
-Y & switch to code \\
-\end{longtable}
-
-Magic commands: - \texttt{\%timeit}, \texttt{\%matplotlib\ inline},
-\texttt{\%\%bash} Splitting and merging cells Auto-save behavior
-
\subsection{Exporting and Sharing}\label{exporting-and-sharing}
+By default, jupyter auto-saves your notebooks as you work.
+
\begin{itemize}
\tightlist
\item
@@ -154,7 +190,4 @@ Magic commands: - \texttt{\%timeit}, \texttt{\%matplotlib\ inline},
\item
Markdown
\end{itemize}
-\item
- Notebooks can be saved and shared via the following services: - GitHub
- - nbviewer.org - mybinder.org - JupyterHub
\end{itemize}