Code from the lectures

SIR.m (MATLAB) for visualising the solution of the SIR model

phase_portrait.py (Python) for visualising velocity fields and orbits (thanks, Ludvik!)

Here is how to plot a quiver plot in Matlab for Example 4.2 (the same can be done in many other languages):

[X,Y] = meshgrid(linspace(-1,1,15));
U = Y+X.*(1-X.^2-Y.^2);
V = -X+Y.*(1-X.^2-Y.^2);
quiver(X,Y,U,V);

LotkaVolterra.m (MATLAB) for plotting the phase portrait of the Lotka–Volterra model with competing species.

Publisert 18. feb. 2022 14:10 - Sist endret 11. mars 2022 10:01