optimization and sensitivity analysis

조회 수: 2 (최근 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 CenterFile Exchange에서 Get 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