コード例 #1
0
 def test_different_functions_3(self):
     expr = Expression('sin(2/exp(x)+7*arcsin(x))')
     x = Symbol('x')
     self._check__values(
         Differentiation.diff(expr, x),
         'cos(2/exp(x)+7*arcsin(x))*((0*(exp(x))-(2)*'
         '(exp(x)))/(exp(x))^2+7*1/(1-(x)^2)^2)')
コード例 #2
0
 def test_hyperbolic_functions_2(self):
     expr = Expression('ch(x)')
     x = Symbol('x')
     self._check__values(Differentiation.diff(expr, x), 'sh(x)')
コード例 #3
0
 def test_inverse_trigonometrical_functions_4(self):
     expr = Expression('arcctg(x)')
     x = Symbol('x')
     self._check__values(Differentiation.diff(expr, x), '-1/(1+(x)^2)')
コード例 #4
0
 def test_trigonometrical_functions_6(self):
     expr = Expression('csc(x)')
     x = Symbol('x')
     self._check__values(Differentiation.diff(expr, x), '-ctg(x)*csc(x)')
コード例 #5
0
 def test_trigonometrical_functions_3(self):
     expr = Expression('tg(x)')
     x = Symbol('x')
     self._check__values(Differentiation.diff(expr, x), '1/cos(x)^2')
コード例 #6
0
 def test_exponential_functions_2(self):
     expr = Expression('ln(x)')
     x = Symbol('x')
     self._check__values(Differentiation.diff(expr, x), '1/(x)')
コード例 #7
0
 def test_symbol(self):
     expr = Expression('x')
     x = Symbol('x')
     self._check__values(Differentiation.diff(expr, x), '1')
コード例 #8
0
 def test_error_1(self):
     try:
         x = Symbol('xx')
         self.assertEqual(True, False)
     except ValueValidationError:
         self.assertEqual(True, True)
コード例 #9
0
 def test_calculations_3(self):
     expr = Expression('sin(x)+cos(x)')
     x = Symbol('x')
     self._check__values(Differentiation.diff(expr, x, value=1),
                         '-0.30116867893975674')
コード例 #10
0
 def test_calculations_2(self):
     expr = Expression('cos(x)')
     x = Symbol('x')
     self._check__values(Differentiation.diff(expr, x, value=1),
                         '-0.8414709848078965')
コード例 #11
0
 def test_calculations_1(self):
     expr = Expression('sin(x)')
     x = Symbol('x')
     self._check__values(Differentiation.diff(expr, x, value=1),
                         '0.5403023058681398')
コード例 #12
0
 def test_different_functions_2(self):
     expr = Expression('sin(2/exp(x))')
     x = Symbol('x')
     self._check__values(
         Differentiation.diff(expr, x), 'cos(2/exp(x))*((0*(exp(x))-'
         '(2)*(exp(x)))/(exp(x))^2)')
コード例 #13
0
 def test_different_functions_1(self):
     expr = Expression('sin(x)^2')
     x = Symbol('x')
     self._check__values(Differentiation.diff(expr, x),
                         'exp(2*ln(sin(x)))*(2*1/(sin(x))*(cos(x)))')