Index Error: index 1 is out of bounds for axis 0 with size 1

Estou tendo o seguinte erro ao tentar gerar uma matriz, mas estou tendo erro ao utilizar o comando for, ao final do problema.

``````import numpy as np

#1. Dados do material e da barra
A=(0.3*0.15) #area total
#print(A)
L=2.5
a=L/2
I=((0.3*(0.15)**3)/12)
#print(I)

nnodes= 14 #numero de nos
nel=  25   #numero de elementos
ndof= 3   #numero de GDL por no
nnel= 2   #numero de nos por elemento
edof= ndof*nnel   #numero de GDL por elemento
sdof= nnodes*ndof  #numero de GDL do sistema

gcoord=np.array([[0,0],[2.5,0],[5,0],[7.5,0],[2.5,2.5],[5,2.5],[2.5,5],[5,5],[7.5,5],[10,5],[2.5,7.5],[5,7.5],[7.5,7.5],[10,7.5]])
#print(gcoord)

nodes=np.array([[1,2],[2,3],[3,4],[1,5],[2,5],[2,6],[3,6],[4,6],[5,6],[5,7],[5,8],[6,8],[7,8],[7,11],[11,8],[8,12],[11,12],[8,9],[8,13],[9,13],[12,13],[9,10],[10,13],[10,14],[13,14]])

#6. Matriz de Rigidez
K=np.zeros((sdof,sdof))
#print(K)
for i in range (0,nel):
deltay=gcoord[nodes[i,1]-1,1]-gcoord[nodes[i,0]-1,1]
deltax=gcoord[nodes[i,1]-1,0]-gcoord[nodes[i,0]-1,0]

theta=np.arctan(deltay/deltax) #angulo de rotacao

c=np.cos(theta)
s=np.sin(theta)
R=np.array([[c,s,0,0,0,0],[-s,c,0,0,0,0],[0,0,1,0,0,0],[0,0,0,c,s,0],[0,0,0,-s,c,0],[0,0,0,0,0,1]]) #matriz de rotacao
#print(R)
L=np.sqrt(deltax**2+deltay**2)
ke=((E*I)/(L**3))*np.array([[((A*(L**2))/I),0,0,-((A*(L**2))/I),0,0],[0,12,6*L,0,-12,6*L],[0,6*L,(4*(L**2)),0,-6*L,(2*(L**2))],[-((A*(L**2))/I),0,0,((A*(L**2))/I),0,0],[0,-12,-6*L,0,12,-6*L],[0,6*L,(2*(L**2)),0,-6*L,(4*(L**2))]])
Rt=np.transpose(R)
Ke=Rt*ke*R #matriz de rigidez do sistema global
#print(Ke)

index=np.array([[3*nodes[i,0]-3,3*nodes[i,0]-2,3*nodes[i,0]-1,3*nodes[i,1]-3,3*nodes[i,1]-2,3*nodes[i,1]-1]])
for m in range (0,edof):
for n in range (0,edof):
K[index[m],index[n]]+=Ke[m,n]+K[index[m],index[n]]
print (K)
``````

O erro está na linha:

`````` K[index[m],index[n]]+=Ke[m,n]+K[index[m],index[n]]
``````

E recebo a seguinte mensagem: Index Error: index 1 is out of bounds for axis 0 with size 1