Selecting an optimum value with 3 constraints

1 回表示 (過去 30 日間)
Giles_T_R_Abbbit
Giles_T_R_Abbbit 2016 年 4 月 1 日
回答済み: Kuifeng 2016 年 4 月 3 日
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.
Thanks

回答 (1 件)

Kuifeng
Kuifeng 2016 年 4 月 3 日
% 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)

カテゴリ

Help Center および File ExchangeCurve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by