-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathanalyticalSolutionQP.m
25 lines (22 loc) · 992 Bytes
/
analyticalSolutionQP.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function analyticalSolution = analyticalSolutionQP(HessianMatrixQP,gradientQP)
% ANALYTICALSOLUTIONQP provides the unconstrained solution of a QP
% problem. To be used as possible alternative when
% the WBToolbox "QP block" fails to find a solution.
%
% FORMAT: analyticalSolution = analyticalSolutionQP(HessianMatrixQP,gradientQP)
%
% INPUT: - HessianMatrixQP = hessian matrix of the QP problem;
% - gradientQP = gradient of the QP problem.
%
% OUTPUT: - analyticalSolution = the analytical solution of the QP problem.
%
% Authors: Daniele Pucci, Marie Charbonneau, Gabriele Nava
%
% all authors are with the Italian Istitute of Technology (IIT)
% email: [email protected]
%
% Genoa, Dec 2017
%
%% --- Initialization ---
analyticalSolution = -inv(HessianMatrixQP)*gradientQP;
end