update on getting started
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{'holder': ['Morten Hjorth-Jensen'], 'year': '1999-2018', 'license': 'Released under CC Attribution-NonCommercial 4.0 license', 'cite doconce': False}
|
||||
@@ -0,0 +1,231 @@
|
||||
translating doconce text in book.do.txt to ipynb
|
||||
*** error: could not open the file src/plot_Hudson.py used in
|
||||
@@@CODE src/plot_Hudson.py
|
||||
translating doconce text in book.do.txt to ipynb
|
||||
copy complete file src/plot_Hudson.py (format: pypro)
|
||||
copy complete file src/Hudson_Bay.py (format: pypro)
|
||||
*** error: figure file "fig/Hudson_Bay_sim" does not exist!
|
||||
translating doconce text in book.do.txt to ipynb
|
||||
copy complete file src/plot_Hudson.py (format: pypro)
|
||||
copy complete file src/Hudson_Bay.py (format: pypro)
|
||||
figure file fig/Hudson_Bay_data:
|
||||
can use fig/Hudson_Bay_data.png for format ipynb
|
||||
figure file fig/Hudson_Bay_sim:
|
||||
can use fig/Hudson_Bay_sim.png for format ipynb
|
||||
collected all required additional files in ipynb-book-src.tar.gz which must be distributed with the notebook
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
output in book.ipynb
|
||||
*** error: file has a mako construction ${\bf \hat{J}'
|
||||
but seemingly no definition in <%...%>'
|
||||
(it is not a command-line given mako variable either).
|
||||
However, if this is a variable in a Makefile or Bash script
|
||||
run with --no_mako - and you cannot use mako and Makefile or Bash variables
|
||||
in the same document!
|
||||
|
||||
*** error: file has a mako construction ${\bf \hat{J}'
|
||||
but seemingly no definition in <%...%>'
|
||||
(it is not a command-line given mako variable either).
|
||||
However, if this is a variable in a Makefile or Bash script
|
||||
run with --no_mako - and you cannot use mako and Makefile or Bash variables
|
||||
in the same document!
|
||||
|
||||
translating doconce text in book.do.txt to ipynb
|
||||
*** error: found multiple labels:
|
||||
eq:def_covariance eq:autocorrelation_time eq:error_estimate_corr_time
|
||||
translating doconce text in book.do.txt to ipynb
|
||||
copy complete file src/plot_Hudson.py (format: pypro)
|
||||
copy complete file src/Hudson_Bay.py (format: pypro)
|
||||
figure file fig/Hudson_Bay_data:
|
||||
can use fig/Hudson_Bay_data.png for format ipynb
|
||||
figure file fig/Hudson_Bay_sim:
|
||||
can use fig/Hudson_Bay_sim.png for format ipynb
|
||||
collected all required additional files in ipynb-book-src.tar.gz which must be distributed with the notebook
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
output in book.ipynb
|
||||
translating doconce text in book.do.txt to ipynb
|
||||
copy complete file src/plot_Hudson.py (format: pypro)
|
||||
copy complete file src/Hudson_Bay.py (format: pypro)
|
||||
figure file fig/Hudson_Bay_data:
|
||||
can use fig/Hudson_Bay_data.png for format ipynb
|
||||
figure file fig/Hudson_Bay_sim:
|
||||
can use fig/Hudson_Bay_sim.png for format ipynb
|
||||
collected all required additional files in ipynb-book-src.tar.gz which must be distributed with the notebook
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
*** warning: latex envir \begin{bmatrix} does not work well in Markdown.
|
||||
Stick to \[ ... \], equation, equation*, align, or align*
|
||||
environments in math environments.
|
||||
|
||||
output in book.ipynb
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,43 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
def solver(m, H0, L0, dt, a, b, c, d, t0):
|
||||
"""Solve the difference equations for H and L over m years
|
||||
with time step dt (measured in years."""
|
||||
|
||||
num_intervals = int(m/float(dt))
|
||||
t = np.linspace(t0, t0 + m, num_intervals+1)
|
||||
H = np.zeros(t.size)
|
||||
L = np.zeros(t.size)
|
||||
|
||||
print 'Init:', H0, L0, dt
|
||||
H[0] = H0
|
||||
L[0] = L0
|
||||
|
||||
for n in range(0, len(t)-1):
|
||||
H[n+1] = H[n] + a*dt*H[n] - b*dt*H[n]*L[n]
|
||||
L[n+1] = L[n] + d*dt*H[n]*L[n] - c*dt*L[n]
|
||||
return H, L, t
|
||||
|
||||
# Load in data file
|
||||
data = np.loadtxt('Hudson_Bay.csv', delimiter=',', skiprows=1)
|
||||
# Make arrays containing x-axis and hares and lynx populations
|
||||
t_e = data[:,0]
|
||||
H_e = data[:,1]
|
||||
L_e = data[:,2]
|
||||
|
||||
# Simulate using the model
|
||||
H, L, t = solver(m=20, H0=34.91, L0=3.857, dt=0.1,
|
||||
a=0.4807, b=0.02482, c=0.9272, d=0.02756,
|
||||
t0=1900)
|
||||
|
||||
# Visualize simulations and data
|
||||
plt.plot(t_e, H_e, 'b-+', t_e, L_e, 'r-o', t, H, 'm--', t, L, 'k--')
|
||||
plt.xlabel('Year')
|
||||
plt.ylabel('Numbers of hares and lynx')
|
||||
plt.axis([1900, 1920, 0, 140])
|
||||
plt.title(r'Population of hares and lynx 1900-1920 (x1000)')
|
||||
plt.legend(('H_e', 'L_e', 'H', 'L'), loc='upper left')
|
||||
plt.savefig('Hudson_Bay_sim.pdf')
|
||||
plt.savefig('Hudson_Bay_sim.png')
|
||||
plt.show()
|
||||
@@ -0,0 +1,19 @@
|
||||
import numpy as np
|
||||
from matplotlib import pyplot as plt
|
||||
|
||||
# Load in data file
|
||||
data = np.loadtxt('src/Hudson_Bay.dat', delimiter=',', skiprows=1)
|
||||
# Make arrays containing x-axis and hares and lynx populations
|
||||
year = data[:,0]
|
||||
hares = data[:,1]
|
||||
lynx = data[:,2]
|
||||
|
||||
plt.plot(year, hares ,'b-+', year, lynx, 'r-o')
|
||||
plt.axis([1900,1920,0, 100.0])
|
||||
plt.xlabel(r'Year')
|
||||
plt.ylabel(r'Numbers of hares and lynx ')
|
||||
plt.legend(('Hares','Lynx'), loc='upper right')
|
||||
plt.title(r'Population of hares and lynx from 1900-1920 (x1000)}')
|
||||
plt.savefig('Hudson_Bay_data.pdf')
|
||||
plt.savefig('Hudson_Bay_data.png')
|
||||
plt.show()
|
||||
Reference in New Issue
Block a user