Skip to content

Mathematical models in biological process

Notifications You must be signed in to change notification settings

matchy-at-snu/math-564-math-bio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

math-bio

Homework repository for MATH564 MATH MODELING @ UNC-Chapel Hill

I'll probably extend this repo to a solution manual + concise notes to the book Mathematical Models in Biology.

File structure

math-bio
│  .gitignore
│  hw-template.cls -----------------template
│  new_probs.ps1 -------------------powershell script, auto-create hw folder
│  README.md
│
├─hw1 ------------------------------homework directories
│  │  hw1.pdf ----------------------compiled pdf
│  │  hw1.tex ----------------------.tex source file
│  │  hw1_plot.py ------------------python script for plotting
│  ├─sections ----------------------subfiles corresponding to hw problems
│  │      prob1.tex
│  │      prob2.tex
│  │      ...
│  └─fig ---------------------------graphs plotted by hw[0-9]_plot.py
│         fig2(a).pdf
│         ...
├─hw2
└─...

The multiple .tex files are compiled into 1 using package subfile. Within each hw[0-9] directory, there will be a fig folder storing all the figures, a sections folder containing all the subfiles

Brief LaTeX reference

Two modes in latex that can typeset the formulations

  1. Inline mode, start with an $, end with an $ ($...$).
  2. Display mode, start with two $$, end with two $$ ($$...$$)

\(...\) and \[...\] can also start inline mode math and display mode math, respectively. We recommend using $...$ for inline mode delimiter and \[...\] for displaymode delimiter, for clearer distinction.

Basic Maths

  1. It is straight-forward for basic arithmetic operations. E.g. +, - * /, a^b, a_b will give +, - * /, a^b, a_b
  2. \LaTeX already defined many useful symbols, macros, (or functions) to typeset the formulations. They start with \, such as \LaTeX is for the latex symbol. In some typeset functions you can give them parameters. E.g. \frac{1}{3} typesets one over three, where the thing within the first {} is nominator, and the thing within the second {} is denominator. {} also helps group thing within it together. Consider the difference between a_b+1 (a_b+1) and a_{b+1} (a_{b+1})

Useful symbols and functions

code effect
fraction \frac{1}{3} \frac{1}{3}
summation \sum_{i=1}^{N} \sum_{i=1}^{N}
products \prod_{i=1}^{N} \prod_{i=1}^{N}
indexing w_{i, j} w_{i, j}
frequently used Greek letters \alpha, \beta, \gamma, \lambda \alpha, \beta, \gamma, \lambda
steady state/fixed points \bar x or \overline x \bar x, \overline x
vector forms \begin{bmatrix} x_{i, 1} \\ \vdots \\ x_{i, p+1} \end{bmatrix} \begin{bmatrix} x_{i, 1} \ \vdots \ x_{i, p+1} \end{bmatrix}

Useful environment

aligned environment

A useful environment for aligning equations. Used inside a display mode math snippet. The & determines where the equations align. This environment, unlike the traditional equation and align environment, will not produce a number corresponding to the equation, and it cannot be labelled.

Example
$$
\begin{aligned}
    y &= x^2 + 3x + 2 \\
    &= (x+1)(x+2)
\end{aligned}
$$
Effect
\begin{aligned} y &= x^2 + 3x + 2 \\   &= (x+1)(x+2) \end{aligned}

For more information about aligning equations, see this nice document provided by OverLeaf.

Some special commands provided here

code effect
derivative \deriv{y},
\deriv[t]{N},
\derivlong{x^2+3x+2}
\frac{\mathrm{d}y}{\mathrm{d}x},
\frac{\mathrm{d}N}{\mathrm{d}t},
\frac{\mathrm{d}}{\mathrm{d}x}(x^2+3x+2)
partial derivative \pderiv{f}{x},

\pderivlong{x^2+3x+2}{x}
\frac{\partial f}{\partial x},
\frac{\partial}{\partial x}(x^2 + 3x + 2)

Progress tracking

Homework Progress

  • homework 1
  • homework 2
  • homework 3
  • homework 4

To-dos

  • Improve PowerShell script: directory creation automation
  • Improve PowerShell script: .tex file creation improvement
  • Add MakeFile and Unix Shell version of the PS1 script (or just use bash, since we have WSL for windows)
  • Improve the options part in hw-template.cls

Misc

Suggestions are welcome!