# Compas\_cra: issue with ipopt solver

**URL:** https://forum.compas-framework.org/t/compas-cra-issue-with-ipopt-solver/1011
**Category:** Uncategorized
**Created:** [April 8, 2025, 2:47pm UTC](https://forum.compas-framework.org/t/compas-cra-issue-with-ipopt-solver/1011 "2025-04-08T14:47:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![michisinzinger](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/michisinzinger/32/682_2.png) [@michisinzinger](https://forum.compas-framework.org/u/michisinzinger)
#### Post date: [April 8, 2025, 2:47pm UTC](https://forum.compas-framework.org/t/compas-cra-issue-with-ipopt-solver/1011/1 "2025-04-08T14:47:55Z")

</div>

Hello,

I’m struggling to get the CRA solvers (`cra_solve`; `cra_penalty_solve`) from compas\_cra working properly.

Provided sample scripts from compas\_assembly, compas\_dem, compas\_cra or manually implementing the solver all raise the same error:

```auto
path\to\condaenvrionment\lib\site-packages\pyomo\opt\base\solvers.py", line 596, in solve
    raise ApplicationError(
pyomo.common.errors.ApplicationError: Solver (ipopt) did not exit normally

```

exemplary log of the solver:

```auto
Starting equilibrium solve...
Aeq: (6, 12)
Afr: (32, 12)
1
1
--- set up time: 0.006998300552368164 seconds ---
finished setup... now trying to solve it...
Ipopt 3.14.9: linear_solver=mumps
tol=0.001
constr_viol_tol=0.0001
compl_inf_tol=0.0001
acceptable_tol=0.0001
acceptable_constr_viol_tol=0.01
acceptable_compl_inf_tol=0.01
ERROR: Solver (ipopt) returned non-zero return code (3221226505)
ERROR: See the solver log above for diagnostic information.

```

I’m on windows and manually copied the ipopt binaries into the respective environment folders as pointed out in the documentation. I tried with both the suggested ipopt versions 3.14.9 as well as the most recent 3.14.17, same issue with both.  
I’ve gone back and forth between compas, python and pyomo versions that work with compas\_cra as well.  
I tried to change the `d_bnd` and `eps` values inside the `cra_pyomo.py` as well as loosening tolerances in `solver.options`, tried solvers `mumps`, `ma57` and `ma27`.

The ipopt solver works as stand-alone script without calling it through compas\_cra (chatgpt wrote this script):

```auto
import compas
from compas.geometry import Box, Frame, Translation
from pyomo.environ import ConcreteModel, Var, Objective, SolverFactory, minimize

support = Box(1, 1, 1)

free = Box(1, 1, 1, frame=Frame.worldXY().transformed(Translation.from_vector([0, 0, support.zsize])))
support_center = support.frame.point
free_center = free.frame.point

print("Support center:", support_center)
print("Free block center (initial):", free_center)

target = [support_center[0], support_center[1], support_center[2] + support.zsize]

print("Target position for free block:", target)
model = ConcreteModel()
model.x = Var(initialize=free_center[0])
model.y = Var(initialize=free_center[1])
model.z = Var(initialize=free_center[2])
model.obj = Objective(
expr=(model.x - target[0])**2 + (model.y - target[1])**2 + (model.z - target[2])**2,
sense=minimize
)

solver = SolverFactory('ipopt')
solver.options["tol"] = 1e-4
solver.options["constr_viol_tol"] = 1e-4
solver.options["compl_inf_tol"] = 1e-4
result = solver.solve(model, tee=True)
print("Solver result:", result)
print("Optimal free block center:")
print("x =", model.x.value)
print("y =", model.y.value)
print("z =", model.z.value)
print("Target was:", target)

```

I have little idea how to resolve the issue and am very thankful for any help.

Best,  
Michael

---

<div class="post-metadata">

### Author: ![michisinzinger](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/michisinzinger/32/682_2.png) [@michisinzinger](https://forum.compas-framework.org/u/michisinzinger)
#### Post date: [April 9, 2025, 5:28pm UTC](https://forum.compas-framework.org/t/compas-cra-issue-with-ipopt-solver/1011/2 "2025-04-09T17:28:02Z")

</div>

I was able to resolve the issue:

I copied not only the contents of the \bin folder (as suggested in the documentation), but all the files and complete `ipopt` folder structure into the respective environment.

Might have been an obvious thing to do but yeah..

---

<div class="post-metadata">

### Author: ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)
#### Post date: [May 6, 2025, 9:10am UTC](https://forum.compas-framework.org/t/compas-cra-issue-with-ipopt-solver/1011/3 "2025-05-06T09:10:05Z")

</div>

hi,

sorry for the lack of response. we will make a note in the docs…

thanks!
