Hey guys,
hope somebody can help me out of my predicament.
Basically I have a list whose objects are lists of numbers and I need to use some numerical mathematics on it while keeping the old list to define the break criteria. This is my code so far:
So basically I used copies to work on. Python still overwrites the original and I get the same output for Horizontal and Field[j] even though it is only supposed to change the Field_new. Can anyone tell me how to keep the old list stored while changing the new one?
hope somebody can help me out of my predicament.
Basically I have a list whose objects are lists of numbers and I need to use some numerical mathematics on it while keeping the old list to define the break criteria. This is my code so far:
Code:
def Numerik(n,m,Field):
epsilon=1
Field_new=Field
while epsilon>0.001:
#inner nodes (explicit)
for j in range(1,m):
Horizontal_North=Field[j-1]
Horizontal_West_East=Field[j]
Horizontal_South=Field[j+1]
Horizontal=Field_new[j]
for i in range(1,n):
North=Horizontal_Nord[i]
West=Horizontal_West_East[i-1]
East=Horizontal_West_East[i+1]
South=Horizontal_South[i]
Point=(North+West+East+South)/4
Horizontal[i]=Point
Field_new[j]=Horizontal
print (Horizontal)
print (Field[j])
Comment