Skip to content

Cannot convert 'complex' with non-zero imaginary component to 'double' #2878

@calvinp0

Description

@calvinp0

Bug Description

Running an input.py file for ammonia and during the model check I get:

Making seed mechanism...
Performing final model checks...
/home/supervisor/Code/RMG-Py/rmgpy/rmg/main.py:1488: RuntimeWarning: divide by zero encountered in log
  violator_list = rxn.check_collision_limit_violation(t_min=self.Tmin, t_max=self.Tmax, p_min=self.Pmin, p_max=self.Pmax)
Traceback (most recent call last):
  File "/home/supervisor/Code/RMG-Py/rmg.py", line 4, in <module>
    __main__.main()
  File "/home/supervisor/Code/RMG-Py/rmgpy/__main__.py", line 102, in main
    rmg.execute(**kwargs)
  File "/home/supervisor/Code/RMG-Py/rmgpy/rmg/main.py", line 1244, in execute
    self.check_model()
  File "/home/supervisor/Code/RMG-Py/rmgpy/rmg/main.py", line 1488, in check_model
    violator_list = rxn.check_collision_limit_violation(t_min=self.Tmin, t_max=self.Tmax, p_min=self.Pmin, p_max=self.Pmax)
  File "rmgpy/reaction.py", line 1704, in rmgpy.reaction.Reaction.check_collision_limit_violation
  File "rmgpy/reaction.py", line 1737, in rmgpy.reaction.Reaction.check_collision_limit_violation
  File "rmgpy/kinetics/arrhenius.pyx", line 129, in rmgpy.kinetics.arrhenius.Arrhenius.get_rate_coefficient
  File "rmgpy/kinetics/arrhenius.pyx", line 139, in rmgpy.kinetics.arrhenius.Arrhenius.get_rate_coefficient
TypeError: Cannot convert 'complex' with non-zero imaginary component to 'double' (this most likely comes from the '**' operator; use 'cython.cpow(True)' to return 'nan' instead of a complex number).

How To Reproduce

Running the input file attached. I realise it is not the best input file or with the best libraries etc. but I have seen this issue pop up with other users input files.

Installation Information

Describe your installation method and system information.

  • OS (include version if known): Ubuntu 24.04
  • Installation method: Source
  • RMG version information:
    • RMG-Py: 3.3.0-54-g8f3b85d6b
    • RMG-database: 3.3.0-2-g6bbe93aa2

input.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions