ukaea/PROCESS

[BUG] f(a) and f(b) must have different signs

Closed this issue · 0 comments

Describe the bug

When writing out an output file, an error in scipy's root_scalar occurs.

Evidence

Traceback (most recent call last):
  File "/Users/timothynunn/process/.venv/bin/process", line 33, in <module>
    sys.exit(load_entry_point('process', 'console_scripts', 'process')())
  File "/Users/timothynunn/process/process/main.py", line 650, in main
    Process(args)
  File "/Users/timothynunn/process/process/main.py", line 127, in __init__
    self.run_mode()
  File "/Users/timothynunn/process/process/main.py", line 204, in run_mode
    self.run.run()
  File "/Users/timothynunn/process/process/main.py", line 363, in run
    self.run_scan(self.solver)
  File "/Users/timothynunn/process/process/main.py", line 459, in run_scan
    self.scan = Scan(self.models, solver)
  File "/Users/timothynunn/process/process/scan.py", line 22, in __init__
    self.run_scan()
  File "/Users/timothynunn/process/process/scan.py", line 48, in run_scan
    self.scan_1d()
  File "/Users/timothynunn/process/process/scan.py", line 75, in scan_1d
    final.finalise(self.models, ifail)
  File "/Users/timothynunn/process/process/final.py", line 23, in finalise
    op.write(models, ft.constants.nout)
  File "/Users/timothynunn/process/process/output.py", line 47, in write
    models.physics.igmarcal()
  File "/Users/timothynunn/process/process/physics.py", line 4716, in igmarcal
    physics_variables.hfac[iisc - 1] = self.fhfac(iisc)
  File "/Users/timothynunn/process/process/physics.py", line 4734, in fhfac
    return root_scalar(self.fhz, bracket=(0.01, 100), xtol=0.003).root
  File "/Users/timothynunn/process/.venv/lib/python3.10/site-packages/scipy/optimize/_root_scalar.py", line 279, in root_scalar
    r, sol = methodc(f, a, b, args=args, **kwargs)
  File "/Users/timothynunn/process/.venv/lib/python3.10/site-packages/scipy/optimize/_zeros_py.py", line 809, in brentq
    r = _zeros._brentq(f, a, b, xtol, rtol, maxiter, args, full_output, disp)
ValueError: f(a) and f(b) must have different signs