Hi all, im searching a way to optimize my objective function (RMSE) by using fminsearch. I have 4 variables: a, b, c & d.

Also, I have 23 simple equations that have to be replaced with the values a, b, c and d (these are the values to optimize).

Then a 1x23 column is created which I call CFPPi with the results of these values.

The next instruction is to create a 23 x69 matrix with the following instruction: prediction = CFPPi. * biodiesel_composition (biodiesel_composition is a 23x69 database).

Then I create a 1 x 69 row by doing the sum of each prediction column using the following operation biodisel_cfpp = sum (prediction, 1).

Lastly, I have another row of 1 x69, called experimental_value. These are the values that I want to approach by optimizing a, b, c and d and these 4 variables could be any random number that helps to minimize the error.

The main purpose is to make the RMSE error as small as possible. I did the above on Excel' solver using GNR nonlinear method and the results were pretty good but i want to double check in matlab if the optimization could be better. Can anyone suggest a solution?

Thanks in advance for your valuable help :)

syms a b c d

c6=1*a+4*b+1*d;

c8=1*a+6*b+1*d;

c10=1*a+8*b+1*d;

c12=1*a+10*b+1*d;

c14=1*a+12*b+1*d;

c14_1=1*a+10*b+2*c+1*d;

c15=1*a+13*b+1*d;

c16=1*a+14*b+1*d;

c16_1=1*a+12*b+2*c+1*d;

c17=1*a+15*b+1*d;

c17_1=1*a+13*b+2*c+1*d;

c18=1*a+16*b+1*d;

c18_1=1*a+14*b+2*c+1*d;

c18_2=1*a+12*b+4*c+1*d;

c18_3=1*a+10*b+6*c+1*d;

c20=1*a+18*b+1*d;

c20_1=1*a+16*b+2*c+1*d;

c20_2=1*a+14*b+4*c+1*d;

c20_4=1*a+10*b+8*c+1*d;

c22=1*a+20*b+1*d;

c22_1=1*a+18*b+2*c+1*d;

c24=1*a+22*b+1*d;

c24_1=1*a+20*b+2*c+1*d;

CFPPi=[c6;c8;c10;c12;c14;c14_1;c15;c16;c16_1;c17;c17_1;c18;c18_1;c18_2;c18_3;c20;c20_1;c20_2;c20_4;c22;c22_1;c24;c24_1];

prediction=CFPPi.*biodiesel_composicion;

biodisel_cfpp=sum(prediccion,1);

function rmse (experimental_values,biodisel_cfpp)

r = sqrt(sum((experimental_values(:)-biodisel_cfpp(:)).^2/numel(experimental_values)))

end

## 0 Comments

Sign in to comment.