NonlinearRunOnce

The simplest solver in OpenMDAO is NonlinearRunOnce, which executes the system’s components or subsystems sequentially. No iteration is performed by this solver, so it can only be used in systems where the following conditions are satisfied:

  1. System does not contain a cycle, though subsystems may.

  2. System does not contain any implicit states, though subsystems may.

Note that a subsystem may contain cycles or implicit states provided that it is fitted with a solver that can handle them such as NewtonSolver.

Here is an example of using NonlinearRunOnce for a simple model with the Paraboloid component.

import openmdao.api as om
from openmdao.test_suite.components.paraboloid import Paraboloid

prob = om.Problem()
model = prob.model

model.add_subsystem('comp', Paraboloid(), promotes=['x', 'y', 'f_xy'])

model.linear_solver = om.LinearRunOnce()

prob.setup(check=False, mode='fwd')

prob.set_val('x', 0.0)
prob.set_val('y', 0.0)

prob.run_model()

of = ['f_xy']
wrt = ['x', 'y']
derivs = prob.compute_totals(of=of, wrt=wrt, return_format='dict')

print(derivs['f_xy']['x'])
print(derivs['f_xy']['y'])
[[-6.]]
[[8.]]

NonlinearRunOnce Options

Option DefaultAcceptable Values Acceptable Types Description
iprint 1N/A ['int'] whether to print output

NonlinearRunOnce Constructor

The call signature for the NonlinearRunOnce constructor is:

NonlinearRunOnce.__init__(**kwargs)

Initialize all attributes.