MATLAB: Optimizing iterated objective function – containing ∑- sum operator

genetic algorithmMATLABoptimization

I am writing MATLAB code to minimize objective function f(x,y) – please see attached image. P and Q are readily available (known) arrays of equal size n. My major challenge is on how to deal with P and Q to formulate the objective function f(x,y) for input to the optimization algorithm (genetic algorithm). I tried using a loop to iterate through all P and Q before the optimization process but i could not understand the resulting objective function and how to apply it in the optimization algorithm. Same challenge exists with the first constraint, dealing with P and Q. Is there any possible way i can resolve this? (n,a,b,R,K and L are all known constants). Thanks in advance.

Best Answer

I later figured it out. I had to apply loops and function handles and it worked.