Items tagged with array

hello, For the P, and A arrays which depend on i,j, it always gives me index out of range i dont know whats wrong, any help, and thank you
 

 

restart

N:=4000;
g:=Array(0..N):
g[0]:=0:
g[1]:=-2.47:
g[2]:=-2.33:
g[3]:=0.205:
g[4]:=2.99:
g[5]:=2.66:
g[6]:=2.65:
g[7]:=2.59:
g[8]:=2.5:
g[9]:=2.42:
g[10]:=2.37:
g[11]:=2.37:
g[12]:=2.39:
g[13]:=2.42:
g[14]:=2.43:
g[15]:=2.42:
g[16]:=2.4:
g[17]:=2.39:
g[18]:=2.39:
g[19]:=2.39:
g[20]:=2.38:
g[21]:=2.37:
g[22]:=2.36:
g[23]:=2.35:
g[24]:=2.34:
g[25]:=2.34:
g[26]:=2.34:
g[27]:=2.35:
g[28]:=2.37:
g[29]:=2.38:
g[30]:=2.4:
g[31]:=2.41:
g[32]:=2.41:
g[33]:=2.4:
g[34]:=2.4:
g[35]:=2.4:
g[36]:=2.4:
g[37]:=2.4:
g[38]:=2.39:
g[39]:=2.36:
g[40]:=2.32:
g[41]:=2.29:
g[42]:=2.29:
g[43]:=2.35:
g[44]:=2.44:
g[45]:=2.53:
g[46]:=2.61:
g[47]:=2.68:
g[48]:=2.69:
g[49]:=2.59:
g[50]:=2.38:
g[51]:=2.13:
g[52]:=1.89:
g[53]:=1.68:
g[54]:=1.52:
g[55]:=1.55:
g[56]:=1.83:
g[57]:=2.26:
g[58]:=2.57:
g[59]:=2.56:
g[60]:=2.31:
g[61]:=2.12:
g[62]:=2.14:
g[63]:=2.36:
g[64]:=2.67:
g[65]:=2.94:
g[66]:=3.14:
g[67]:=3.27:
g[68]:=3.26:
g[69]:=3.03:
g[70]:=2.66:
g[71]:=2.41:
g[72]:=2.4:
g[73]:=2.55:
g[74]:=2.7:
g[75]:=2.75:
g[76]:=2.7:
g[77]:=2.54:
g[78]:=2.24:
g[79]:=1.84:
g[80]:=1.4:
g[81]:=0.959:
g[82]:=0.488:
g[83]:=-0.0341:
g[84]:=-0.501:
g[85]:=-0.776:
g[86]:=-0.866:
g[87]:=-0.959:
g[88]:=-1.28:
g[89]:=-1.9:
g[90]:=-2.68:
g[91]:=-3.42:
g[92]:=-3.84:
g[93]:=-3.72:
g[94]:=-3.22:
g[95]:=-2.66:
g[96]:=-2.26:
g[97]:=-1.99:
g[98]:=-1.73:
g[99]:=-1.38:
g[100]:=-1.14:
g[101]:=-1.3:
g[102]:=-1.92:
g[103]:=-2.8:
g[104]:=-3.81:
g[105]:=-4.84:
g[106]:=-5.75:
g[107]:=-6.53:
g[108]:=-7.28:
g[109]:=-8.12:
g[110]:=-8.86:
g[111]:=-9.17:
g[112]:=-8.96:
g[113]:=-8.51:
g[114]:=-7.96:
g[115]:=-7.17:
g[116]:=-6.13:
g[117]:=-5.21: