Search code examples
openmdao

Nonlinear solvers cant deal with NaN values


I've a Problem that runs perfectly fine with linear and nonlinear solvers (with a fixed size of the input parameter). I then modified it so that the size of the input parameter can be a variable too. I did this by defining the largest size the vector can take and setting all non used entries to float('nan'). This still runs well with the Linear Solvers and yields the same results as the case with fixed input size. However, all nonlinear solvers reset the value of this input parameter to ones. The solver then converges to a trivial case set by these inital values. I think this could amount to a bug since the linear solvers work fine with my new problem. Any ideas? Thanks.


Solution

  • Did you try using zeros instead of NaN? I am not sure how safely you can propagate NaN through a general nonlinear solver.