



'''simple docstring'''


from math import factorial, pi







def 				__lowerCamelCase				(   A__    ,						A__ = 30    )       ->	float:






   """simple docstring"""

   if not isinstance(A__    ,						(int, float)    ):
      raise ValueError('maclaurin_sin() requires either an int or float for theta'    )

   if not isinstance(A__    ,						A__    ) or accuracy <= 0:
      raise ValueError('maclaurin_sin() requires a positive int for accuracy'    )

   UpperCamelCase					=  float(A__    )
   UpperCamelCase					=  theta // (2 * pi)
   theta -= 2 * div * pi
   return sum(
       (-1) ** r * theta ** (2 * r + 1) / factorial(2 * r + 1    ) for r in range(A__    )    )







def 				__lowerCamelCase				(   A__    ,						A__ = 30    )       ->	float:






   """simple docstring"""

   if not isinstance(A__    ,						(int, float)    ):
      raise ValueError('maclaurin_cos() requires either an int or float for theta'    )

   if not isinstance(A__    ,						A__    ) or accuracy <= 0:
      raise ValueError('maclaurin_cos() requires a positive int for accuracy'    )

   UpperCamelCase					=  float(A__    )
   UpperCamelCase					=  theta // (2 * pi)
   theta -= 2 * div * pi
   return sum((-1) ** r * theta ** (2 * r) / factorial(2 * r    ) for r in range(A__    )    )


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   print(maclaurin_sin(10))
   print(maclaurin_sin(-10))
   print(maclaurin_sin(10, 15))
   print(maclaurin_sin(-10, 15))

   print(maclaurin_cos(5))
   print(maclaurin_cos(-5))
   print(maclaurin_cos(10, 15))
   print(maclaurin_cos(-10, 15))


'''simple docstring'''





from math import log

from scipy.constants import Boltzmann, physical_constants

SCREAMING_SNAKE_CASE_:     Optional[int]  =3_00  # TEMPERATURE (unit = K)





def 	lowerCAmelCase_				(					snake_case_       : float					,    snake_case_       : float					,    snake_case_       : float					,    )    ->      float:


     '''simple docstring'''




     if donor_conc <= 0:
          raise ValueError("Donor concentration should be positive"			)
     elif acceptor_conc <= 0:
          raise ValueError("Acceptor concentration should be positive"			)
     elif intrinsic_conc <= 0:
          raise ValueError("Intrinsic concentration should be positive"			)
     elif donor_conc <= intrinsic_conc:
          raise ValueError(
              "Donor concentration should be greater than intrinsic concentration"			)
     elif acceptor_conc <= intrinsic_conc:
          raise ValueError(
              "Acceptor concentration should be greater than intrinsic concentration"			)
     else:
          return (
              Boltzmann
              * T
              * log((donor_conc * acceptor_conc) / intrinsic_conc**2			)
              / physical_constants["electron volt"][0]
          )


if __name__ == "__main__":
    import doctest

    doctest.testmod()




