End Activity Session (Day 3)
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\]
- What is the biomass in the reactor after 4 hours?
- 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)\):
- Find and sketch \(\vec a + \vec b\)
- Find and sketch \(\vec b - \vec a\)
- Find and sketch \(2 \vec a\)
- Find \(\vec a \cdot \vec b\)
Part 2: Coding practice
- Create a new project (you may want to name it
eds212-day3-tasks
or something similar) - Setup your local and remote repo using
usethis::use_git()
andusethis::use_github()
- In a Quarto doc in your project:
- Using the
c()
function, create and store two new vectors, calledvec_a
andvec_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\)
- \(2 \vec a\)
- \(\vec a \cdot \vec b\)
- Save your quarto doc and Render
- Open the Terminal outside of RStudio
- Navigate to your project directory using
cd
- Use
git status
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 a Quarto document with code to numerically solve the SIR equations) to create a version-controlled project
- Once you’ve created your project, open the
sir.qmd
file. - Run all code in the .qmd (
Cmd
/Ctrl
+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.