-- this function extracts G_ij response function of Block List of Poles Response Function object function ScalarResponseFunctionFromBlockListOfPolesResponseFunction(G0,i,j) local G0T = ResponseFunction.ToTable(G0) local k local A0_ij = G0T[1][1][i][j] local ai = G0T[1] table.remove(ai,1) --remove matrix A0 table.insert(ai,1,A0_ij) -- add number A0_ij local bw_ij = {} for k=1,#G0T[2] do -- from k=1 to NE bw_ij[#bw_ij+1] = G0T[2][k][i][j] end G_ij = ResponseFunction.New( {ai,bw_ij,mu=0,type="ListOfPoles", name="G0"} ) return G_ij end