src/MOIRA.py
def stencil_gen(self, points, order):
        '''
        Generates finite difference equation based on the location of sampled points and derivative order

        Parameters:
            points (list int): stencil of length N needed ex: [-1,0,1] stencil around 0
            order (int > 0): the order of derivatives d, d<N

        Returns:
             the finite difference coefficients along with the points used in a dictionary
                {'points':[],'coefs':[]}

        Examples:
            >>> <DE>.stencil_gen(points=[-1,0],order=1)
        '''
        numPts = len(points)
        M = []
        for i in range(numPts):
            M.append([s ** i for s in points])
        M = Matrix(M)
        b = Matrix([factorial(order) * 1 if j == order else 0 for j in range(numPts)])
        coefs = list(M.inv() * b)
        return {'points': points, 'coefs': coefs}

        Generates finite difference equation based on the location of sampled points and derivative order

        Parameters:
            points (list int): stencil of length N needed ex: [-1,0,1] stencil around 0
            order (int > 0): the order of derivatives d, d<N

        Returns:
             the finite difference coefficients along with the points used in a dictionary
                {'points':[],'coefs':[]}

        Examples:
            >>> <DE>.stencil_gen(points=[-1,0],order=1)
        
Generates finite difference equation based on the location of sampled points and derivative order
Generates finite difference equation based on the location of sampled points and derivative order
def stencil_gen(self, points, order):
        numPts = len(points)
        M = []
        for i in range(numPts):
            M.append([s ** i for s in points])
        M = Matrix(M)
        b = Matrix([factorial(order) * 1 if j == order else 0 for j in range(numPts)])
        coefs = list(M.inv() * b)
        return {'points': points, 'coefs': coefs}
def stencil_gen ( self , points , order ) : numPts = len ( points ) M = [ ] for i in range ( numPts ) : M . append ( [ s ** i for s in points ] ) M = Matrix ( M ) b = Matrix ( [ factorial ( order ) * 1 if j == order else 0 for j in range ( numPts ) ] ) coefs = list ( M . inv ( ) * b ) return { 'points' : points , 'coefs' : coefs }
Generates finite difference equation based on the location of sampled points and derivative order
Generates finite difference equation based on the location of sampled points and derivative order
'''
        Generates finite difference equation based on the location of sampled points and derivative order

        Parameters:
            points (list int): stencil of length N needed ex: [-1,0,1] stencil around 0
            order (int > 0): the order of derivatives d, d<N

        Returns:
             the finite difference coefficients along with the points used in a dictionary
                {'points':[],'coefs':[]}

        Examples:
            >>> <DE>.stencil_gen(points=[-1,0],order=1)
        '''
the finite difference coefficients along with the points used in a dictionary
{'points':[],'coefs':[]}
the finite difference coefficients along with the points used in a dictionary { ' points ' : [] ' coefs ' : [] }
self
points
stencil of length N needed ex: [-1,0,1] stencil around 0
stencil of length N needed ex : [ - 1 0 1 ] stencil around 0
order
the order of derivatives d, d<N
the order of derivatives d d<N
examples
None