Is there a way to maximize an objective function to find the unknowns in the function?

2 views (last 30 days)
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!!

Accepted Answer

Walter Roberson
Walter Roberson on 20 Aug 2017
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()

More Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!