use respnose optimization to tune current loop ,generate error must evaluate to real double vectors
Show older comments
hi gusy
i met a question when i use respnose optimization to tune current loop
generate an error like this :
Requirements, including custom requirements, must evaluate to real double vectors. The following cost function fields are invalid: Cleq.
my response requirements like this:
StepResp = sdo.requirements.StepResponseEnvelope;
StepResp.RiseTime = 0.02;
StepResp.SettlingTime = 0.08;
StepResp.PercentOvershoot = 10;
StepResp.FinalValue = 0.001;
StepResp.InitialValue = 0;
how can i solve this issue ,thanks guys
here its my project part:

1 Comment
Walter Roberson
on 9 May 2026 at 9:56
Possibly you are not setting Cleq? https://www.mathworks.com/help/sldo/ug/writing-a-custom-cost-function.html
Answers (0)
Categories
Find more on Simulink Design Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!