[Scilab-users] Optimization question
ebmb.sci
ebmb.sci at gmail.com
Wed Aug 13 03:11:41 CEST 2014
Hello All,
please, could someone guide me on how to proceed to minimize the following
polynomial using functions optim and numdiff. Since the parameters A and B
have different constraints (i.e.: A = [0 1] and B = [1000 2000]), how must I
sign the values and pass them for optim? I implemented a basic script to try
to do it, but it always returns with wrong results.
function f = myFc(x)
a = x(1);
b = x(2);
f = 0.000791 + 0.000027*a + -0.000037*b + 0.000180*a*b + -0.000126*a^2 +
-0.000162*b^2;
endfunction
function [f, g, ind] = myFcCost(x, ind)
f = myFc(x);
g = numdiff(myFc, x);
endfunction
x0 = [0 1];
[fopt, xopt] = optim(myFcCost, 'b', [0 1], [1000 2000], x0);
I am so thanks for any help in advance!
Best regards,
Eduardo.
--
View this message in context: http://mailinglists.scilab.org/Optimization-question-tp4031028.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
More information about the users
mailing list