I am building a pretty complex optimization problem with the Ipopt solver (NLP). Since the results are not as I expected, I guess that I made a mistake in the model definition. Therefore, I would like to print out the optimization problem to get a better overview of the model.

I used a macro function to create the model and used print(model) within the function. When I run the function, Julia breaks down - I think because of the print(model) command.

Is there any other way to see the whole optimization problem printed in a nice way?

Thanks a lot for your help (and sorry if my question is confusing you - I am new to Julia)

Hey, so I tried to do the same for a linear problem with CPLEX at the same happens - either Julia breaks down (page is frozen) or it solves the problem and returns [Math Processing Error] and therefore doesnâ€™t return the printed optimization problem.

The model structure of the linear version is the following:

function example(Set, Results, size::Int, limit::Int)

yes I am running the problem in IJulia in the Jupyter notebook.

Concerning your question on the size of the model - it is pretty big, here the Ipopt output after having solved it:

Number of nonzeros in equality constraint Jacobianâ€¦: 3840
Number of nonzeros in inequality constraint Jacobian.: 960
Number of nonzeros in Lagrangian Hessianâ€¦: 0

Total number of variablesâ€¦: 10206
variables with only lower bounds: 10206
variables with lower and upper bounds: 0
variables with only upper bounds: 0
Total number of equality constraintsâ€¦: 1056
Total number of inequality constraintsâ€¦: 576
inequality constraints with only lower bounds: 192
inequality constraints with lower and upper bounds: 0
inequality constraints with only upper bounds: 384

And I do not really have a reproducible example unfortunately as the model is very big (how-ever it is non-convex).

In IJulia we use Javascript to render the formulation as LaTeX. It seems that the model is too big and so the Javascript backend crashes [Math Processing Error].

However, do you expect that printing a 10^4 by 10^3 size problem would be readable? Why do you want to print it? There are likely too many constraints and too many terms to read to find the mistake.

The printing really only works for models with ~10 variables and constraints.