Exemplo n.º 1
0
    def evaluate(self, theta, u_P, n, t):
        """
        
        """
        self.matrix[-1, 0:2] = self._sign * np.dot(A_theta_matrix(theta), t)

        #    body i
        if self.id == 0:
            _theta_i = theta
            #    second partial derivative of t_i with respect to s_i
            _dt_i_ds_i = d_ds(t)
            _theta_j = self._parent.body_list[1].theta[2]
            _n_j = self._parent._n_list[1]
            self.matrix[-1, -1] = self._sign * np.dot(
                np.dot(A_2theta_matrix(_theta_i), _dt_i_ds_i),
                np.dot(A_matrix(_theta_j), _n_j))

        #    body j
        elif self.id == 1:
            _theta_i = self._parent.body_list[0].theta[2]
            _t_i = self._parent._t_list[0]
            _theta_j = theta
            #    second partial derivative of n_j with respect to s_j
            _dn_j_ds_j = d_ds(n)
            self.matrix[-1, -1] = self._sign * np.dot(
                np.dot(A_matrix(_theta_i), _t_i),
                np.dot(A_2theta_matrix(_theta_j), _dn_j_ds_j))
Exemplo n.º 2
0
def d2_ds2(node):
    """
    Function numerically calculates a second derivative d2/ds2 of node that defines a vector (line) 
    to calculate derivative
    """
    _d_ds = d_ds(node)

    _d2_ds2 = d_ds(_d_ds)

    return _d2_ds2
Exemplo n.º 3
0
def d2_ds2(node):
    """
    Function numerically calculates a second derivative d2/ds2 of node that defines a vector (line) 
    to calculate derivative
    """
    _d_ds = d_ds(node)
    
    
    _d2_ds2 = d_ds(_d_ds)
    
    
    return _d2_ds2
Exemplo n.º 4
0
    def evaluate(self, theta, u_P, n,
                 t):  #    manjka se tretja komponenta od produkta n.t
        """
        Function calculate values in predefined zero matrix
        """
        dt_ds = d_ds(t)
        self.matrix[0:2] = self._sign * np.dot(A_matrix(theta), dt_ds)

        #    body i
        if self.id == 0:
            _theta_i = theta
            _t_i = d2_ds2(t)
            _theta_j = self._parent.body_list[1].theta[2]
            _n_j = self._parent._n_list[1]
            self.matrix[-1] = self._sign * np.dot(
                np.dot(A_2theta_matrix(_theta_i), _t_i),
                np.dot(A_matrix(_theta_j), _n_j))

        #    body j
        elif self.id == 1:
            _theta_i = self._parent.body_list[0].theta[2]
            _t_i = self._parent._t_list[0]
            _theta_j = theta
            _n_j = d2_ds2(n)
            self.matrix[-1] = self._sign * np.dot(
                np.dot(A_matrix(_theta_i), _t_i),
                np.dot(A_2theta_matrix(_theta_j), _n_j))
Exemplo n.º 5
0
    def evaluate(self, theta, u_P, n, t):
        """
        
        """
        self.matrix[-1, 0:2] = self._sign * np.dot(A_theta_matrix(theta), t)

        #    body i
        if self.id == 0:
            _theta_i = theta
            #    second partial derivative of t_i with respect to s_i
            _dt_i_ds_i = d_ds(t)
            _theta_j = self._parent.body_list[1].theta[2]
            _n_j = self._parent._n_list[1]
            self.matrix[-1, -1] = self._sign * np.dot(np.dot(A_2theta_matrix(_theta_i), _dt_i_ds_i), np.dot(A_matrix(_theta_j), _n_j))
        
        #    body j
        elif self.id == 1:
            _theta_i = self._parent.body_list[0].theta[2]
            _t_i = self._parent._t_list[0]
            _theta_j = theta
            #    second partial derivative of n_j with respect to s_j
            _dn_j_ds_j = d_ds(n)
            self.matrix[-1, -1] = self._sign * np.dot(np.dot(A_matrix(_theta_i), _t_i), np.dot(A_2theta_matrix(_theta_j), _dn_j_ds_j))
Exemplo n.º 6
0
    def evaluate(self, theta, u_P, n, t):  #    manjka se tretja komponenta od produkta n.t
        """
        Function calculate values in predefined zero matrix
        """
        dt_ds = d_ds(t)
        self.matrix[0:2] = self._sign * np.dot(A_matrix(theta), dt_ds)

        
        #    body i
        if self.id == 0:
            _theta_i = theta
            _t_i = d2_ds2(t)
            _theta_j = self._parent.body_list[1].theta[2]
            _n_j = self._parent._n_list[1]
            self.matrix[-1] = self._sign * np.dot(np.dot(A_2theta_matrix(_theta_i), _t_i), np.dot(A_matrix(_theta_j), _n_j))
        
        #    body j
        elif self.id == 1:
            _theta_i = self._parent.body_list[0].theta[2]
            _t_i = self._parent._t_list[0]
            _theta_j = theta
            _n_j = d2_ds2(n)
            self.matrix[-1] = self._sign * np.dot(np.dot(A_matrix(_theta_i), _t_i), np.dot(A_2theta_matrix(_theta_j), _n_j))