为什么我只能通过view_model看到一个上三角矩阵?

Why can I only see an upper triangular matrix via view_model?

我使用了两个示例(单个 ActDisk and multi disciplinary Sellar problems) to understand the view_model 功能。

根据 linear solvers I should be able to see the matrix system built for unified derivatives. It is not clear why I am not able to see the lower triangle matrix even though I set prob.setup(mode='fwd'). For the uncoupled model (ActDisk 上的理论手册)我没有更改求解器,所以它应该是 LinearRunOnce。我将 prob.setup 模式设置为正向,我得到了这个很好的警告,但我仍然看到一个上三角矩阵,就好像它正在被处理为反向模式。

 \anaconda3\lib\site-packages\openmdao\core\problem.py:850: RuntimeWarning: Inefficient choice of derivative mode.  You chose 'fwd' for a problem with 2 design variables and 1 response variables (objectives and nonlinear constraints).                                                                                                                                                                                                                                     (mode, desvar_size, response_size), RuntimeWarning)

在第二个例子中(Sellar)耦合模型的循环组有自己的非线性求解器但没有额外的线性求解器(注意:我使用的是网页上的例子)。这可能是个问题,但我关注的是 'model-group'(层次结构中最高的),它仍然连接到默认的线性求解器。 (如果我理解正确,即使子系统包含循环,LinearRunOnce 也应该在最高层次上工作,只要那个没有循环)。与之前的案例类似,无论我设置什么问题模型,我都会看到相同的 N2 图。这是正确的吗?

n2 查看器不显示实际的雅可比矩阵。它始终以 DSM 格式显示,这实际上是转置雅可比矩阵。

当您更改线性求解器时,您不会在 view_model 中看到任何变化。