dh4gan / lotka-volterra Goto Github PK
View Code? Open in Web Editor NEWPython code to integrate Lotka-Volterra equations for Predator-Prey systems
Python code to integrate Lotka-Volterra equations for Predator-Prey systems
In the book Ages of Discord by Peter Turchin, he proposed a model for Social instability. Quoting lines from the book:
The state variables are the proportions of naïve individuals in the population (S), of radicals (I), and of moderates (R)
Notation wise, R(25,1951), is the proportion of moderates in the age class 25 in year 1951.
All individuals leaving the naïve compartment (at the rate σ(t)) must be added to the radicalized compartment (keeping track of their age class)
Similarly, all individuals leaving the radicalized compartment (at the rate ρ(t))
The first equation says that the social contagion rate, σ(t), increases together with the total number of radicals (ΣI(a,t), summing over all age classes)
The second equation models the effect of the level of political violence on the probability of a radical becoming disgusted with radicalism and turning into a moderate. Because I proxy instability by the number of radicals, the equation for ρ(t) includes the sum of radicals in all age classes. However, note that there is a time delay, τ.
Dynamics of the age-structured social contagion model for parameters α = 0.3, γ = 1, δ = 0.5, τ = 10, and T = 35.
For initial conditions, I put everybody in the naïve class and then add a radicalization “inoculum” by moving a small fraction of naïves into the radicalized compartment (because naïves can catch the radicalization “virus” only from radicals, without such an inoculum everybody would simply stay in the naïve compartment). Boundary conditions are constructed similarly. At every time step, a constant fraction is added to the first age class in the naïve compartment, S(1,t) = 1/T, where T is the number of age classes (this ensures that the proportions of all age classes in all compartments add up to 1). At the other end, individuals moving into age class T + 1 are simply eliminated (they die off or retire from active political life).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.