3.2 求下列差分方程的解 X(n+2)-X(n+1)-2X(n)=0 X(0)=X(1)=-2
点击查看代码
def X(n):
# 差分方程的解
return 2 * (-1)**(n + 1)
n_values = [0, 1, 2, 3, 4, 5]
for n in n_values:
print(f"X({n}) = {X(n)}")
print("学号:3004")
def X(n):
# 差分方程的解
return 2 * (-1)**(n + 1)
n_values = [0, 1, 2, 3, 4, 5]
for n in n_values:
print(f"X({n}) = {X(n)}")
print("学号:3004")