File:Population curve of Uruk 2.svg
![File:Population curve of Uruk 2.svg](https://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Population_curve_of_Uruk_2.svg/797px-Population_curve_of_Uruk_2.svg.png?20200716155952)
Original file (SVG file, nominally 797 × 522 pixels, file size: 49 KB)
Captions
Captions
Summary
[edit]DescriptionPopulation curve of Uruk 2.svg |
English: Estimated population growth of Uruk. |
Date | |
Source | Own work |
Author | Merikanto |
Camera location | 31° 19′ 20″ N, 45° 38′ 10″ E ![]() ![]() | View this and other nearby images on: OpenStreetMap | ![]() |
---|
This plot is based on info from Finnish Wikipedia.
https://fi.wikipedia.org/wiki/Uruk
data
bc;est_pop;pop_lower;pop_upper
5000;0;0;0
4000;5000;5000;5000
3700;11000;8000;14000
3500;14500;14000;15000
3400;20000;20000;2000
3100;45000;40000;50000
2800;80000;80000;80000
2650;65000;50000;80000
2500;50000;50000;50000
1800;75000;75000;75000
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'uruk3.csv', delimiter=';')
beginx=4200
endx=2800
xnum=20
xnum1=xnum+1
pxlen=100
- bc;est_pop;pop_lower;pop_upper
origx=np.array(df['bc'])
origy=np.array(df['est_pop'])
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/100000.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)
y2=y*100000
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)
dout1=np.round(dout1,0)
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(origx,origy, 'b-', lw=5, label="Data from archaeologists")
plt.xlim(beginx,endx)
plt.xticks(fontsize=15)
plt.yticks(fontsize=15)
plt.xlabel("Years BC" , fontsize=15)
plt.ylabel("Population of Uruk" , fontsize=15 )
plt.title("Population growth of Uruk" , fontsize=18 )
plt.text(4000, 50000, annot1, fontsize=17)
plt.legend()
plt.grid(True)
plt.show()
Licensing
[edit]![w:en:Creative Commons](https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/CC_some_rights_reserved.svg/90px-CC_some_rights_reserved.svg.png)
![attribution](https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Cc-by_new_white.svg/24px-Cc-by_new_white.svg.png)
![share alike](https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Cc-sa_white.svg/24px-Cc-sa_white.svg.png)
- 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 | 15:59, 16 July 2020 | ![]() | 797 × 522 (49 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.
File usage on other wikis
The following other wikis use this file:
- Usage on fi.wikipedia.org
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 | 637.92pt |
---|---|
Height | 417.6pt |