optimization and sensitivity analysis

4 次查看(过去 30 天)
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