Following up on a question posted here earlier:
GEKKO - optimization in matrix form
I notice that I can get specific values for q (optimal solution) when I reference them individually:
q[0,1] = [2.5432017412] q[0,2] = [3.7228765674]
I can also add these values individually:
q[0,1][0] + q[0,2][0] = 6.2660783086
I am not able to use the sum function to get the values of q however.E.g.(code: Output):
q[0].sum(): (((v1+v2)+v3)+v4)
sum(q[0,:]) : ((((0+v1)+v2)+v3)+v4)
q[0,:].sum(axis=0) : (((v1+v2)+v3)+v4)
I'm not sure why sum is not able to access the variables inside q. Do I need to perform any intermediate operation on the output (i.e. q)? Thanks,