error of "Too many input arguments." in my program of PSO- PI controller program
이전 댓글 표시
i m getting "Too many input arguments. " error while i am running the program for finding the optimum parameter values of fractional PI controller program.
댓글 수: 7
Walter Roberson
2018년 6월 9일
Are you using https://www.mathworks.com/matlabcentral/fileexchange/60874-fotf-toolbox for fotf, or are you using https://www.mathworks.com/matlabcentral/fileexchange/66323-fomcon-toolbox-for-matlab for fotf, or something else?
Anupam Ghosh
2018년 6월 11일
편집: Walter Roberson
2018년 6월 24일
Walter Roberson
2018년 6월 11일
That was the one I used to debug your code to point out that you used feedback inconsistently.
Anupam Ghosh
2018년 6월 24일
Walter Roberson
2018년 6월 24일
I used that same code for foft when I was debugging your program. By using that same code as you are using, I was able to locate the line in your code
e=1-step(feedback(plant*cont,1,t))
which tries to invoke feedback with three input arguments -- first plant*cont, then 1, then t.
However, feedback() is not defined to accept three input arguments.
About three lines earlier in the code you had
step(feedback(plant*cont,1));
which invoked feedback() with only two input arguments -- first plant*cost, then 1.
What was your intended difference in results between invoking
feedback(plant*cont,1)
or invoking
feedback(plant*cont,1,t)
? What did you expect different to happen when you passed in t as well as the other two arguments?
Anupam Ghosh
2018년 6월 28일
편집: Walter Roberson
2018년 6월 28일
Walter Roberson
2018년 6월 28일
You create
s = tf('s')
and you have
cont=Kp+(Ki/(s)^L);
which tries to raise s to the exponent stored in L .
When you are using transfer functions, the exponent you use with ^ has to be a finite integer.
In your first call to havas to deal with the initial conditions, you used round() to ensure that all of the inputs were integers. However, when you are later looping and updating your x variables, you do not take any care to ensure that x(3) is a positive integer.
답변 (1개)
Walter Roberson
2018년 6월 9일
In the line
e=1-step(feedback(plant*cont,1,t))
You are invoking feedback() with three input arguments. feedback() is only expecting two input arguments.
Just a few lines earlier you had invoked
step(feedback(plant*cont,1));
which uses it with two input arguments.
카테고리
도움말 센터 및 File Exchange에서 Particle Swarm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!