MATLAB Answers

Selecting an optimum value with 3 constraints

1 view (last 30 days)
Giles_T_R_Abbbit on 1 Apr 2016
Answered: Kuifeng on 3 Apr 2016
Hi...hoping someone can help...
In the following function, f(r), A and p are constants:
f(r) = A*exp(-r/p)
When this function is put into a specialist code [unimportant here], various properties can be predicted. My overall task is to determine the values of A and p that accurately reproduce the known values of these properties for my system of interest.
By varying the values of A and p, I have obtained a solution set of A-p pairs (that covers the range 1000 <= A <= 3500) that accurately give the height, width and depth of my system. I thus look at how well three other properties are reproduced: plotting predicted values of these - p1_f, p2_f and p3_f - against A gives the following graph:
The known values of these three properties - p1, p2 and p3 - are overlayed on the plot and occur at very different values of A.
Thus, I need to 'select' (possibly by least squares?) the optimum value of A such that the difference between the predicted values of these properties and the known values is a minimum.
Unfortunately, I have no idea how to go about this, so would really appreciate some help/advice.

Answers (1)

Kuifeng on 3 Apr 2016
% 1 natural log both sides
log_y = log(y);
log_r = log(r);
% 2 linear fitting to find best A and p values for known r and y.
doc polyfit
%p = polyfit(log_r, log_y)

Community Treasure Hunt

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

Start Hunting!

Translated by