8.8
import numpy as np
import matplotlib.pyplot as plt
a = 1 - 0.2*(1/12)
m = 1.109 * 10**5
w3 = 17.86
w4 = 22.99
X = []
Z = []
for k in np.arange(0, 0.875, 0.001):
x1 = 1.221011 * (1 - 1 / (m * (1 - a - 0.42*k)8 * (1 - a)24 * (0.5 + (1 - a - k)8 * (1 - a)4)))
x2 = (1 - a)12 * x1
x3 = (1 - a)12 * x2
x4 = (1 - a - 0.42*k)8 * (1 - a)4 * x3
X.append([x1, x2, x3, x4])
z = (0.42kw3 * (1 - (1 - a - 0.42*k)8) / (a + 0.42k) * x3 +
kw4 * (1 - (1 - a - k)**8) / (a + k) * x4)
Z.append(z)
mz = max(Z)
ind = Z.index(mz)
print('最大生产量:', mz)
print('各年龄组鱼群数(在最大生产量对应的 k 值下):', X[ind])
print('对应的 k 值(用于索引计算,可能需要根据实际情况转换为实际 k 值):', ind * 0.001)
plt.plot(np.arange(0, 0.875, 0.001), Z)
plt.ylabel('Z')
plt.xlabel('k')
plt.title('总生产量 Z 随捕捞强度 k 的变化')
plt.grid(True)
plt.show()
print("学号:3022")