1.问题发现
在复现论文《Adaptive second order terminal sliding mode controller for robotic manipulators》http://dx.doi.org/10.1016/j.jfranklin.2013.08.027时Simulink一直报错:Output returned by S-function 'xxx' in 'xxx' during flag=3 call must be a real vector of length x
2.分析问题
经过调试发现时非奇异终端滑模面及其控制律中出现了求负数的分数次幂情况,基于此情况,MATLAB优先用欧拉公式把负数当复数看待并求幂得到同为复数的结果。
3.解决方法
将类似于形式转换为
即可。