필터 지우기
필터 지우기

The problem is that i am getting negative values of kp and ki, how i can get value in specific range?

조회 수: 12 (최근 30일)
function F = tracklsq(pid)
syms x;
limit_1 = 0;
limit_2 = 10;
Area = int(x,limit_1, limit_2);
Kp = pid(1);
Ki = pid(2);
z=Kp*0.1+Ki*0.1*Area; %objective function
sys_overshoot=z-1; % compute the overshoot
alpha=10;beta=10;
F=0.1*2*beta+sys_overshoot*alpha;
end
PSO code is attached

답변 (1개)

Walter Roberson
Walter Roberson 2017년 7월 10일
Your pso code has
current_position = 10*(rand(dim, n)-.5);
rand() is going to be in the range 0 to 1, so rand() - 0.5 is going to be in the range -0.5 to +0.5; 10 times that would be -5 to +5 .
If you do not want negative inputs, then do not subtract .5 in this statement.
  댓글 수: 8
Walter Roberson
Walter Roberson 2017년 7월 12일
? How do you get from those minimizations in the paper to your u expression ??
zain yousaf
zain yousaf 2017년 7월 12일
i am choosing some random values of error, in the case of I-Iref, i set that equal to 0.1,and interms of integration, i am setting some limits and using integrating function to integrate t, in my code area=t. i hope u get my point. in this paper there is no transfer function, so i am not sure that should i use transfer function or not.

댓글을 달려면 로그인하십시오.

카테고리

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