<!-- Source: https://docs.biosimulant.com/examples/ecology-rosenzweig-macarthur -->

# Ecology: Rosenzweig–MacArthur

A practical predator–prey model. **Adds carrying capacity, Holling type II handling-time saturation, and optional seasonality, disease, migration, and patch structure** on top of the Lotka–Volterra skeleton.

## What it simulates

- Prey grow but cap out at the habitat carrying capacity.
- Predation saturates at high prey density (Holling type II).
- Predators turn a fraction of consumed prey into new predators.
- Optional layers: seasonal forcing, disease compartments, inter-patch migration, and noise.
- The default scenario is intentionally boom-bust so collapse risk and threshold crossings are visible in one run.

![Rosenzweig-MacArthur boom-bust trajectories and phase portrait](/images/examples/ecology-rosenzweig-macarthur/rosenzweig-macarthur-canvas-trajectories-phase.png)

## Run it on the Hub

1. Open the [Rosenzweig–MacArthur Predator-Prey System Lab](https://hub.biosimulant.com/labs/e3a3cbae-cb67-466b-933d-82a23a5720f2) on the public Hub.
2. Click **Run**. The default scenario runs for one simulated year (365 days).

## Inputs you can tune

| Input | Meaning |
|---|---|
| `prey_initial_population` | Starting prey count. |
| `predator_initial_population` | Starting predator count. |
| `prey_growth_rate` | Prey growth in good conditions. |
| `prey_carrying_capacity` | Habitat limit for prey. |
| `attack_rate` | How quickly predators find prey. |
| `handling_time` | Time spent handling each prey item. |
| `predator_mortality_rate` | Predator loss rate. |
| `predator_conversion_efficiency` | Predator gain per prey eaten. |
| `food_resource_index` | Resource-quality multiplier. |

Optional inputs configure seasonal forcing, disease, migration, and patch settings.

## What results to expect

- **Population trajectory**: prey surge, lagged predator response, overshoot, and crash.
- **Phase portrait**: large boom-bust loop with the carrying-capacity line and the coexistence equilibrium marked.
- **Holling type II curve**: predator consumption versus prey density, with a marker at the current state.
- **Risk and state table**: extinction-risk scores (`prey`, `predator`, `joint`) and the active mechanisms list.

![Rosenzweig-MacArthur Holling type II response and risk table](/images/examples/ecology-rosenzweig-macarthur/rosenzweig-macarthur-functional-response-risk.png)

**Info:**

  Source on GitHub: [models-ecology — rosenzweig-macarthur](https://github.com/Biosimulant/models-ecology/tree/main/labs/ecology-rosenzweig-macarthur-predator-prey-system).
