t = SX.sym('t', 1);
q1 = x(1);
v1 = x(2);
qr = x(3);
vr = x(4);
p = SX.sym('p', 1+nu);
T = p(1);
u = p(2);
xdot = T*[v1;
u;
vr;
-om0^2*qr + u];
opts = struct('tf', 1/nk);
ode = struct('t', t, 'x', x, 'ode', xdot, 'p', [T, u]);
I = integrator('I', 'rk', ode, opts);
Error using casadiMEX
The assertion "e.numel()==nr*nrhs" on line 1310 of file
"/home/travis/build/casadi/binaries/casadi/casadi/core/function/integrator.cpp"
failed.
Inconsistent number of rhs
Error in casadi.integrator (line 489)
[varargout{1:nargout}] = casadiMEX(843, varargin{:});
Any idea ?
best regards,
--raoul
dear Joris,confirmed, it works with 3.1.0-rc1 !Many thanks (I'm waiting in the airport of Bruxelles :-)--raoul
>> > email to casadi-users+unsubscribe@googlegroups.com.
>> email to casadi-users+unsubscribe@googlegroups.com.
>> > email to casadi-users+unsubscribe@googlegroups.com.
>> email to casadi-users+unsubscribe@googlegroups.com.
x = SX.sym('x', 1);
y = x^2;
myf = Function('myf', {x}, {y});
myf.generate('myf',struct('mex',true));
mex myf.c -largeArrayDims
gives the compiler error message :
Building with 'Microsoft Visual C++ 2013 Professional (C)'.
Error using mex
myf.c
D:\EIVD\Projets\TrajOpt\Matlab\Casadi\myf.c(80) : warning C4267: '=' : conversion
from 'size_t' to 'int', possible loss of data
D:\EIVD\Projets\TrajOpt\Matlab\Casadi\myf.c(86) : warning C4267: '=' : conversion
from 'size_t' to 'int', possible loss of data
D:\EIVD\Projets\TrajOpt\Matlab\Casadi\myf.c(74) : warning C4101: 'r' : unreferenced
local variable
D:\EIVD\Projets\TrajOpt\Matlab\Casadi\myf.c(181) : error C2466: cannot allocate an
array of constant size 0
D:\EIVD\Projets\TrajOpt\Matlab\Casadi\myf.c(181) : error C2133: 'iw' : unknown size
D:\EIVD\Projets\TrajOpt\Matlab\Casadi\myf.c(202) : warning C4098: 'mexFunction' :
'void' function returning a value
Do you have any idea what is going wrong here ?
Many thanks in advance,
--raoul
> email to casadi-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/casadi-users/CAORqfTZOmc5xhwvGQ72JLsuAAvDDMbqDipbCz_k_cCNVOf4B9A%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
On Wednesday, 14 September 2016 18:57:48 UTC+2, Raoul Herzog wrote:dear Joris,I have two questions about code generation :1) If I try to do code generation of a function including integrators (either CVODES or RK), I get an error message :Error using casadiMEXon line 2166 of file"/home/travis/build/casadi/binaries/casadi/casadi/core/function/function_internal.cpp"'generateBody' not defined for N6casadi12RkIntegratorEError in casadi.Function/generate (line 1260)[varargout{1:nargout}] = casadiMEX(792, self, varargin{:});Error in SwigRef/subsref (line 29)[varargout{1:nargout}] = builtin('subsref',self,s);Is this a missing feature or do I something wrong ?2) Maybe a silly question : for a function not including integrators, code generation works, but afterwards, do I have to write a "wrapper" function in Matlab, usingvoid mexFunction( int nlhs, mxArray *plhs[],int nrhs, const mxArray*prhs[] )and compile it using the "mex" command, or is there a simpler way ?Many thanks in advance,--raoul
--
Sent from CasADi's user forum at http://forum.casadi.org.
---
You received this message because you are subscribed to the Google Groups "CasADi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to casadi-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/casadi-users/d700e7b0-9ae2-4204-b315-c5e77b6f34f2%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/casadi-users/58374e74-dd8f-4a25-bb62-ca5f2b2a5501%40googlegroups.com.
--
Sent from CasADi's user forum at http://forum.casadi.org.
---
You received this message because you are subscribed to the Google Groups "CasADi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to casadi-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/casadi-users/2c122724-4818-4792-9f38-51f970a6104d%40googlegroups.com.