|
from visma.functions.structure import FuncOp |
|
from visma.functions.exponential import NaturalLog |
|
import math |
|
|
|
|
|
|
|
|
|
|
|
|
|
class Sinh(FuncOp): |
|
"""Class for sinh function -- sinh(...) |
|
|
|
Extends: |
|
FuncOp |
|
""" |
|
|
|
def __init__(self): |
|
super().__init__() |
|
self.value = 'sinh' |
|
|
|
def inverse(self, RHS): |
|
super().inverse(RHS) |
|
self.__class__ = ArcSinh |
|
|
|
def differentiate(self): |
|
super().differentiate() |
|
self.__class__ = Cosh |
|
|
|
def integrate(self): |
|
self.__class__ = Cosh |
|
|
|
def calculate(self, val): |
|
return self.coefficient * ((math.sinh(val))**self.power) |
|
|
|
|
|
class Cosh(FuncOp): |
|
"""Class for cosh function -- cosh(...) |
|
|
|
Extends: |
|
FuncOp |
|
""" |
|
|
|
def __init__(self): |
|
super().__init__() |
|
self.value = 'cosh' |
|
|
|
def inverse(self, RHS): |
|
super().inverse(RHS) |
|
self.__class__ = ArcCosh |
|
|
|
def differentiate(self): |
|
super().differentiate() |
|
self.__class__ = Sinh |
|
|
|
def integrate(self): |
|
self.__class__ = Sinh |
|
|
|
def calculate(self, val): |
|
return self.coefficient * ((math.cosh(val))**self.power) |
|
|
|
|
|
class Tanh(FuncOp): |
|
"""Class for tanh function -- tanh(...) |
|
|
|
Extends: |
|
FuncOp |
|
""" |
|
|
|
def __init__(self): |
|
super().__init__() |
|
self.value = 'tanh' |
|
|
|
def inverse(self, RHS): |
|
super().inverse(RHS) |
|
self.__class__ = ArcTanh |
|
|
|
def differentiate(self): |
|
super().differentiate() |
|
self.__class__ = Cosh |
|
|
|
def integrate(self): |
|
self.__class__ = NaturalLog |
|
|
|
def calculate(self, val): |
|
return self.coefficient * ((math.tanh(val)) ** self.power) |
|
|
|
|
|
|
|
|
|
|
|
|
|
class ArcSinh(FuncOp): |
|
pass |
|
|
|
|
|
class ArcCosh(FuncOp): |
|
pass |
|
|
|
|
|
class ArcTanh(FuncOp): |
|
pass |
|
|