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
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 个)

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by