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
댓글 수: 0
답변 (1개)
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)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Curve Fitting Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!