Hello

what is the difference between these two solving implementations, without looking at AS-RTI and Plain RTI → as_rti_closed_loop_example.py, example_sqp_rti_loop.py?

Here is also a very short example of what i mean, without model, constraints and stuff.

The SQP-RTI-loop:

```
tol = 1e-6
max_rti_iter = 20
ocp.solver_options.nlp_solver_type = 'SQP_RTI'
ocp_solver = AcadosOcpSolver(ocp, json_file = 'acados_ocp.json')
for i in range(max_rti_iter):
# preparation
ocp_solver.options_set("rti_phase", 1)
status = ocp_solver.solve()
# feedback
ocp_solver.options_set("rti_phase", 2)
status = ocp_solver.solve()
residuals = ocp_solver.get_residuals()
if max(residuals) < tol:
break
```

And the example without the for loop (from as_rti_closed_loop_example, but with RTI level 4 for comparison):

```
max_rti_iter = 20
ocp.solver_options.nlp_solver_type = 'SQP_RTI'
ocp.solver_options.as_rti_level = 4
ocp.solver_options.as_rti_iters = max_rti_iter
ocp_solver = AcadosOcpSolver(ocp, json_file = 'acados_ocp.json')
# preparation
ocp_solver.options_set("rti_phase", 1)
status = ocp_solver.solve()
# feedback
ocp_solver.options_set("rti_phase", 2)
status = ocp_solver.solve()
```

Is it the same? What is the difference, except that the one handles the iteration in python and the other one handles it in acados itself?

Thanks for the answere in advance