resString += "total time[sec] needed: " + str(endT) + "\n" resString += "avg time per step[sec]: " + str(endT/len(simValues_A)) + "\n\n" # resString += "max fun value: " + str(max(fun_dip)) + "\n\n" print resString f.write(resString) datAc.saveStates(folderStr+"estAng_dip"+str(i), estAng_dip) plo.plotter2d((estAng_dip[:,:3], estAng_dip[:,3:6]), ("model: dip without Adduction index","middle"+methString)) # plo.plotter2d((estAng_dip[:,:3], estAng_dip[:,3:6], estAng_dip[:,6:9], estAng_dip[:,9:]), # ("model: dip without Adduction index","middle"+methString,"ring","pinky")) plt.savefig(folderStr+str(i)+"dip_nA.png") ''' cyl without ad-ab ''' startT = time.time() estAng_cyl = modC.estimateSeries(b_cyl_A, fingList, sensList, jointList, bnds=True, met=i) endT = time.time()-startT resString = "model: cylindrical, without adduction-abduction\n" resString += "total time[sec] needed: " + str(endT) + "\n" resString += "avg time per step[sec]: " + str(endT/len(simValues_A)) + "\n\n" # resString += "max fun value: " + str(max(fun_cyl)) + "\n\n" print resString f.write(resString) datAc.saveStates(folderStr+"estAng_cyl"+str(i), estAng_cyl) plo.plotter2d((estAng_cyl[:,:3], estAng_cyl[:,3:6]), ("model: cylindrical without Adduction index","middle"+methString)) # plo.plotter2d((estAng_cyl[:,:3], estAng_cyl[:,3:6], estAng_cyl[:,6:9], estAng_cyl[:,9:]), # ("model: cylindrical without Adduction index","middle"+methString,"ring","pinky")) plt.savefig(folderStr+str(i)+"cyl_nA.png")
(0.0,np.pi/2.)) # #startDip = time.time() #cnt = 0 #for i in b_dip[1:]: # print "dipole estimation step: ", cnt ## tmp = modD.estimate_BtoAng(estAng_dip[cnt],fingList_dip,jointList_dip,sensList_dip,i) # tmp = modD.estimate_BtoAng(estAng_dip[cnt],fingList,sensList,jointList,i,bnds=bnds_dip[:len(fingList)*2],method=2) ## print "function value: ", tmp.fun # estAng_dip[cnt+1] = tmp.x # fun_dip[cnt+1] = tmp.fun # # cnt += 1 # #timeDip = time.time()-startDip ang_d = modD.estimateSeries(b_dip,fingList,sensList,jointList,bnds=True,met=1) ang_c = modC.estimateSeries(b_cyl,fingList,sensList,jointList,bnds=True,met=1) plo.plotter2d((ang_d[:,:3],ang_c[:,:3]),("dipole","cyl")) #plo.plotter2d((angles_cyl,estAng_dip,ang_d,estAng_cyl,ang_c),("perfect","dip","dipPacked","cyl","cylPacked")) #plo.plotter2d((estAng_cyl, estAng_dip),("est cyl", "est dip"), mtitle='estimated angles') #print "time for cyl: ", timeCyl #print "max cyl: ", max(fun_cyl) #print "mean cyl: ", np.mean(fun_cyl) # #print "time for dip: ", timeDip #print "max cyl: ", max(fun_dip) #print "mean cyl: ", np.mean(fun_dip)