Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Lecture slides for UCLA LS 30B, Spring 2020

Views: 14459
License: GPL3
Image: ubuntu2004
Kernel: SageMath 9.2
import numpy as np import plotly.graph_objects from IPython.display import display, YouTubeVideo, HTML #from ipywidgets import interactive_output, VBox, HBox, IntSlider, SelectionSlider
mydefault = plotly.graph_objects.layout.Template() mydefault.layout.xaxis.showgrid = False mydefault.layout.yaxis.showgrid = False mydefault.layout.xaxis.showline = True mydefault.layout.yaxis.showline = True mydefault.layout.yaxis.linewidth = 2 mydefault.layout.xaxis.ticks = "outside" mydefault.layout.yaxis.ticks = "outside" mydefault.layout.hovermode = False mydefault.layout.dragmode = "pan" mydefault.layout.scene.hovermode = False mydefault.layout.xaxis.showspikes = False mydefault.layout.yaxis.showspikes = False mydefault.layout.scene.xaxis.showspikes = False mydefault.layout.scene.yaxis.showspikes = False mydefault.layout.scene.zaxis.showspikes = False plotly.io.templates["mydefault"] = mydefault plotly.io.templates.default = "mydefault"
%%html <!-- To disable the modebar IN ALL PLOT.LY PLOTS --> <style> .modebar { display: none !important; } </style>
def transformation_matrix(M): columns = [] for evalue, evecs, mult in M.eigenvectors_right(): if evalue.imag() < 0: continue if evalue.imag(): for evec in evecs: u = vector(RDF, [a.real() for a in evec]) v = vector(RDF, [a.imag() for a in evec]) columns.append(u) columns.append(v) else: for v in evecs: columns.append(vector(RDF, v)) return column_matrix(columns)
def make_block_diagonal(M): dim = M.dimensions()[0] blocks = [] i = 0 while i < dim: size = 2 if (i+1 < dim and M[i,i+1] != 0) else 1 blocks.append(M[i:i+size,i:i+size]) i += size return block_diagonal_matrix(*blocks)
def round_complex(z, digits): if z.imag_part(): return round(z.real_part(), digits) + round(z.imag_part(), digits) * I return round(z, digits)
def latex_vector(v, round=None): if round is None: result = column_matrix(v) else: result = column_matrix(RDF, v).round(round) result = latex(result).replace("left(", "left[").replace("right)", "right]") return LatexExpr(result)
life_stages = LatexExpr(r"""\left[ \begin{array}{c} \text{Eggs/hatchlings} \\ \text{Small juveniles} \\ \text{Large juveniles} \\ \text{Subadults} \\ \text{Novice breeders} \\ \text{1st-year remigrants} \\ \text{Mature breeders} \end{array} \right] = """)
def discrete_linear_interactive(M, initial_state, **options): max_t = options.get("max_t", 100) pre_text = options.get("pre_text", "") post_text = options.get("post_text", "") show_distribution = options.get("show_distribution", False) font_size = options.get("font_size", 18) fig_height = options.get("fig_height", 250) solution = [vector(initial_state)] for t in range(max_t): solution.append(M * solution[-1]) fig = plotly.graph_objects.FigureWidget() fig.layout.xaxis.visible = False fig.layout.yaxis.visible = False fig.layout.height = fig_height fig.layout.margin = dict(b=10, t=10, l=10, r=10) text = "${}$".format(pre_text + latex_vector(solution[0], round=2)) fig.add_annotation(showarrow=False, font_size=font_size, x=0, y=1, xref="paper", yref="paper", xanchor="left", yanchor="top") annotation = fig.layout.annotations[-1] @interact(t=slider(0, max_t, 1, label="$t$")) def update(t): text = pre_text + latex_vector(solution[t], round=2) if show_distribution: percentages = 100 * solution[t].normalized(1) text += r" \hspace{6em} \text{Percentages: } " text += latex_vector(percentages, 1) annotation.text = "${}$".format(text + post_text) return fig

A model of the worldwide population of loggerhead sea turtles

From the paper “A stage-based population model for loggerhead sea turtles and implications for conservation”, by Deborah Crouse, Larry Crowder, and Hal Caswell, published in the journal Ecology, 1987.

Seven life stages:

  1. Hatchlings (less than 1 year old)

  2. Small juveniles (age 1–7 years)

  3. Large juveniles (age 8–15 years)

  4. Subadults (age 16–21 years)

  5. Novice breeders (age 22 years)

  6. First-year remigrants (age 23 years)

  7. Mature breeders (age 24–54 years)

C = matrix(RDF, [ [0, 0, 0, 0, 127, 4, 80 ], [0.6747, 0.7370, 0, 0, 0, 0, 0 ], [0, 0.0486, 0.6610, 0, 0, 0, 0 ], [0, 0, 0.0147, 0.6907, 0, 0, 0 ], [0, 0, 0, 0.0518, 0, 0, 0 ], [0, 0, 0, 0, 0.8091, 0, 0 ], [0, 0, 0, 0, 0, 0.8091, 0.8089], ]) show(r"C = " + latex(C))
C=(0.00.00.00.0127.04.080.00.67470.7370.00.00.00.00.00.00.04860.6610.00.00.00.00.00.00.01470.69070.00.00.00.00.00.00.05180.00.00.00.00.00.00.00.80910.00.00.00.00.00.00.00.80910.8089)\renewcommand{\Bold}[1]{\mathbf{#1}}C = \left(\begin{array}{rrrrrrr} 0.0 & 0.0 & 0.0 & 0.0 & 127.0 & 4.0 & 80.0 \\ 0.6747 & 0.737 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0486 & 0.661 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0147 & 0.6907 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0518 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.8091 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.8091 & 0.8089 \end{array}\right)
show(LatexExpr(r"\text{Eigenvalues of $C$:}")) for evalue in C.eigenvalues(): show(round_complex(evalue, 4))
Eigenvalues of C:\renewcommand{\Bold}[1]{\mathbf{#1}}\text{Eigenvalues of $C$:}
0.0884+0.1196i\renewcommand{\Bold}[1]{\mathbf{#1}}-0.0884 + 0.1196i
0.08840.1196i\renewcommand{\Bold}[1]{\mathbf{#1}}-0.0884 - 0.1196i
0.2655\renewcommand{\Bold}[1]{\mathbf{#1}}0.2655
0.3717\renewcommand{\Bold}[1]{\mathbf{#1}}0.3717
0.7462+0.2131i\renewcommand{\Bold}[1]{\mathbf{#1}}0.7462 + 0.2131i
0.74620.2131i\renewcommand{\Bold}[1]{\mathbf{#1}}0.7462 - 0.2131i
0.945\renewcommand{\Bold}[1]{\mathbf{#1}}0.945
T = transformation_matrix(C) show(r"T = " + latex(T.round(4)))
T=(0.77680.00.570.4710.01270.29510.29080.62190.09010.81550.86990.93450.00.9430.03840.0120.10020.14610.07350.18380.16140.00070.00030.00350.00670.01060.00780.00930.00.00030.00070.00090.00080.00030.00050.0010.0010.00210.0020.00090.00010.00040.0010.00080.00310.00380.00070.00330.0026)\renewcommand{\Bold}[1]{\mathbf{#1}}T = \left(\begin{array}{rrrrrrr} -0.7768 & 0.0 & -0.57 & -0.471 & -0.0127 & -0.2951 & 0.2908 \\ 0.6219 & 0.0901 & 0.8155 & 0.8699 & -0.9345 & 0.0 & 0.943 \\ -0.0384 & -0.012 & -0.1002 & -0.1461 & -0.0735 & 0.1838 & 0.1614 \\ 0.0007 & 0.0003 & 0.0035 & 0.0067 & 0.0106 & 0.0078 & 0.0093 \\ -0.0 & -0.0003 & 0.0007 & 0.0009 & 0.0008 & 0.0003 & 0.0005 \\ -0.001 & 0.001 & 0.0021 & 0.002 & 0.0009 & 0.0001 & 0.0004 \\ 0.001 & -0.0008 & -0.0031 & -0.0038 & -0.0007 & -0.0033 & 0.0026 \end{array}\right)
D = T.inverse()*C*T show(r"\tilde{D} = " + latex(D.round(4)))
D~=(0.08840.11960.00.00.00.00.00.11960.08840.00.00.00.00.00.00.00.26550.00.00.00.00.00.00.00.37170.00.00.00.00.00.00.00.74620.21310.00.00.00.00.00.21310.74620.00.00.00.00.00.00.00.945)\renewcommand{\Bold}[1]{\mathbf{#1}}\tilde{D} = \left(\begin{array}{rrrrrrr} -0.0884 & 0.1196 & -0.0 & 0.0 & 0.0 & -0.0 & 0.0 \\ -0.1196 & -0.0884 & -0.0 & -0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.2655 & -0.0 & -0.0 & 0.0 & 0.0 \\ -0.0 & -0.0 & 0.0 & 0.3717 & 0.0 & -0.0 & -0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.7462 & 0.2131 & 0.0 \\ 0.0 & -0.0 & 0.0 & -0.0 & -0.2131 & 0.7462 & -0.0 \\ -0.0 & 0.0 & -0.0 & 0.0 & 0.0 & -0.0 & 0.945 \end{array}\right)
show(r"\tilde{D} = " + latex(make_block_diagonal(D.round(4))))
D~=(0.08840.11960.00.00.00.00.00.11960.08840.00.00.00.00.00.00.00.26550.00.00.00.00.00.00.00.37170.00.00.00.00.00.00.00.74620.21310.00.00.00.00.00.21310.74620.00.00.00.00.00.00.00.945)\renewcommand{\Bold}[1]{\mathbf{#1}}\tilde{D} = \left(\begin{array}{rr|r|r|rr|r} -0.0884 & 0.1196 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ -0.1196 & -0.0884 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ \hline 0.0 & 0.0 & 0.2655 & 0.0 & 0.0 & 0.0 & 0.0 \\ \hline 0.0 & 0.0 & 0.0 & 0.3717 & 0.0 & 0.0 & 0.0 \\ \hline 0.0 & 0.0 & 0.0 & 0.0 & 0.7462 & 0.2131 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & -0.2131 & 0.7462 & 0.0 \\ \hline 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.945 \end{array}\right)
show(LatexExpr(r"\text{The absolute values of the eigenvalues:}")) for evalue in C.eigenvalues(): if evalue.imag() or evalue < 0: show(r"|" + latex(round_complex(evalue, 4)) + r"| = " + latex(round(abs(evalue), 4))) else: show(round(abs(evalue), 4))
The absolute values of the eigenvalues:\renewcommand{\Bold}[1]{\mathbf{#1}}\text{The absolute values of the eigenvalues:}
0.0884+0.1196i=0.1488\renewcommand{\Bold}[1]{\mathbf{#1}}| -0.0884 + 0.1196i | = 0.1488
0.08840.1196i=0.1488\renewcommand{\Bold}[1]{\mathbf{#1}}| -0.0884 - 0.1196i | = 0.1488
0.2655\renewcommand{\Bold}[1]{\mathbf{#1}}0.2655
0.3717\renewcommand{\Bold}[1]{\mathbf{#1}}0.3717
0.7462+0.2131i=0.776\renewcommand{\Bold}[1]{\mathbf{#1}}| 0.7462 + 0.2131i | = 0.776
0.74620.2131i=0.776\renewcommand{\Bold}[1]{\mathbf{#1}}| 0.7462 - 0.2131i | = 0.776
0.945\renewcommand{\Bold}[1]{\mathbf{#1}}0.945
state = vector([100.0] * 7) discrete_linear_interactive(C, state, pre_text=life_stages)
state = vector([100.0] * 7) discrete_linear_interactive(C, state, pre_text=life_stages, show_distribution=True)

Protecting eggs, nests, and baby sea turtles

A loggerhead nest, protected by a plastic cage
Bald Head Island, NC
August, 2016

Protecting eggs, nests, and baby sea turtles

Guide rails leading from the nest to the ocean
Bald Head Island, NC
August, 2016

Protecting eggs, nests, and baby sea turtles

Excavating a loggerhead sea turtle nest
Bald Head Island, NC
August, 2016

Protecting eggs, nests, and baby sea turtles

Unhatched eggs found while excavating a nest
Bald Head Island, NC
August, 2016

Protecting eggs, nests, and baby sea turtles

A live straggler found while excavating a nest!
Bald Head Island, NC
August, 2016

Protecting eggs, nests, and baby sea turtles

A live straggler found while excavating a nest!
Bald Head Island, NC
August, 2016

What if we do everything we can to protect eggs, nests, and baby sea turtles?

(And what if that's all we do?)

C2 = matrix(RDF, [ [0, 0, 0, 0, 150, 6, 100 ], [0.6747, 0.7370, 0, 0, 0, 0, 0 ], [0, 0.0486, 0.6610, 0, 0, 0, 0 ], [0, 0, 0.0147, 0.6907, 0, 0, 0 ], [0, 0, 0, 0.0518, 0, 0, 0 ], [0, 0, 0, 0, 0.8091, 0, 0 ], [0, 0, 0, 0, 0, 0.8091, 0.8089], ]) show(r"C_2 = " + latex(C2))
C2=(0.00.00.00.0150.06.0100.00.67470.7370.00.00.00.00.00.00.04860.6610.00.00.00.00.00.00.01470.69070.00.00.00.00.00.00.05180.00.00.00.00.00.00.00.80910.00.00.00.00.00.00.00.80910.8089)\renewcommand{\Bold}[1]{\mathbf{#1}}C_2 = \left(\begin{array}{rrrrrrr} 0.0 & 0.0 & 0.0 & 0.0 & 150.0 & 6.0 & 100.0 \\ 0.6747 & 0.737 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0486 & 0.661 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0147 & 0.6907 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0518 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.8091 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.8091 & 0.8089 \end{array}\right)

The difference between this matrix, C2C_2, and the original one, CC:

show(r"C_2 - C = " + latex(C2 - C))
C2C=(0.00.00.00.023.02.020.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0)\renewcommand{\Bold}[1]{\mathbf{#1}}C_2 - C = \left(\begin{array}{rrrrrrr} 0.0 & 0.0 & 0.0 & 0.0 & 23.0 & 2.0 & 20.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \end{array}\right)
show(LatexExpr(r"\text{Eigenvalues of $C_2$:}")) for evalue in C2.eigenvalues(): show(round_complex(evalue, 5))
Eigenvalues of C2:\renewcommand{\Bold}[1]{\mathbf{#1}}\text{Eigenvalues of $C_2$:}
0.09492+0.12621i\renewcommand{\Bold}[1]{\mathbf{#1}}-0.09492 + 0.12621i
0.094920.12621i\renewcommand{\Bold}[1]{\mathbf{#1}}-0.09492 - 0.12621i
0.3165+0.07173i\renewcommand{\Bold}[1]{\mathbf{#1}}0.3165 + 0.07173i
0.31650.07173i\renewcommand{\Bold}[1]{\mathbf{#1}}0.3165 - 0.07173i
0.7495+0.22485i\renewcommand{\Bold}[1]{\mathbf{#1}}0.7495 + 0.22485i
0.74950.22485i\renewcommand{\Bold}[1]{\mathbf{#1}}0.7495 - 0.22485i
0.95545\renewcommand{\Bold}[1]{\mathbf{#1}}0.95545
T2 = transformation_matrix(C2) D2 = T2.inverse()*C2*T2 show(r"\tilde{D}_2 = " + latex(make_block_diagonal(D2.round(5))))
D~2=(0.094920.126210.00.00.00.00.00.126210.094920.00.00.00.00.00.00.00.31650.071730.00.00.00.00.00.071730.31650.00.00.00.00.00.00.00.74950.224850.00.00.00.00.00.224850.74950.00.00.00.00.00.00.00.95545)\renewcommand{\Bold}[1]{\mathbf{#1}}\tilde{D}_2 = \left(\begin{array}{rr|rr|rr|r} -0.09492 & 0.12621 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ -0.12621 & -0.09492 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ \hline 0.0 & 0.0 & 0.3165 & 0.07173 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & -0.07173 & 0.3165 & 0.0 & 0.0 & 0.0 \\ \hline 0.0 & 0.0 & 0.0 & 0.0 & 0.7495 & 0.22485 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & -0.22485 & 0.7495 & 0.0 \\ \hline 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.95545 \end{array}\right)
show(LatexExpr(r"\text{The absolute values of the eigenvalues:}")) for evalue in C2.eigenvalues(): if evalue.imag() or evalue < 0: show(r"|" + latex(round_complex(evalue, 4)) + r"| = " + latex(round(abs(evalue), 4))) else: show(round(abs(evalue), 4))
The absolute values of the eigenvalues:\renewcommand{\Bold}[1]{\mathbf{#1}}\text{The absolute values of the eigenvalues:}
0.0949+0.1262i=0.1579\renewcommand{\Bold}[1]{\mathbf{#1}}| -0.0949 + 0.1262i | = 0.1579
0.09490.1262i=0.1579\renewcommand{\Bold}[1]{\mathbf{#1}}| -0.0949 - 0.1262i | = 0.1579
0.3165+0.0717i=0.3245\renewcommand{\Bold}[1]{\mathbf{#1}}| 0.3165 + 0.0717i | = 0.3245
0.31650.0717i=0.3245\renewcommand{\Bold}[1]{\mathbf{#1}}| 0.3165 - 0.0717i | = 0.3245
0.7495+0.2249i=0.7825\renewcommand{\Bold}[1]{\mathbf{#1}}| 0.7495 + 0.2249i | = 0.7825
0.74950.2249i=0.7825\renewcommand{\Bold}[1]{\mathbf{#1}}| 0.7495 - 0.2249i | = 0.7825
0.9554\renewcommand{\Bold}[1]{\mathbf{#1}}0.9554
state = vector([100.0] * 7) discrete_linear_interactive(C2, state, pre_text=life_stages)
state = vector([100.0] * 7) discrete_linear_interactive(C2, state, pre_text=life_stages, show_distribution=True)

That didn't work. ☹



Conclusion, so far: Protecting eggs, nests, hatchlings isn't enough by itself.

What if, instead, we protect the juvenile turtles, and especially the older juveniles?

C3 = matrix(RDF, [ [0, 0, 0, 0, 127, 4, 80 ], [0.6747, 0.7470, 0, 0, 0, 0, 0 ], [0, 0.0531, 0.7597, 0, 0, 0, 0 ], [0, 0, 0.0403, 0.7289, 0, 0, 0 ], [0, 0, 0, 0.0710, 0, 0, 0 ], [0, 0, 0, 0, 0.8091, 0, 0 ], [0, 0, 0, 0, 0, 0.8091, 0.8089], ]) show(r"C_3 = " + latex(C3))
C3=(0.00.00.00.0127.04.080.00.67470.7470.00.00.00.00.00.00.05310.75970.00.00.00.00.00.00.04030.72890.00.00.00.00.00.00.0710.00.00.00.00.00.00.00.80910.00.00.00.00.00.00.00.80910.8089)\renewcommand{\Bold}[1]{\mathbf{#1}}C_3 = \left(\begin{array}{rrrrrrr} 0.0 & 0.0 & 0.0 & 0.0 & 127.0 & 4.0 & 80.0 \\ 0.6747 & 0.747 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0531 & 0.7597 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0403 & 0.7289 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.071 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.8091 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.8091 & 0.8089 \end{array}\right)

The difference between this third matrix, C3C_3, and the original one, CC:

show(r"C_3 - C = " + latex((C3 - C).round(5)))
C3C=(0.00.00.00.00.00.00.00.00.010.00.00.00.00.00.00.00450.09870.00.00.00.00.00.00.02560.03820.00.00.00.00.00.00.01920.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0)\renewcommand{\Bold}[1]{\mathbf{#1}}C_3 - C = \left(\begin{array}{rrrrrrr} 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.01 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0045 & 0.0987 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0256 & 0.0382 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0192 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \end{array}\right)
show(LatexExpr(r"\text{Eigenvalues of $C_3$:}")) for evalue in C3.eigenvalues(): show(round_complex(evalue, 5))
Eigenvalues of C3:\renewcommand{\Bold}[1]{\mathbf{#1}}\text{Eigenvalues of $C_3$:}
0.13101+0.16979i\renewcommand{\Bold}[1]{\mathbf{#1}}-0.13101 + 0.16979i
0.131010.16979i\renewcommand{\Bold}[1]{\mathbf{#1}}-0.13101 - 0.16979i
1.05704\renewcommand{\Bold}[1]{\mathbf{#1}}1.05704
0.79315+0.2994i\renewcommand{\Bold}[1]{\mathbf{#1}}0.79315 + 0.2994i
0.793150.2994i\renewcommand{\Bold}[1]{\mathbf{#1}}0.79315 - 0.2994i
0.33159+0.18977i\renewcommand{\Bold}[1]{\mathbf{#1}}0.33159 + 0.18977i
0.331590.18977i\renewcommand{\Bold}[1]{\mathbf{#1}}0.33159 - 0.18977i
T3 = transformation_matrix(C3) D3 = T3.inverse()*C3*T3 show(r"\tilde{D}_3 = " + latex(make_block_diagonal(D3.round(5))))
D~3=(0.131010.169790.00.00.00.00.00.169790.131010.00.00.00.00.00.00.01.057040.00.00.00.00.00.00.00.793150.29940.00.00.00.00.00.29940.793150.00.00.00.00.00.00.00.331590.189770.00.00.00.00.00.189770.33159)\renewcommand{\Bold}[1]{\mathbf{#1}}\tilde{D}_3 = \left(\begin{array}{rr|r|rr|rr} -0.13101 & 0.16979 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ -0.16979 & -0.13101 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 \\ \hline 0.0 & 0.0 & 1.05704 & 0.0 & 0.0 & 0.0 & 0.0 \\ \hline 0.0 & 0.0 & 0.0 & 0.79315 & 0.2994 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 & -0.2994 & 0.79315 & 0.0 & 0.0 \\ \hline 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.33159 & 0.18977 \\ 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & -0.18977 & 0.33159 \end{array}\right)
show(LatexExpr(r"\text{The absolute values of the eigenvalues:}")) for evalue in C3.eigenvalues(): if evalue.imag() or evalue < 0: show(r"|" + latex(round_complex(evalue, 4)) + r"| = " + latex(round(abs(evalue), 4))) else: show(round(abs(evalue), 4))
The absolute values of the eigenvalues:\renewcommand{\Bold}[1]{\mathbf{#1}}\text{The absolute values of the eigenvalues:}
0.131+0.1698i=0.2145\renewcommand{\Bold}[1]{\mathbf{#1}}| -0.131 + 0.1698i | = 0.2145
0.1310.1698i=0.2145\renewcommand{\Bold}[1]{\mathbf{#1}}| -0.131 - 0.1698i | = 0.2145
1.057\renewcommand{\Bold}[1]{\mathbf{#1}}1.057
0.7931+0.2994i=0.8478\renewcommand{\Bold}[1]{\mathbf{#1}}| 0.7931 + 0.2994i | = 0.8478
0.79310.2994i=0.8478\renewcommand{\Bold}[1]{\mathbf{#1}}| 0.7931 - 0.2994i | = 0.8478
0.3316+0.1898i=0.3821\renewcommand{\Bold}[1]{\mathbf{#1}}| 0.3316 + 0.1898i | = 0.3821
0.33160.1898i=0.3821\renewcommand{\Bold}[1]{\mathbf{#1}}| 0.3316 - 0.1898i | = 0.3821
state = vector([100.0] * 7) discrete_linear_interactive(C3, state, pre_text=life_stages)
state = vector([100.0] * 7) discrete_linear_interactive(C3, state, pre_text=life_stages, show_distribution=True)

Success! ☺



New conclusion: We must protect juveniles, and especially larger juveniles.

display(YouTubeVideo("hIJvSymWsCc", start=62))
display(YouTubeVideo("y71cgxmyMO4", start=246))

The happy ending to this story:

This paper was published in 1987. That same year, the U.S. Congress passed a law requiring all shrimp trawling boats in the U.S. to use nets equipped with a turtle excluder device (TED).

A few years later, an international treaty was signed, requiring shrimp fishers from most other developed nations to use TEDs on their nets. The U.S. also passed, with support from the World Trade Organization, a trade embargo that prohibits the import of shrimp from countries that do not require TEDs.

While loggerhead sea turtles are still considered a threatened species, the populations in the southeastern U.S. have recovered significantly since the 1980s.

In short: This math paper has helped to save the loggerhead sea turtles!