Skip to content

Commit eb6fbf2

Browse files
committed
Fixed a minor memory fix
1 parent b911790 commit eb6fbf2

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

runge_kutta_4_system.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def rk4_system(f, f_actual, t, y, p, h, N):
44
n = int((p-t)/h)
55
zeroes = [0 for i in range(N)]
66
k = [zeroes.copy() for i in range(4)]
7-
y_temp = [0]*N
7+
y_temp = zeroes.copy()
88
results = [zeroes.copy() for i in range(n)]
99

1010
for i in range(n):
@@ -19,7 +19,6 @@ def rk4_system(f, f_actual, t, y, p, h, N):
1919
for j in range(N): # Filling in the k2_x for all given functions
2020
k[1][j] = h*f[j](t+h/2, *y_temp)
2121

22-
2322
for j in range(N): # Again need to update the y's for k3_x calculations
2423
y_temp[j] = y[j] + k[1][j]/2
2524

0 commit comments

Comments
 (0)