Part 1: By hand problems

Derivative reminder

Biomass (grams) in a reactor over time (hours) is described by:

\[B(t) = 0.4t^2 + 3.6\] a) What is the biomass in the reactor after 4 hours?

  1. What is the rate at which biomass is changing in the reactor at t = 3.2 hours?

Vector math

For the vectors \(\vec a = (1,6)\) and \(\vec b = (2, 4)\):

  1. Find and sketch \(\vec a + \vec b\)
  2. Find and sketch \(\vec b - \vec a\)
  3. Find and sketch \(4 \vec a\)
  4. Find \(\vec a \cdot \vec b\)

Part 2: Coding practice

  • Create a new project (you may want to name it eds212_day3_task2 or something similar)

  • Setup your local and remote repo using usethis::use_git() and usethis::use_github()

  • In a Quarto doc in your project:

  • Using the c() function, create and store two new vectors, called vec_a and vec_b, where \(\vec a = (1,6)\) and \(\vec b = (2, 4)\):

  • Check your by-hand solutions from Part 1 by finding the following in R:

    • \(\vec a + \vec b\)
    • \(\vec b - \vec a\)
    • \(4 \vec a\)
    • \(\vec a \cdot \vec b\)
  • Save your quarto doc and Render

  • Open the Terminal outside of RStudio

  • Navigate to your project directory

  • Use git status (or checkout…) to check the status

  • Use git add . to stage all changes

  • Use git commit -m “your commit message here” to commit to your local repo

  • Use git pull to check for remote changes

  • Use git push to push changes to your remote repo

  • Go to your remote repo for the project and check to see that the new updates are stored

Part 3: Fork & clone a repo, use the code

  • Fork and clone this repo, which contains an R Markdown document with code to numerically solve the SIR equations, to create a version-controlled project

  • Once you’ve created your project, open the sir-example.Rmd file.

  • Run all code in the .Rmd (Cmd + Option + R, or go up to the run button and choose the last option “Run All”)

  • Explore the code and output graph. What is the code doing? What is the graph telling us?

  • Make small changes to the parameter values to see how the SIR models change. Are the changes expected?

  • After trying out a few changes, save and knit your new output graph.

  • Stage, commit, pull, then push to your repo in the command line.

  • Check for your changes on GitHub. Are they there? Cool, done with Part 3.

End