Is there a way to maximize an objective function to find the unknowns in the function?
1 次查看(过去 30 天)
显示 更早的评论

I need to find the unknowns, n and m by maximizing r using the equation at the bottom. I have a set of data containing the values of ?, d?/dt, and T but I am not sure how to sum up the y values into ?y as they contain n and m. Is there a way for matlab to solve it? Can someone kindly suggest a solution? Thank you!!
采纳的回答
Walter Roberson
2017-8-20
function f = obj(nm, a, da, T)
n = nm(1);
m = nm(2);
x = 1./T;
y = ln(da ./ ((1-a).^n .* a.^m) );
xy = x .* y;
sum_x = sum(x);
sum_y = sum(y);
and so on.
Then you would be optimizing with
a = ... appropriate alpha values
da = ... appropriate values for dalpha/dt
T = .... appropriate values for T
nm0 = randn(1, 2); %starting point for search
best_nm = fminsearch( @(nm) obj(nm, a, da, T), nm0 );
However, I suspect you might want to put some constraints on n and m; if so then you would be more likely to use fmincon()
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!