DanielMartensson / MataveID

System identification toolbox for GNU Octave and MATLAB
MIT License
83 stars 24 forks source link

Use of Optimization Toolbox in Mataveid #13

Closed jasonnicholson closed 1 year ago

jasonnicholson commented 1 year ago

https://github.com/DanielMartensson/Mataveid/blob/7b4630798bb019d8b0085f0f36d7e6cc697c839b/sourcecode/lsvm.m#L59

In MATLAB, quadprog is in the Optimization Toolbox. I would recommend adding some code that checks for the Optimization Toolbox before making this call.

DanielMartensson commented 1 year ago

You need to have MataveControl installed.

The reason why I have an own quadratic programming solver, is because there is a 100% eqvivalent QP-solver at CControl for embedded systems.

jasonnicholson commented 1 year ago

Okay. I got it now. Replace quadprog with mc.quadprog.

DanielMartensson commented 1 year ago

Also linprog.m should be vectorized because it's to slow. I made it like that because there is also a linprog.c that using exactly the same algorithm and gives the same results back.

Sometimes linear programming can be useful for Model Predictive Control.