Identification and Control of a Predator-Prey Model

I implemented the SINDyC (Sparse Identification of Nonlinear Dynamical Systems with Control) algorithm to identify the governing equations of a modified Lotka-Volterra predator-prey model. This model includes an external forcing term that artificially inflates the prey population.

The modified Lotka-Volterra equations describe the interactions between predator and prey populations, characterized by parameters such as:

Time-series data for the prey and predator populations were generated by numerically solving the modified equations under specified conditions. Options were provided to add Gaussian noise to the data for robustness testing, and both noisy and noise-free time-series visualizations were created.

The SINDyC algorithm was set up using the PySINDy library, configured with a finite difference differentiation method, a polynomial feature library of degree 2, and a sequential thresholded least-squares optimizer. The resulting governing equations were represented as sparse coefficients for the candidate library functions.

I then implemented a Model Predictive Control (MPC) strategy. The system state variables included the prey and predator populations, while the control input represented an unspecified external action. The MPC controller aimed to minimize the sum of squared population rates of prey and predators, effectively working to stabilize the populations of both species.

Then, the MPC controller and simulator were initialized with the same initial conditions for the prey and predator populations. A simulation loop ran for 20 time steps, with the MPC controller computing the optimal control input at each step and the simulator updating the system state based on this control input.