Skip to content

Commit

Permalink
updated book for Python
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleniemeyer committed Dec 22, 2022
1 parent 66a9ef0 commit bf56ffe
Show file tree
Hide file tree
Showing 225 changed files with 3,178 additions and 53,045 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/deploy-book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: deploy-book

# Only run this when the main branch changes
on:
push:
branches:
- main

# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# Install dependencies
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Setup Miniconda
uses: conda-incubator/[email protected]
with:
environment-file: environment.yml
activate-environment: thermo-env
python-version: 3.9
auto-activate-base: false

# Build the book
- name: Build the book
shell: bash -l {0}
run: |
jupyter-book build book
# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/_build/html
5 changes: 0 additions & 5 deletions apt.txt

This file was deleted.

18 changes: 16 additions & 2 deletions book/_config.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
# Book settings
title: Mechanical Engineering Methods notes
title: Mechanical Engineering Methods
author: Kyle Niemeyer
#logo: logo.jpg

exclude_patterns: [_build, Thumbs.db, .DS_Store, "**.ipynb_checkpoints", LICENSE.md]

description: >- # this means to ignore newlines until "baseurl:"
This is a collection of notes for mechanical engineering numerical methods.
execute_notebooks: auto

execute:
timeout: 160

latex:
latex_documents:
targetname: book.tex
latex_engine: xelatex

bibtex_bibfiles:
- references.bib

sphinx:
config:
html_show_copyright: false
mathjax_config:
bibtex_reference_style: author_year
mathjax3_config:
TeX:
Macros:
vector: ["\\vec{#1}", 1]
Expand Down Expand Up @@ -42,11 +54,13 @@ parse:
repository:
url: https://github.com/kyleniemeyer/ME373-book
branch: master
path_to_book: "book"

html:
baseurl: https://kyleniemeyer.github.io/ME373-book
use_edit_page_button: true
use_repository_button: true
use_issues_button: true
extra_navbar: Powered by <a href="https://jupyterbook.org">Jupyter Book</a>
extra_footer: |
<p xmlns:dct="http://purl.org/dc/terms/" xmlns:cc="http://creativecommons.org/ns#" class="license-text"><a rel="cc:attributionURL" property="dct:title" href="https://github.com/kyleniemeyer/ME373-book">Mechanical Engineering Methods notes</a> by <span property="cc:attributionName">Kyle Niemeyer</span> is licensed under <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0">CC BY-SA 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" /><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" /><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/sa.svg?ref=chooser-v1" /></a></p>
1 change: 1 addition & 0 deletions book/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ parts:
- url: https://github.com/kyleniemeyer/ME373-book
title: GitHub repository
- file: content/contributing
- file: content/zbibliography
Empty file removed book/content/LICENSE.md
Empty file.
7 changes: 0 additions & 7 deletions book/content/bvps/blasius_rhs.m

This file was deleted.

431 changes: 238 additions & 193 deletions book/content/bvps/eigenvalue.ipynb

Large diffs are not rendered by default.

427 changes: 228 additions & 199 deletions book/content/bvps/finite-difference.ipynb

Large diffs are not rendered by default.

13 changes: 0 additions & 13 deletions book/content/bvps/masses.m

This file was deleted.

357 changes: 167 additions & 190 deletions book/content/bvps/shooting-method.ipynb

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions book/content/bvps/shooting_rhs.m

This file was deleted.

29 changes: 14 additions & 15 deletions book/content/installing-jupyter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,21 @@
"metadata": {
"file_extension": ".py",
"kernelspec": {
"display_name": "Matlab",
"language": "matlab",
"name": "matlab"
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": "octave",
"file_extension": ".m",
"help_links": [
{
"text": "MetaKernel Magics",
"url": "https://metakernel.readthedocs.io/en/latest/source/README.html"
}
],
"mimetype": "text/x-octave",
"name": "matlab",
"version": "0.16.7"
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.2"
},
"mimetype": "text/x-python",
"name": "python",
Expand All @@ -111,5 +110,5 @@
"version": 3
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
15 changes: 13 additions & 2 deletions book/content/intro.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Introduction
# Mechanical Engineering Methods

This website is an interactive [Jupyter Book](https://jupyterbook.org/intro.html) for ME 373, Mechanical Engineering Methods, taught at Oregon State University.
**By [Kyle Niemeyer](https://niemeyer-research-group.github.io)**

This ebook contain material and example problems in numerical methods for engineering, in the format of Jupyter notebooks, developed to supplement the course ME 373, Mechanical Engineering Methods, taught in the [School of Mechanical, Industrial, and Manufacturing Engineering](https://mime.oregonstate.edu) at [Oregon State University](https://oregonstate.edu).

All problems here use Python with the [SciPy](https://www.scipy.org) ecosystem of packages {cite:p}`2020SciPy-NMeth`.
All artwork here is original.
This interactive website is powered by [Jupyter Book](https://jupyterbook.org/).


[![license](../images/cc-by.svg)](https://creativecommons.org/licenses/by/4.0/)
<br />
This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
6 changes: 4 additions & 2 deletions book/content/numerical-methods/error.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Error

## Types of Error

Applying the trapezoidal rule and Simpson's rule introduces the concept of **error** in numerical solutions.

In our work so far, we have come across two obvious kinds of error, that we'll come back to later:
Expand All @@ -19,7 +21,7 @@ In any numerical solution, there are five main sources of error:

5. Human error and machine error: there are many potential sources of error in any code. These can come from typos, human programming errors, errors in input data, or (more rarely) a pure machine error. Even textbooks, tables, and formulas may have errors.

### Absolute and relative error
## Absolute and relative error

We can also differentiate between **absolute** and **relative** error in a quantity. If $y$ is an exact value and $\tilde{y}$ is an approximation to that value, then we have

Expand All @@ -29,4 +31,4 @@ We can also differentiate between **absolute** and **relative** error in a quant
If $y$ is a vector, then we can define error using the maximum of the elements:
\begin{equation}
\max_i \frac{ |y_i - \tilde{y}_{i} |}{|y_i|}
\end{equation}
\end{equation}
498 changes: 315 additions & 183 deletions book/content/numerical-methods/initial-value-methods.ipynb

Large diffs are not rendered by default.

321 changes: 208 additions & 113 deletions book/content/numerical-methods/integrals.ipynb

Large diffs are not rendered by default.

376 changes: 208 additions & 168 deletions book/content/numerical-methods/stability.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit bf56ffe

Please sign in to comment.