修改龙格库塔bug

This commit is contained in:
2025-06-17 00:07:14 +08:00
parent 08d293657d
commit fc0e7cec5f
7 changed files with 357 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ def ClassicRK(x0,y0,h,xk,fxy):
k2 = fxy(x0+h/2,y0+h*k1/2)
k3 = fxy(x0+h/2,y0+h*k2/2)
k4 = fxy(x0+h,y0+h*k3)
y0 += h*(k1+4*k2+k3)/6
y0 += h*(k1+2*k2+2*k3+k4)/6
x0 += h
result.append((x0,y0))
return result