Selecting an optimum value with 3 constraints

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Curve Fitting Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by