I am writing an optimization code which is essentially this:
G = constant vector of size (40,1)
K = constant vector of size (37,1)
A = constant vector of size (50,1)
Meas = constant vector of size (50,1) (corresponds to the experimentally measured data)
I need to optimize a variable x of size (50,1) such that:
cvx_begin
cvx_solver mosek
variable x(50,1)
G = Exp_conv(x,A,G, K);
minimize(norm(G-Meas))
cvx_end
where Exp_conv is a function defined as:
function X = Exp_conv (x,A,G,K)
for i = 1:50
E = A(i).*((exp(x(i).*K))); %returns a (37,1) sized vector
n = 40-size(K,1);
E_final = [zeros(n,1);E]; %zero pad at one end to form a vector of the size of G
X(i,1) = sum(G.*E_final); %the output is (50,1) sized vector, corresponds to the observed data
end
end
The error is that norm cannot be calculated (cause the input to norm should be affine). Essentially, the objective norm(G-Meas) corresponds to a data fidelity term, where I try to minimize the error between the function constructed with the variable and the observed data. I have tried to think of any alternative formulation for this but cannot do it. Would be glad if anyone can suggest anything (hoping there is one!)