File:Population curve of Mesopotamia - Uruk period 1.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 959 × 648 pixels, file size: 53 KB)

Captions

Captions

Population growth in Mesopotamia during Uruk period

Summary

[edit]
Description
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

    1. uruk population Python 3 code
  1. 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

    1. sigmoid

def sigmoid(x, L ,x0, k, b):

   y = L / (1 + np.exp(-k*(x-x0)))+b
   return (y)
    1. 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

  1. 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)

  1. print (sekondx)
  2. rint (xdata0)
  3. print (ydata0)

xdata1=xdata0 ydata1=ydata0/1000000.0

  1. print(ydata1)
  1. p0 = [max(ydata1), np.median(xdata1),1,min(ydata1)] # this is an mandatory initial guess
  2. 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)

  1. print (pcov)

x=np.linspace(0, xnum,pxlen) thirdx=np.linspace(beginx,endx,pxlen)

  1. 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

  1. 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"

  1. print(rx1,rx2, ry1,ry2)
  2. print(dx1,dy1)

print("Growth rate %", gp1)

  1. print(gp1)

print(" Doubling time yr",dout1)

  1. plt.plot(x,y, label='fit')
  2. plt.plot(xdata1,ydata1)
  3. 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]
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
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/TimeThumbnailDimensionsUserComment
current10:24, 17 July 2020Thumbnail for version as of 10:24, 17 July 2020959 × 648 (53 KB)Merikanto (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

Metadata