Popular recipes tagged "discrete"http://code.activestate.com/recipes/tags/discrete/popular/2016-03-03T07:12:28-08:00ActiveState Code RecipesGet the inversion number of a permutation (Python) 2016-02-21T06:00:46-08:00Samuel James Ericksonhttp://code.activestate.com/recipes/users/4187478/http://code.activestate.com/recipes/579051-get-the-inversion-number-of-a-permutation/ <p style="color: grey"> Python recipe 579051 by <a href="/recipes/users/4187478/">Samuel James Erickson</a> (<a href="/recipes/tags/combinatorics/">combinatorics</a>, <a href="/recipes/tags/discrete/">discrete</a>, <a href="/recipes/tags/inversion/">inversion</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/permutations/">permutations</a>). Revision 2. </p> <p>This function takes a permutation in the form of a list and returns the number of inversions in the permutation. </p> Extended Euclidean Algorithm (Python) 2016-03-03T07:12:28-08:00Samuel James Ericksonhttp://code.activestate.com/recipes/users/4187478/http://code.activestate.com/recipes/578631-extended-euclidean-algorithm/ <p style="color: grey"> Python recipe 578631 by <a href="/recipes/users/4187478/">Samuel James Erickson</a> (<a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/common/">common</a>, <a href="/recipes/tags/discrete/">discrete</a>, <a href="/recipes/tags/divisor/">divisor</a>, <a href="/recipes/tags/euclid/">euclid</a>, <a href="/recipes/tags/extended/">extended</a>, <a href="/recipes/tags/gcd/">gcd</a>, <a href="/recipes/tags/greatest/">greatest</a>, <a href="/recipes/tags/logarithm/">logarithm</a>). Revision 2. </p> <p>given input of integers a and b, this program returns GCD(a,b) along with integers x and y such that ax+by=GCD(a,b).</p> Discrete PID Controller (Python) 2015-12-18T20:59:43-08:00Canerhttp://code.activestate.com/recipes/users/4114638/http://code.activestate.com/recipes/577231-discrete-pid-controller/ <p style="color: grey"> Python recipe 577231 by <a href="/recipes/users/4114638/">Caner</a> (<a href="/recipes/tags/controller/">controller</a>, <a href="/recipes/tags/derivative/">derivative</a>, <a href="/recipes/tags/discrete/">discrete</a>, <a href="/recipes/tags/integral/">integral</a>, <a href="/recipes/tags/pid/">pid</a>, <a href="/recipes/tags/proportional/">proportional</a>, <a href="/recipes/tags/python/">python</a>). </p> <p>The recipe gives simple implementation of a Discrete Proportional-Integral-Derivative (PID) controller. PID controller gives output value for error between desired reference input and measurement feedback to minimize error value. More information: <a href="http://en.wikipedia.org/wiki/PID_controller" rel="nofollow">http://en.wikipedia.org/wiki/PID_controller</a></p> <p><strong>For new version please check:</strong> <a href="https://github.com/ivmech/ivPID" rel="nofollow">https://github.com/ivmech/ivPID</a></p>