"Error: Argument 1(i1) is not symbolic." when calling qpsol

114 views
Skip to first unread message

Stuart

unread,
Aug 21, 2022, 7:59:36 PM8/21/22
to CasADi
I've had this error in different situations, and so far I've always been able to solve it. This time though, I'm stumped. Can't tell why the argument is not symbolic. The error appears when calling qpsol.


I thought the error might be with the function F which is called in the above code, however I have tested the function with dummy values and it evaluates fine. As far as I understand it, 'x', 'g', 'f', 'p' should be symbolic, but the bounds 'ubg', 'lbg', etc don't have to be symbolic (bound of 0 for example). Tried to follow those rules when constructing the qp.

As an aside, how should I interpret "Argument 1(i1)" in this situation? How do I know which argument specifically it's referring to? (and also, where that argument is in the code) .

Thank you!

Bruno M L

unread,
Aug 22, 2022, 10:02:42 AM8/22/22
to CasADi
Hi!

I could not run your code from the source you provided.

But I did some digging, and "Argument 1(i1)" is related to 'p', so there is some error in your parameters.

Stuart

unread,
Aug 23, 2022, 8:38:57 AM8/23/22
to CasADi
Hi!

Thank you, you're right, there was a problem with the parameters which I've now fixed :)

What digging did you do to find out that "Argument 1(i1)" is related to 'p'? Would be super useful for the future to know which arguments correspond to which inputs!

Bruno M L

unread,
Aug 23, 2022, 8:57:24 AM8/23/22
to CasADi
Hi!

When you create a Function without names for inputs and outputs, such as:

Function('name', [x, u], [out1, out2])

Then, if you print the Function, you get something like this:

Function(name:(i0,i1)->(o0,o1) MXFunction)

These are the default names for the inputs and outputs. 

After that, I created qpsol solver and printed the solver, since this kind of object is also a Function in Casadi. The result is something like:

Function(solver:(x0[80],p[],lbx[80],ubx[80],lbg[40],ubg[40],lam_x0[80],lam_g0[40])->(x[80],f,g[40],lam_x[80],lam_g[40],lam_p[]) MXFunction)

I noticed that 'p' is the second argument (i1). After that, I put a float as a parameter and it resulted in the same error as yours. =)

Good luck with your work!

PS: I'm not a developer

Stuart

unread,
Aug 23, 2022, 9:00:22 AM8/23/22
to CasADi
Ahh, thanks so much for your help! Good to know, will make debugging much easier in the future :D
Reply all
Reply to author
Forward
0 new messages