# Does non-linear analysis in ANSYS also make use of direct solvers or not?

Member Posts: 86

I know that for linear problems, I can directly make use of either direct or iterative solver. But for a non-linear problems, can direct solvers be used, or I have to be dependent upon iterative solvers only?

Tagged:

• edited August 7 Accepted Answer

There are two levels of iteration when an iterative solver is working on a nonlinear problem. To avoid confusion, let's call the iterative solver the PRECONDITIONED CONJUGATE GRADIENT SOLVER (PCG)

Both direct and PCG solvers can compute a nonlinear analysis. Nonlinear means that the stiffness matrix equation is solved once, then a convergence evaluation is made to decide if the nonlinear system has converged. If not another solution of the stiffness matrix equation is made with updated values. Each time the stiffness matrix is solved, that is called an iteration. After an iteration meets the convergence criteria, that is called a substep and the load is incremented and the next substep can begin with the first iteration.

As you note, the direct solver, also called the SPARSE SOLVER, uses LU decomposition to solve the stiffness matrix equation.

The PCG solver uses an iterative algorithm to solve the stiffness matrix equation. In a linear analysis, that is done once. In a nonlinear analysis, that is done for every dot on the N-R Convergence plot (every nonlinear iteration).

«13

• Direct solvers can always be used and are generally the better choice for non-linear problems.

Iterative solvers can be a benefit when there is a lot of nodes, because they take less memory.

• edited August 7

@peteroznewman, but how can Newton-Rapshon and direct solver go hand in hand? Since non-linearity is involved, there needs to be iterations made using the Newton-Raphson (where the displacements are guessed and then iterations proceed). But the direct solver uses a LU decomposition within the stiffness matrix to solve for the displacements without guessing of the displacements. This thing kind of boggles me.

• edited August 9

@peteroznewman, understood. Thank you for answering. I was thinking that since stiffness matrix itself depends on the response of the nodal displacements, so I cannot conduct a LU decomposition on it. But apparently the LU decomposition can also work on a non-linear set of equations where the stiffness matrix itself is a funtion of the nodal displacements. But still I am slightly confused that if the convergence is not achieved for a specific iteration for a specific time step, then still there are no guesses made (since LU decomposition, by theory and its name, doesn't involve any guesses)? If not, then how does the iterations proceed?

And also, as you have mentioned that the Iterative solver requires only one iteration to converge at t = 1 sec i.e. the final time step for a linear analysis. So is it possible that the solution doesn't converge at that time step ? What measures can be taken to make the linear analysis converge at the one and only i.e. final time step?

• @peteroznewman, would be extremely glad if you could reply to this one as well :)

• edited August 11

I was thinking that since stiffness matrix itself depends on the response of the nodal displacements

Stiffness matrix for a single solve does not depend on the response of the nodal displacements. Stiffness matrix [K] is assembled from the elements that connect the nodes in their current location. Nodal deformation {u} are the unknowns, applied forces {F} are known. The matrix equation [K]{u}={F} is solved for the unknown nodal deformations.

But apparently the LU decomposition can also work on a non-linear set of equations where the stiffness matrix itself is a function of the nodal displacements.

The stiffness matrix for a single solve is not a function of nodal displacements. Solving [K]{u}={F} can be done using the Sparse direct method or PCG iterative method.

In a nonlinear problem, on each iteration, the matrix equations [K]{u}={F} are linear in that iteration. It is only after the deformed nodal values from that one iteration are added to the current nodal locations to get the new nodal locations that items that were held constant for that one iteration can pick up new values for the next iteration. That is where the nonlinearity occurs. The stiffness matrix can change between iterations because of a material nonlinearity. Contact nonlinearity can change the {F} vector between iterations.

And also, as you have mentioned that the Iterative solver requires only one iteration to converge at t = 1 sec i.e. the final time step for a linear analysis.

I did not say that the PCG iterative solver requires only one internal iteration to converge. What I said was that in a linear analysis, the matrix equation [K]{u}={F} is solved only once, using either the PCG iterative or direct solver.

Again, there is confusion between convergence of a single PCG iterative solver solving [K]{u}={F} one time, and convergence of a nonlinear model that requires multiple solves of the matrix equation [K]{u}={F}.

The PCG iterative solver might take tens or hundreds of internal iterations to solve [K]{u}={F} one time. It is possible that the internal PCG iteration fails to converge. That is an internal convergence for the PCG solver doing a single matrix solve and has nothing to do with the nonlinear model that does many matrix solves and has a completely separate external convergence criteria of results between solves.

In a linear analysis, the matrix equation [K]{u}={F} is solved only once. If the matrix is singular, there is no solution and both the direct and PCG iterative solvers will fail. A common reason for this is insufficient constraints to prevent rigid body motion.

In a nonlinear analysis the matrix equation [K]{u}={F} is solved over and over, updating the nodal coordinates, which affects the stiffness matrix and the force vector. When the updated system of equations is available, the equilibrium of the forces in the system of equations can be checked. It the equilibrium is sufficiently close to zero, that iteration is called converged. If the equilibrium of forces is not sufficiently close to zero, then another solution is done, which is the next iteration.

• edited August 11

@peteroznewman, such a simple and straight forward explanation. Thank you for that.

"The PCG iterative solver might take tens or hundreds of internal iterations to solve [K]{u}={F} one time. It is possible that the internal PCG iteration fails to converge." Yes, that is what I was asking actually. How do we know that internal PCG iterations have failed to converge? I mean how to diagnose it? What measures should be taken to solve this problem?

Moreover, you mentioned, "Nodal deformation {u} are the unknowns, applied forces {F} are known. The matrix equation [K]{u}={F} is solved for the unknown nodal deformations." If this is the case, then I think in non-linear analysis, we should be expecting the force/moment/displacement convergence curve (i.e. the magenta curves) to always be equal to zero. Since we are already making use of the external forces to actually calculate the nodal displacements. So there shouldn't exist any difference between the [F] (external force) and [K][U]. What would you say on this?

Plus, I just want to confirm one more thing. So why is the static structural an implicit solver? I mean we are applying the force at a specific iteration of a certain time step, the stiffness matrix is already know at that specific iteration of that certain time step (being assembled from the already calculated nodal displacements from previous iteration) and we just calculate the nodal displacements from here for the next iteration. Simple. Why does it make the analysis implicit?

• edited August 11

You know that the PCG iteration has failed to converge because there is an error in the Solution Output file. The corrective action is to switch the the Direct solver.

In a linear analysis, there is a check called back substitution. If you put the calculated nodal displacements back into the matrix equation that uses the applied forces, the answer should be very, very close to zero, like smaller than 1E-9. In NASTRAN, that number is called Epsilon and is a measure of the numerical quality of the matrix solve. If the value comes out to be large, like bigger than 1E-6, then there is probably something wrong with the model. I once had a model that had Epsilon value larger than 0.1 and the results were total garbage. If there was more wrong with the model, the matrix solution would have failed completely with a zero pivot error and it would be a FATAL error.

In a nonlinear analysis, the solution is used to compute the internal forces, and those are compared with the applied forces and the difference compared with the convergence criteria. The graph below is from this discussion: https://forum.ansys.com/index.php?p=/discussion/22968/why-do-the-stresses-increase-near-the-supports

Implicit vs Explicit refers to solving dynamics problems where there is a time integration. Transient Structural uses Implicit methods where large time steps can be used but the matrix equation has to be solved multiple times (iterations) to get the system into equilibrium at each time step. Explicit Dynamics uses Explicit methods where very, very small time steps are used but there is no requirement to show equilibrium at each time step. The solver simply applies the correction needed at the next time step. In that way, the system remains in equilibrium over time.

• edited August 11

@peteroznewman, for the picture that you have re-shared here, I would like to ask something. Since displacements are already calculated from the External forces, and then we are calculating the internal forces from the resulting nodal displacements, but I don't see a reason why the internal calculated forces will not be equal to the externally applied forces. Ofcourse, this might be related to the numerical nature of the FEA softwares but where exactly it makes an approximation so that the internal forces don't become equal to the external forces (or the difference doesn't come down the defined limit). As far as a I see it, there is a straight forward way. Calculate the nodal displacements from external forces, and then re-calculate the internal forces. But why would these internal forces be different from the external forces, I couldn't grasp it.

If I am using a PCG solver, then I can assume that there might be some approximations made and internal forces are not equal to the external forces. But for a non-linear analysis where Direct solver is utilized, where no approximations are made at all (I believe) and there is a simple LU decomposition, why won't it make the internal forces become equal to the external one on the first iteration?

• edited August 11

You missed the sentence starting with Hence...

A new stiffness matrix is calculated based on the current conditions (new nodal locations) . A new stiffness matrix does not give the same internal forces as the original stiffness matrix.

In a linear analysis, the internal forces are equal to the external forces. There is no need to update the stiffness matrix. If you apply a 10 N load to a 50 mm thick beam and it deflects 0.0001 mm. I can tell you that if you apply 100 N, it will deflect 0.001 mm and a 1000 N load will deflect 0.01 mm. That is an example of a model where the small displacement assumption is valid and you can use a linear analysis and scale the answer for different loads. That is what NASTRAN does. Inverts the stiffness matrix once, them computes a solution for many load cases from that one inverted stiffness matrix. That is linear analysis.

The PCG solver has a convergence criteria that give similar precision to the direct solver. Read about these two solvers in this section of the help system:

```https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v212/en/ans_bas/Hlp_G_BAS3_4.html?q=PCG%20convergence%20criteria
```
• edited August 11

@peteroznewman, thank you for bearing with me this long 😄

I guess I should be spending more time learning and clearing out all the queries. I think there is a ANSYS Innovative course available as well which is dedicated for Newton-Raphson and the idea which we are discussing here. Let me check that out. And also, let me check the link that you have shared.

Thank you again, sir :)

• @peteroznewman, hello again on this thread.

This might just be a basic question which you might have already had answered somewhere, but if you could just provide an answer to this thing, I would be glad.

I had two different models whose geometric non-linear analysis I want to conduct. For first of these models, it took 10 substeps to converge (bisection occurred, then substep decreased the time, then again tried to converge, etc). While for the second model, first iteration was conducted at directly 1 sec, then on the second iteration the analysis converged. There was only 1 step i.e. at 1 sec. How is that possible? I mean how can one model require so many substeps and iterations to converge and ultimately reach 1 sec, while the other model can just directly converge at 1 sec with no other substeps, and only two iterations? What makes the difference here?

• Different models will have different stiffness matrices and different loads so each model will have a different amount of initial force imbalance at the end of the first iteration. Some will already satisfy the criterion and others will need to do some iterations or even a bisection.

• @peteroznewman, so the force imbalance depends upon the global stiffness matrix of the model as well as the type and amount of the external force applied, right?

For the first model (which required alot of substeps and iterations), the initial substep value of time was, say, 0.2 sec. But for the second model which immediately converged, the load was applied directly at 1 sec. So how does the solver decide at what time substep should the geometric non-linear analysis begin? I hope you understood what I meant.

• edited September 6

There are two programs in use during a nonlinear statics solution, and we loosely call them both "the solver", but it would be more accurate to say there is a "matrix solver" (MS) and a "solution control program" (SCP). The MS is the program called multiple times by the SCP. The MS is what is used exactly once for a linear analysis. The SCP manages the substeps, calculates the Force Imbalance and compares that with the Criterion and decides what to do next: another iteration, increment the load, bisect the load or stop the process with an error or stop with a successful completion.

When you insert a nonlinear item into the model (frictional contact, plasticity, large deflection), that automatically starts the SCP, which calls the MS as many times as it needs.

• edited September 6

@peteroznewman, ohh okay. understood.

what about this one, "so the force imbalance depends upon the global stiffness matrix of the model as well as the type and amount of the external force applied, right?"

• Yes, right.

• @peteroznewman, can you kindly tell me why is this happening. I think the substep should have had already converged when for the first time when the force and moment criterias were met. Unfortunately, the analysis kept on running a few more iterations before the substep convergence has reached. I haven't attached the displacement graph since it is always below the criteria limit.

• There are other criteria the solver is checking besides these three before it calls the increment converged. For example, Penetration Tolerance for Frictional Contact or the Pressure Compatibility equation for elements using mixed u-P element formulation. You can see statements on those two written to the Solution Output file to know why the iteration continues.

• edited September 8

@peteroznewman, ohh okay 😂 I don't know but I feel like FEA and ANSYS is kinda like a never ending river, where you find a new and different fish everytime you try to walk along with it. I guess calling myself a FEA and ANSYS expert will take way long time than I imagined 🤣 I thought the convergence criterias were enough but there are some other things as well. I don't know how many more things are still hidden from my eyes haha 😅