optimization and sensitivity analysis

3 ビュー (過去 30 日間)
rui xiong
rui xiong 2021 年 1 月 7 日
回答済み: Kartik Saxena 2024 年 2 月 21 日
Hi. Here are my objectives:
  1. I want to find what are the value of "pa" and "pb" that maximize the equation: pi= (pa+pb)*na*nb, where "na" is a function of "pa", "nb" is a function of "pb".
  2. And I want to know how the optimal combination of pa,pb) changes with the parameter "ba" and "bb", and
  3. to draw a graph with "x=ba, y=bb, z =pa" as well as a graph "x=ba, y=bb, z =pb".
Could you please help me with the code? Thanks a lot.
Parameters
ba >=0 <=8
bb >=0 <=10
Variables
pa=0
pb=0
Equations
maximize (pa+pb)*na*nb
va=rand(1000,1)*ba;
vb=rand(1000,1)*bb;
na=0;
for i=1:size(va,1)
if va(i,1)>pa
na=na+1;
end
end
nb=0;
for i=1:size(vb,1)
if va(i,1)>pb
nb=nb+1;
end
end

回答 (1 件)

Kartik Saxena
Kartik Saxena 2024 年 2 月 21 日
Hi,
To find the values of 'pa' and 'pb' that maximize the equation "pi = (pa + pb) * na * nb", where 'na' is a function of 'pa' and 'nb' is a function of 'pb', and to understand how the optimal combination changes with parameters 'ba' and 'bb', you can use MATLAB's Global Optimization Toolbox.
All of these objectives can be achieved by using this toolbox along with functions like 'plot' and 'surf', which would eliminate the need for redundant code as well.
Refer to the following MathWorks documentation for detailed information regarding Global Optimization Toolbox:

カテゴリ

Help Center および File ExchangeGet Started with Optimization Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by