Skip to content

Commit 825e782

Browse files
authored
Update solve_time_iter.py
1 parent 7c99b66 commit 825e782

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
def solve_model_time_iter(model, # Class with model information
2-
σ, # Initial condition
1+
def solve_model_time_iter(model, # 含有模型信息的类
2+
σ, # 初始条件
33
tol=1e-4,
44
max_iter=1000,
55
verbose=True,
66
print_skip=25):
77

8-
# Set up loop
8+
# 设置迭代循环
99
i = 0
1010
error = tol + 1
1111

@@ -14,12 +14,12 @@ def solve_model_time_iter(model, # Class with model information
1414
error = np.max(np.abs(σ - σ_new))
1515
i += 1
1616
if verbose and i % print_skip == 0:
17-
print(f"Error at iteration {i} is {error}.")
17+
print(f"{i} 次迭代的误差为 {error}")
1818
σ = σ_new
1919

2020
if error > tol:
21-
print("Failed to converge!")
21+
print("未能收敛!")
2222
elif verbose:
23-
print(f"\nConverged in {i} iterations.")
23+
print(f"\n{i} 次迭代后收敛。")
2424

2525
return σ_new

0 commit comments

Comments
 (0)