Replies: 2 comments 2 replies
-
jacobian_approximation=exact means that the user has to provide the jacobian. Maybe there is an issue in your In your eval_g, this doesn't look right:
Maybe just |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer, however that was a "debug" statement that i forgot to delete, i changed that line of code in g[n] = sum; but i still got segmentation fault. I have got also another question regarding the definition of constraints: i've got N non-linear inequality constraints such as f[i]-map_h[i]<=0 (i=0...N) and an equality constraint such as 1 / (2 * d(x, i))) * ds[i]==tmax (i=0...N) where x is the optimization variable, is the way i declared those constraints the right way or i forgot something? Could I share the definition of my model, instead of the code, to better understand the problem? |
Beta Was this translation helpful? Give feedback.
-
Hi, i'm pretty new to mathematical optimization and i don't have much confidence in C so i'm wasting so much time to figure out how to run an optimization with Ipopt in C. First of all i've compiled and installed all the libraries and i'm using the functions of IpStdCInterface.h. When i try to run my code, I'm getting a segmentation fault on the line "IpoptSolve(nlp, x, NULL, &obj, mult_g, mult_x_L, mult_x_U, &user_data);", after some hours of debugging i found out that the error line that gives me the segmentation fault is in IpTNLPAdapter.cpp and it is the following line of code:"if( c_col != -1 && c_row != -1 )" but i can't figure out how to solve this. I tried different options regarding the jacobians computation but i'm getting the same error over and over. Below is the main of my code:
Below there are the objective function along with the constraints:
In addition there is the eval_grad_f function but i want to let ipopt to compute manually both the jacobians and hessians if possible.
Thank you in advance for your help and sorry for bothering you with this stuff :D, see ya! :)
Beta Was this translation helpful? Give feedback.
All reactions