Minimizing a objective function, which includes an integral with argument 'x' and some unknown variables.

Objective function:
f1=
f2=
R1, R2 are the unknown variables whose values are to be optimized so that the objective function get maximized (-minimized).
Ws,Ss1,Ss2 are constants.
How to declare R1 and R2?
Declared x as syms, R1 and R2 if declared as optimvar then error is must be floating scalers, if declared as syms then converting the expression to numeric is showing error (vpa, double) as explicit exp is not possible to convert.
Thanks for answering in advance

 채택된 답변

R0 = [1 5];
R = fminsearch(@fun,R0)
function y = fun(R)
R1 = R(1);
R2 = R(2);
% Declare parameters
...
f1 = @(x) ...
f2 = @(x)...
int1 = integral(f1,0,R1);
int2 = integral(f2,R1,R1+R2);
y = -(int1+int2)
end

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

질문:

Sid
2022년 11월 14일

답변:

2022년 11월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by