FlaminMad / researchProject

Level Control Research Project Repo
MIT License
0 stars 0 forks source link

Assign useful variable names #1

Closed pet1330 closed 9 years ago

pet1330 commented 9 years ago

The following are confusing, assign variable names which are actually useful! :stuck_out_tongue:

    x0 = numpy.array([1.0,1.0])

    def func(self,params,y,u,Y):
        #structure of function to be minimised
        return (Y - (params[0]*y + params[1]*u))

    def solve(self,y,u,Y):
        #run least squares algorithm - add try statement here
        ans = opt.leastsq(self.func,self.x0, args=(y,u,Y))
        #translate answers
        self.x0[0] = ans[0][0]
        self.x0[1] = ans[0][1]
        #for debugging - REMOVE LATER
        print self.x0

That's just an example! You need to use useful variable names thoughout! :stuck_out_tongue:

pet1330 commented 9 years ago

Same with file names! :stuck_out_tongue:

FlaminMad commented 9 years ago

Im working on this one I swear!

Quite a few o0f the variable names that are seeminly useless are actually engineering notation for various things. So as an example x, y, u, t, OP, SP all mean specific things.

Still got to sort the revision xx files out. Getting there though!

pet1330 commented 9 years ago

:+1:

FlaminMad commented 9 years ago

This should be sorted now! :dart: