optimization using symbolic toolbox

조회 수: 4 (최근 30일)
eden meirovich
eden meirovich 2021년 1월 8일
답변: Alan Weiss 2021년 1월 10일
hello
I'm trying to use an optimization toolbox with syms variables.
I want to max j (for a given time),or max the expression j =trace(M)-t, for eta and delta.
i have 3 constrains
-60<T>60
-200<omega<200
-5<dT/dt<5
could some one guide me? cant make it work!
thanks
my code looks like that:
syms eta delta t
T = eta*t;
omega = delta*t;
H = [omega 1 T];
HH = transpose(H)*H ;
M = int(HH);
j = trace(M);

답변 (1개)

Alan Weiss
Alan Weiss 2021년 1월 10일
Your code returns
j =
(delta^2*t^3)/3 + (eta^2*t^3)/3 + t
With this information, the symbolic portion of your problem is done. Now use standard MATLAB functions.
Create a function of x = [delta eta] that you want to maximize, and create appropriate constraints. For details, see Solve a Constrained Nonlinear Problem, Solver-Based, Writing Scalar Objective Functions, Maximizing an Objective, and Write Constraints.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by