sponge.function.Energy

View Source On Gitee
class sponge.function.Energy(value: float, unit: str = 'kj/mol', **kwargs)[source]

Energy.

Parameters
  • value (float) – energy value.

  • unit (str) – energy value unit. Default: 'kl/mol'

  • kwargs – other arguments.

Supported Platforms:

Ascend GPU CPU

Examples

>>> from sponge.function import Energy
>>> ene = Energy(1.0, 'kcal/mol')
>>> ene.change_unit('kj/mol')
<sponge.function.units.Energy at 0x7f415483eac0>
>>> ene.value
4.184
property abs_size: float

absolute size of energy.

Returns

float, the absolute size of energy.

change_unit(unit)[source]

change unit.

Parameters

unit (Union[str, Units, float, int]) – Energy unit.

property ref: float

reference value.

Returns

float, the reference value of energy.

property unit: str

energy unit.

Returns

str, the unit of energy value.

property unit_name: str

name of energy unit.

Returns

str, the name of energy unit.

property value: float

value of energy.

Returns

float, the value of energy.