Package: pmxutils
PMXUtilsTools for ProgModXNote that the package is in development and may undergo frequent updatesInstall withpython -m pip install pmxutilsfor windows andpython3 -m pip install pmxutilsfor unix/linuxTable of contentMathtoolsconstructadvConstructcomputeListnewtonisInbetweenrectangleIntegraltrapezoidIntegralsimpsonIntegraleulerlemmaOtherprofileloadingstartstopanimateMathtools (pmxutils.mathtools)construct(expression, var=x)Returns a function computing the given expressionexpression- The mathematical expression to compute, type = stringvar- The variable used in the mathematical expression, defaults tp 'x', type = string`advConstruct(expression, *args, constants = {})Returns a function computing the given expressionexpression- The mathematical expression to compute, type = stringargs- Any number of individual arguments naming the variables used in the expresion, type = stringconstants- A dictionary with any numerical constants in the expression, type = dictcomputeLists(function, low, high, step=1)Returns a touple of two lists containing x values inbetween low and high, and the computed results for y. In the format of (x_list, y_list)low- The lower end of the function limit, type = numberhigh- The upper end of the function limit, type = numberfunction- The mathematical expression to use for y value computation, type = string or function from constructstep- The step size in the x value list, defaults to '1', type = numbernewton(function, derivative, low, high, tolerance=1e-8, rounding = 3, iterations = 1000)Uses Newtons way of finding the root of a function, using the function and its derivative, within the given limits.Returns None if it can't find a solution that satisfies the tolerance after the defined number of terationsfunction- The target mathematical expression, type = string or function from constructderivative- The derivative of the target mathematical expression, type = string or function from constructlow- The lower end of the are which should be checked for roots, type = numberhigh- The upper end of the are which should be checked for roots, type = numbertolerance- The tolerance for error to speed up computation, defaults to '1e-8', type = numberrounding- Rounds the x value for the root to the specified amount of decimals, defaults to '3', type = numberiterations- The number of tries, after which the function will end earlyisInbetween(number, low, high)Returns True if number is inbetween limOne and limTwo, returns False otherwisenumber- The number to be checked, type = numberlow- The lower limit for which the number is checked, type = numberhigh- The upper limit for which the number is checked, type = numberrectangleIntegral(function, low, high, n)Returns the numerically calculated integral of the function f inbetween a and b using n rectanglesfunction- The function to integrate, type = string or function from constructlow- The low end of the area to be computed, type = numberhigh- The high end of the area to be computed, type = numbern- The number of rectangles to use, type = inttrapezoidIntegral(function, low, high, n)Returns the numerically calculated integral of the function f inbetween a and b using n trapezoidsfunction- The function to integrate, type = string or function from constructlow- The low end of the area to be computed, type = numberhigh- The high end of the area to be computed, type = numbern- The number of trapezoids to use, type = intsimpsonIntegral(function, low, high, n)Returns the numerically calculated integral of the function inbetween low and high using n quadratic splinesfunction- The function to integrate, type = string or function from constructlow- The low end of the area to be computed, type = numberhigh- The high end of the area to be computed, type = numbern- The number of quadratic splines to use, type = inteuler(functionDerivative, low, high, y0, n)Returns a numpy array x, containing the x values of the function, and an array F, containing the computed values for the antiderivative function of the given function functionDerivative inbetween low and high with N stepsOnly supports functions with one variablefunctionDerivative- The derivative of the goal function, type = string or function from constructlow- The low end of the function to be computed, type = numberhigh- The high end of the area to be computed, type = numbery0- The initial value of the goal functionn- The number of computations to performlemma(a, b)Returns the greatest common denominator of a and b using the lemma algorithma- The first numberb- The second numberOther (pmxutils.other)profile(function)Time profiler. Prints out the elapsed time during function executionfunction- The function to profile, type = functionloading()Loading classstart(flavor="loading")Starts a loading sequenceflavor- The message to be displayed during loading, defaults to 'loading', type = stringstop()Stops the loading sequenceanimate()DO NOT USE, internal function