File:Population curve of Mesopotamia - Uruk period 1.svg
Original file (SVG file, nominally 959 × 648 pixels, file size: 53 KB)
Captions
Summary
editDescriptionPopulation curve of Mesopotamia - Uruk period 1.svg |
English: Population growth in Mesopotamia during Uruk period, here time brackets are 4000-3000 BC. |
Date | |
Source | Own work |
Author | Merikanto |
This curve ieis based on data from Finnish wiki page
https://fi.wikipedia.org/wiki/Mesopotamian_maantiede
Original data for curve is from
Turner 1990, p 28
The Earth as Transformed by Human Action: Global and Regional Changes in the Biosphere Over the Past 300 Years,B. L. Turner, CUP Archive, 1990
Data
Year;Population
-4100;25000
-3500;100000
-2500;360000
-1900;630000
-1600;270000
Python 3 code
- uruk population Python 3 code
- ver 2
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
from scipy.optimize import curve_fit
import math as math
- sigmoid
def sigmoid(x, L ,x0, k, b):
y = L / (1 + np.exp(-k*(x-x0)))+b
return (y)
- exp
def func(x, a, c, d):
return a*np.exp(-c*x)+d
df = pd.read_csv(r'mesopotamia1.csv', delimiter=';')
beginx=-4000
endx=-3000
xnum=20
xnum1=xnum+1
pxlen=100
- bc;est_pop;pop_lower;pop_upper
origx=np.array(df['Year'])
origy=np.array(df['Population'])
sekondx=np.linspace(beginx, endx,xnum1)
xdata0=np.linspace(0, xnum,xnum1)
interp1 = interp1d(origx,origy, kind='cubic')
ydata0 = interp1(sekondx)
- print (sekondx)
- rint (xdata0)
- print (ydata0)
xdata1=xdata0
ydata1=ydata0/1000000.0
- print(ydata1)
- p0 = [max(ydata1), np.median(xdata1),1,min(ydata1)] # this is an mandatory initial guess
- popt, pcov = curve_fit(sigmoid, xdata1, ydata1,p0, method='dogbox')
popt, pcov = curve_fit(func, xdata1, ydata1, p0=(1, 1e-6, 1))
print ("Popt")
print (popt)
- print (pcov)
x=np.linspace(0, xnum,pxlen)
thirdx=np.linspace(beginx,endx,pxlen)
- y = sigmoid(x, *popt)
y = func(x, *popt)
y3a=x
y3b=np.add(y3a,4000)
y3c=np.multiply(y3a,0.09)
y3d=np.exp(y3c)
y3e=np.multiply(y3d,38000)
y3=np.round(y3e,0)
print (y3)
y2=y*1000000
- print (y2)
lok1=0
lok2=pxlen-1
rx1=thirdx[lok1]
ry1=y2[lok1]
rx2=thirdx[lok2]
ry2=y2[lok2]
dx1=rx1-rx2 ## years bc
dy1=ry2-ry1
gr1=math.log(ry2/ry1)/dx1
gp1=gr1*100
dout1=math.log(2.0)/gr1
gp1=np.round(gp1,2)*-1
dout1=np.round(dout1,0)*-1
annot1="Population growth rate "+str(gp1)+ "%,\n doubling time "+str(dout1)+ " years"
- print(rx1,rx2, ry1,ry2)
- print(dx1,dy1)
print("Growth rate %", gp1)
- print(gp1)
print(" Doubling time yr",dout1)
- plt.plot(x,y, label='fit')
- plt.plot(xdata1,ydata1)
- plt.plot(thirdx,y2, 'g-.', lw=3,label="Theoretical exponent curve")
plt.plot(thirdx,y3, 'r-.', lw=4, label="Test curve")
plt.plot(origx,origy, 'b-', lw=5, label="Data from archaeologists")
plt.xlim(beginx,endx)
plt.xlim(-4000,-3000)
plt.ylim(0,300000)
plt.xticks(fontsize=15)
plt.yticks(fontsize=15)
plt.xlabel("Years (negative is BC)" , fontsize=15)
plt.ylabel("Population of Mesopotamia" , fontsize=15 )
plt.title("Population growth of Mesopotamia" , fontsize=18 )
plt.text(-3950, 200000, annot1, fontsize=17)
plt.legend()
plt.grid(True)
plt.show()
Licensing
edit- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 10:24, 17 July 2020 | 959 × 648 (53 KB) | Merikanto (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 766.8pt |
---|---|
Height | 518.4pt |