Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"array must not contain infs or NaNs" crash #33

Closed
btracey opened this issue Dec 2, 2017 · 1 comment
Closed

"array must not contain infs or NaNs" crash #33

btracey opened this issue Dec 2, 2017 · 1 comment

Comments

@btracey
Copy link

btracey commented Dec 2, 2017

Cloning from master branch, and adding the following conditions (before the call to OAS_prob.run():

OAS_prob.prob['wing.thickness_cp'] = np.array([ 4.5279479027781128e-01,1.9036800154838401e-01,9.8321106961832772e-02])
OAS_prob.prob['alpha'] = -4.0948666786020738e-01
OAS_prob.prob['wing.twist_cp'] = np.array([ -3.2162315517514468e+00,7.1314196111774741e+00,-3.2470369225802571e+00])

Crashes with

Traceback (most recent call last):
  File "run_aerostruct.py", line 132, in <module>
    OAS_prob.run()
  File "/Users/brendan/Documents/SFI/codeother/openaeroversions/aerotest/OpenAeroStruct/run_classes.py", line 587, in run
    self.prob.run_once()
  File "/usr/local/lib/python3.6/site-packages/openmdao/core/problem.py", line 1170, in run_once
    driver.run_once(self)
  File "/usr/local/lib/python3.6/site-packages/openmdao/core/driver.py", line 786, in run_once
    system.solve_nonlinear(metadata=metadata)
  File "/usr/local/lib/python3.6/site-packages/openmdao/core/group.py", line 739, in solve_nonlinear
    self.nl_solver.solve(params, unknowns, resids, self, metadata)
  File "/usr/local/lib/python3.6/site-packages/openmdao/solvers/solver_base.py", line 23, in wrapper
    fn(driver, params, unknowns, resids, system, metadata)
  File "/usr/local/lib/python3.6/site-packages/openmdao/solvers/run_once.py", line 51, in solve
    system.children_solve_nonlinear(local_meta)
  File "/usr/local/lib/python3.6/site-packages/openmdao/core/group.py", line 759, in children_solve_nonlinear
    sub.solve_nonlinear(sub.params, sub.unknowns, sub.resids, metadata)
  File "/usr/local/lib/python3.6/site-packages/openmdao/core/group.py", line 739, in solve_nonlinear
    self.nl_solver.solve(params, unknowns, resids, self, metadata)
  File "/usr/local/lib/python3.6/site-packages/openmdao/solvers/solver_base.py", line 23, in wrapper
    fn(driver, params, unknowns, resids, system, metadata)
  File "/usr/local/lib/python3.6/site-packages/openmdao/solvers/nl_gauss_seidel.py", line 132, in solve
    system.children_solve_nonlinear(local_meta)
  File "/usr/local/lib/python3.6/site-packages/openmdao/core/group.py", line 759, in children_solve_nonlinear
    sub.solve_nonlinear(sub.params, sub.unknowns, sub.resids, metadata)
  File "/usr/local/lib/python3.6/site-packages/openmdao/core/group.py", line 739, in solve_nonlinear
    self.nl_solver.solve(params, unknowns, resids, self, metadata)
  File "/usr/local/lib/python3.6/site-packages/openmdao/solvers/solver_base.py", line 23, in wrapper
    fn(driver, params, unknowns, resids, system, metadata)
  File "/usr/local/lib/python3.6/site-packages/openmdao/solvers/run_once.py", line 51, in solve
    system.children_solve_nonlinear(local_meta)
  File "/usr/local/lib/python3.6/site-packages/openmdao/core/group.py", line 757, in children_solve_nonlinear
    sub._sys_solve_nonlinear(sub.params, sub.unknowns, sub.resids)
  File "/usr/local/lib/python3.6/site-packages/openmdao/core/component.py", line 609, in _sys_solve_nonlinear
    self.solve_nonlinear(params, unknowns, resids)
  File "/Users/brendan/Documents/SFI/codeother/openaeroversions/aerotest/OpenAeroStruct/vlm.py", line 973, in solve_nonlinear
    self.lup = lu_factor(params['AIC'])
  File "/usr/local/lib/python3.6/site-packages/scipy/linalg/decomp_lu.py", line 58, in lu_factor
    a1 = asarray_chkfinite(a)
  File "/usr/local/lib/python3.6/site-packages/numpy/lib/function_base.py", line 1215, in asarray_chkfinite
    "array must not contain infs or NaNs")
ValueError: array must not contain infs or NaNs
@btracey btracey changed the title "array must not contain infs or NaNs crash" "array must not contain infs or NaNs" crash Dec 2, 2017
@johnjasa
Copy link
Member

johnjasa commented Dec 6, 2017

I updated the code to throw an AnalysisError when this is detected. This way, if the coupled system doesn't converge, your optimizer or code can handle that error however you choose.

Also, I suggest using the latest version of OpenMDAO1 from https://github.com/openmdao/openmdao1
The latest version has Aitken relaxation, which sometimes helps converge troublesome coupled systems. OpenAeroStruct automatically uses Aitken relaxation if it's available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants