def METHOD_NAME(
    model, mpc_params: MpcCSTRParameters, cstr_params, use_rti=False
):
    ocp = AcadosOcp()
    # set model
    ocp.model = model
    x = model.x
    u = model.u
    nx = x.shape[0]
    nu = u.shape[0]
    # number of shooting intervals
    ocp.dims.N = mpc_params.N
    # set prediction horizon
    ocp.solver_options.tf = mpc_params.Tf
    # nominal parameter values
    ocp.parameter_values = np.array([cstr_params.F0])
    # set cost
    ocp.cost.W_e = mpc_params.P
    ocp.cost.W = block_diag(mpc_params.Q, mpc_params.R)
    ocp.cost.cost_type = "NONLINEAR_LS"
    ocp.cost.cost_type_e = "NONLINEAR_LS"
    ocp.model.cost_y_expr = vertcat(x, u)
    ocp.model.cost_y_expr_e = x
    ocp.cost.yref = np.zeros((nx + nu,))
    ocp.cost.yref_e = np.zeros((nx,))
    # set constraints
    ocp.constraints.lbu = mpc_params.umin
    ocp.constraints.ubu = mpc_params.umax
    ocp.constraints.idxbu = np.arange(nu)
    ocp.constraints.x0 = cstr_params.xs
    # set options
    ocp.solver_options.qp_solver = "PARTIAL_CONDENSING_HPIPM"  # FULL_CONDENSING_QPOASES
    # PARTIAL_CONDENSING_HPIPM, FULL_CONDENSING_QPOASES, FULL_CONDENSING_HPIPM,
    # PARTIAL_CONDENSING_QPDUNES, PARTIAL_CONDENSING_OSQP
    # ocp.solver_options.qp_solver = 'FULL_CONDENSING_QPOASES'
    ocp.solver_options.qp_solver_cond_N = mpc_params.N  # for partial condensing
    ocp.solver_options.hessian_approx = "GAUSS_NEWTON"
    # ocp.solver_options.print_level = 1
    if use_rti:
        ocp.solver_options.nlp_solver_type = "SQP_RTI"  # SQP_RTI, SQP
    else:
        ocp.solver_options.nlp_solver_type = "SQP"  # SQP_RTI, SQP
    if mpc_params.linear_mpc:
        ocp.solver_options.integrator_type = "DISCRETE"
    else:
        ocp.solver_options.integrator_type = "IRK"
        ocp.solver_options.sim_method_num_stages = 4
        ocp.solver_options.sim_method_num_steps = 1  # 5
    ocp.solver_options.levenberg_marquardt = 1e-5
    # ocp.solver_options.tol = 1e-3
    ocp.solver_options.line_search_use_sufficient_descent
    # create
    ocp_solver = AcadosOcpSolver(ocp, json_file="acados_ocp.json")
    return ocp_solver