# Modeling Population Dynamics and Assessing Ecological Impacts of Lampreys via Sex Ratio Regulation
## 3 Resource-Dependent Sex Ratio Dynamics Model (RDSRD Model)
### Results Analysis  
In this subsection, we will perform experimental simulations using the previously developed two-population competition model and present and analyze the experimental results. In the analysis results, we employed the two hypotheses mentioned earlier:  
**Assumption 2:**_Variations in the sex ratio have a direct impact on the rate of reproduction and the size of the population._  
**Assumption 6:**_Once established, the sexes remain unchanged._  
Before comparing these two competing populations, we first give the algorithm for solving the differential equations and define two new metrics for comparison, including environmental resource utilization and reproductive success. The following Algorithm 1 is designed to address the differential equations in the intricate growth model introduced above. ```
1:the initial conditions: \(N_{i}(t=0)\), \(\mu_{i}\), \(\delta_{i}\), \(p_{i}\), \(\ldots\), iteration step \(h\) range
2:\(N_{i}(t)\) changes over time results
3:for\(i\) in \(h\) do
4:\(def\)\(ODE():\)
5:while\(t<t\_end\)do
6:\(\#\)\(Calculate\) the weight of a numerical integral(\(K_{i}\))
7:\(K_{1}\gets h\cdot f(t,N_{i})\)
8:\(K_{2}\gets h\cdot f(t+h/2,N_{i}+K_{i}/2)\)
9:\(K_{i}\)similar\(\ldots\)
10:\(\#\) Update \(N_{i}\)
11:\(N_{i}\gets N_{i}+(K_{1}+2\cdot K_{2}+2\cdot K_{3}+K_{4})/6\)
12:\(t\gets t+h\)
13:endwhile
14:return\(N_{i}(t)\) and determine convergence and error
15:end for
```  
**Algorithm 1**Fourth-order Runge-Kutta method solves ODE  
Figure 5 displays the outcomes of applying the aforementioned algorithm to model variations in lampreys' number and sex ratio over time, considering different conditions of food availability. The outcomes under conditions of food adequacy are depicted in Figure 5a, while Figure 5b presents the findings in scenarios of food scarcity. Comparing Figure 5a,b, we can see that in the first five years, the male ratio of the food-sufficient group was lower, while the male ratio of the food-deficient group was higher, which is consistent with the theory that \"males have a lower energy threshold for growth\". As time went on, the number of food-deficient groups dropped sharply and approached extinction. When contrasted, the proportion of males in the group lacking food was found to be lower. This indicates that the male ratio is affected by multiple factors and has an opposite trend over time. Over time, as depicted in Figure 5a,b, it becomes evident that the male ratio tends to stabilize at a specific value. Now, we will precisely analyze whether such a balance point exists. If it does exist, then:  
\[\frac{dN_{3}}{dt}=\frac{dN_{4}}{dt}=0 \tag{19}\]  
\[\frac{df}{dt}=0 \tag{20}\]From Equations (6) and (7), we can obtain:  
\[P_{m}\delta_{2}N_{2}-\delta_{3}N^{*}-\mu_{3}N_{3}=P_{f}\delta_{2}N_{2}-\delta_{3 }N^{*}-\mu_{4}N_{4} \tag{21}\]  
that is,  
\[P_{m}=\frac{1}{2}\bigg{(}\frac{\mu_{3}N_{3}-\mu_{4}N_{4}}{\delta_{2}N_{2}}+1 \bigg{)} \tag{22}\]  
From Equation (11), we can obtain:  
\[x=\frac{f}{N_{2}}=ln\frac{a_{2}}{b_{2}\cdot N_{2}} \tag{23}\]  
since \(x\) is one-to-one corresponding to \(P_{m}\), when \(P_{m}\) remains constant, by analyzing the above equation, we can conclude that the fluctuation of \(P_{m}\) depends on \(\frac{\mu_{3}N_{3}-\mu_{4}N_{4}}{b_{2}N_{2}}\):  
When \(\mu_{3}N_{3}>\mu_{4}N_{4}\), \(P_{m}\) is greater than \(\frac{1}{2}\). When \(\mu_{3}N_{3}<\mu_{4}N_{4}\), \(P_{m}\) is less than \(\frac{1}{2}\). When \(\mu_{3}N_{3}=\mu_{4}N_{4}\), \(P_{m}\) is equal to \(\frac{1}{2}\). The proportion of hatchery and juvenile lampreys was large and similar, with the sum of the two exceeding 80%, and the ratio of males to females gradually decreased from an initial 3:1 to nearly 1:1, as depicted in Figure 6.  
In summary, the complete population growth model of lampreys takes into account its life cycle stage pattern and sex determination mechanism and synthesizes the complexity and ecological dynamics of biological processes.