We release OpenOCL 4.00 which from now on only support one way to define a dynamical system and optimal control problem. The old style of inheriting from OclSystem and OclOCP is not supported anymore. Get the new version of the toolbox here.
The examples and documentation were updated accordingly. You now define a System as e.g.
system = OclSystem(@varsfun, @eqfun);
you can also use a keyword/named parameter list (in arbitrary order) like:
system = OclSystem('varsfun', @varsfun, 'eqfun', @eqfun);
The same holds for creating optimal control problems e.g.
ocp = OclOCP('arrivalcosts', @arrivalcosts, 'pathconstraints', @pathconstraints);
with the system and optimal control problem functions defined as e.g.
function varsfun(svh)
svh.addState('p');
svh.addState('v');
svh.addControl('u');
svh.addParameter('m');
svh.addParameter('Vmax');
end
function eqfun(seh,x,z,u,p)
seh.setODE('p', x.v);
seh.setODE('v', 1/p.m*u);
end
function pathconstraints(ch,x,p)
ch.add(norm(x.v), '<=', p.Vmax);
end
function arrivalcosts(ch,x,p)
ch.add(p.T);
end