<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ClothSimulationComponent/Solver-swift.struct/jacobi(iterationCount:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:22RealityFoundationCloth0C19SimulationComponentV6SolverV6jacobi14iterationCountAESi_tFZ"
  },
  "title" : "jacobi(iterationCount:)"
}
-->

# jacobi(iterationCount:)

Jacobi solver for a cloth simulation.

```
static func jacobi(iterationCount: Int = 1) -> ClothSimulationComponent.Solver
```

## Parameters

`iterationCount`

The number of solver iterations to perform per time step.

## Return Value

A Jacobi solver configuration.

## Discussion

The Jacobi solver can be faster and more power efficient than Gauss-Seidel,
especially if the number of particles in your simulation is low.
However, the Jacobi solver has a slower convergence than Gauss-Seidel, so when used
with the same number of iterations we can expect bigger errors in the simulation.

Before considering changing the solver to improve performance or power consumption,
we recommend playing around with other parameters in your scene. For example:

- Reducing the number of vertices, and making sure triangles are as regular as possible in
  edge length across all bodies in the simulation.
- If possible, replace cloth mesh colliders with implicit colliders like spheres, boxes, etc.
- Set the Laplacian damping of all bodies to zero.
- Set [`crossTetherStiffness`](/documentation/RealityKit/ClothBodyMaterial/crossTetherStiffness)
  and [`bendStiffness`](/documentation/RealityKit/ClothBodyMaterial/bendStiffness) to zero for all the bodies.

But if you need to improve performance and you think you can tolerate even a bit more stretching
in your bodies, you can experiment with Jacobi. Always take actual performance measurements
when doing performance-related changes, as the impact of different approaches may vary
greatly depending on your specific scene.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)