I am trying to use Casadi from Julia using the opti stack. I am trying to do this using PyCall. I get an error when I use the following code:

```
opti = casadi.Opti();
x = opti.variable();
y = opti.variable();
opti.minimize((1-x)^2+(y-x^2)^2);
opti.solver('ipopt');
sol = opti.solve();
plot(sol.value(x),sol.value(y),'o');
```

However, if I replace it with the following code the error disappears.

```
opti = casadi.Opti();
x = opti._variable();
y = opti._variable();
opti.minimize((1-x)^2+(y-x^2)^2);
opti.solver('ipopt');
sol = opti.solve();
plot(sol.value(x),sol.value(y),'o');
```

How, is opti._variable() different from opti.variable()? I could not find any documentation of _ usage in PyCall. Can anyone point me to it?

Note 1: I got to know about _ usage from example on GitHub - ichatzinikolaidis/CasADi.jl: Julia interface to CasADi via PyCall.

Note 2: I am trying to learn numerical optimal control and hence want to implement the algorithms given in Practical Methods for Optimal Control and Estimation Using Nonlinear ... - John T. Betts - Google Books. It seems that second order methods are better suited for this.