File:Population curve of Uruk 2.svg

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

Original file(SVG file, nominally 797 × 522 pixels, file size: 49 KB)

Captions

Captions

Population growth of city of Uruk during Uruk period

Summary

[edit]
Description
English: Estimated population growth of Uruk.
Date
Source Own work
Author Merikanto
Camera location31° 19′ 20″ N, 45° 38′ 10″ E  Heading=1° Kartographer map based on OpenStreetMap.View this and other nearby images on: OpenStreetMapinfo

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

    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'uruk3.csv', delimiter=';')

beginx=4200 endx=2800 xnum=20 xnum1=xnum+1 pxlen=100

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

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

xdata1=xdata0 ydata1=ydata0/100000.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)

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"

  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)

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]
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
current15:59, 16 July 2020Thumbnail for version as of 15:59, 16 July 2020797 × 522 (49 KB)Merikanto (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata