Fit a function with respect to a cost function

3 ビュー (過去 30 日間)
Mona Berg
Mona Berg 2021 年 1 月 18 日
回答済み: Prudhvi Peddagoni 2021 年 1 月 21 日
I have a function with 4 parameters and s (p is fixed and s is a vector and also fixed).
pwr = @(a,b,p,s) b.*(1-e.^(-(a/b).*s))+p;
In addition to that I have a cost function which consits of multiple steps. The result of my pwr function is one of the input parameters.
function cost = computeCost(dist,pwr,s,p,E,alpha)
% two differential equations and some other stuff
end
My goal is to adjust the parameters a and b for given parametrsp and s so that is in a defined range ().
I thought about using fmincon and passing the cost function as the nonlcon parameter. But as I'm not trying to mimize the pwr fucntion but the cost function this doesn't seem to be the right way. Does anybody have a hint for me how to do this?

回答 (1 件)

Prudhvi Peddagoni
Prudhvi Peddagoni 2021 年 1 月 21 日
Hi,
Since you are not trying to minimise or maximise anything here, you do not need to use fmincon function. You want to find values of a and b such that certain conditions hold. You can use solve or vpasolve function to do this.
Hope this helps.

カテゴリ

Help Center および File ExchangeNonlinear Optimization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by