Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Other

LIFESCI 30B Lab 1 - Feedback Loops and Oscillations.ipynb Kernel: Python 3 (CoCalc) SUMMER 2026 University of California

Rating
-
Sold
-
Pages
13
Uploaded on
28-05-2026
Written in
2025/2026

A Predator-Prey Model Previously, we studied and simulated the Lotka-Volterra predator-prey model (which you initially saw as the "shark-tuna model"). Now, we will study a different predator-prey model, termed the Holling-Tanner model, that incorporates somewhat different (and more realistic) biological assumptions. As before, we will call our prey population and our predator population . We will assume that, in the absence of predators, the prey population would grow logistically. The expression for this is the familiar . We also want an individual predator’s consumption rate to plateau as increases so that there is a limit to how much predators can eat. This can be done with the function , where is a predator’s maximum consumption rate and is the half-saturation density, the prey density at which consumption is half the maximum rate.

Show more Read less
Institution
LIFESCI 30B
Course
LIFESCI 30B

Content preview

4/7/26, 11:52 PM Lab 1 - Feedback Loops and Oscillations.ipynb


Kernel: Python 3 (CoCalc)
Lab 1: Feedback Loops and Oscillations
Instructions for all labs (and programming in other assignments) in this course:
Write comments to help yourself and others looking at your code (including graders!)
understand your code. This should be at least 1 comment for every 5 lines of code in an
exercise, and you can see examples in our example code.
Label axes for all plots.
If you're plotting more than one time series or other items on the same axes, you should make
a legend with descriptive labels and a different color or style for each item.
We encourage you to collaborate with your team members and ask TAs and LAs for help, but
you should make sure you understand what is allowed cheating by reviewing the Academic
Integrity policy in our syllabus (including artificial intelligence).
In [4]: # Name:Gustavo Delgadillo
# I worked on this lab with: Sarai Garcia, Monica Ibrahim, Sandy Saat
# Have you read the instructions above and reviewed the Academic
Integrity policy in our syllabus? yes.

Throughout this course series, you have seen systems that oscillate. The purpose of this lab is to
take a closer look at such systems and to review important Python functions used for simulation
and plotting.

A Predator-Prey Model
Previously, we studied and simulated the Lotka-Volterra predator-prey model (which you initially
saw as the "shark-tuna model"). Now, we will study a different predator-prey model, termed the
Holling-Tanner model, that incorporates somewhat different (and more realistic) biological
assumptions.
As before, we will call our prey population N and our predator population P . We will assume that, in
the absence of predators, the prey population would grow logistically. The expression for this is the
familiar rN (1 − Nk ).





We also want an individual predator’s consumption rate to plateau as N increases so that there is a
limit to how much predators can eat. This can be done with the function f (N ) = CN +hN , where
max ​




Cmax is a predator’s maximum consumption rate and h is the half-saturation density, the prey





density at which consumption is half the maximum rate.





about:blank 1/13

, 4/7/26, 11:52 PM Lab 1 - Feedback Loops and Oscillations.ipynb

We can make plots by using np.linspace to generate a set of x values and then writing a formula
for the y values. We then use the pyplot function plot to generate the plot. Here is an example
that plots f (X) = 625+X
X
. 4
4 ​




Note: most example code in this course will be given as images so you will practice typing it
yourself.




Exercise 1. Plot CN +hN for different values of Cmax and h (at least two values per parameter
max ​




ranging between 1 and 10), changing one value at a time. Use N range of 0-200. You can put your
​ ​




plots on the same or different axes, but make sure to label which graph is which (using a legend as
shown above if you put them on the same axes). Also, label your axes.
In [4]: #write code here
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint

Cmax = 3
Cmax2 = 6
h1 = 3
h2 = 6

N = np.linspace(0,200, 1000)

y1 = (Cmax*N)/(N+h1)
y2 = (Cmax2*N)/(N+h1)
y3 = (Cmax*N)/(N+h2)
y4 = (Cmax2*N)/(N+h2)
about:blank 2/13

Written for

Institution
LIFESCI 30B
Course
LIFESCI 30B

Document information

Uploaded on
May 28, 2026
Number of pages
13
Written in
2025/2026
Type
OTHER
Person
Unknown

Subjects

$32.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Oldspice Portage Learning
Follow You need to be logged in order to follow users or courses
Sold
1204
Member since
6 year
Number of followers
867
Documents
3727
Last sold
4 weeks ago
999

Lemme help you murder that paper :) Nursing, Math, Biology, Anatomy etc

3.9

208 reviews

5
103
4
43
3
30
2
9
1
23

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions