#NEWLINE# def __init__( self , amplitude , frequency = None , phase = S . Zero , time_period = None , n = Symbol ( 'n' ) ) : #NEWLINE# #INDENT# frequency = sympify ( frequency ) #NEWLINE# amplitude = sympify ( amplitude ) #NEWLINE# phase = sympify ( phase ) #NEWLINE# time_period = sympify ( time_period ) #NEWLINE# n = sympify ( n ) #NEWLINE# self . _frequency = frequency #NEWLINE# self . _amplitude = amplitude #NEWLINE# self . _phase = phase #NEWLINE# self . _time_period = time_period #NEWLINE# self . _n = n #NEWLINE# if ( time_period is not None ) : #NEWLINE# #INDENT# self . _frequency = ( 1 / amplitude . _time_period ) #NEWLINE# #UNINDENT# if ( frequency is not None ) : #NEWLINE# #INDENT# self . _time_period = ( 1 / self . _frequency ) #NEWLINE# if ( time_period is not None ) : #NEWLINE# #INDENT# if ( frequency != ( 1 / time_period ) ) : #NEWLINE# #INDENT# raise ValueError ( 'frequency and time_period should be consistent.' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( frequency is None ) and ( time_period is None ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Either frequency or time period is needed.' )