Saturation function in Simulink
조회 수: 6 (최근 30일)
이전 댓글 표시
Hi, I would like to implement following block in simulink. How do I do it in Simulink: U = u_d - K/b * sat(σ /θ)
where: sat(σ/θ) = {1 if σ>θ, σ/θ if −θ ≤ σ ≤ θ, −1, σ < −θ}
u_d is input, K and b are constant. If possible even a matlab function would be appritiated.
댓글 수: 0
답변 (2개)
Sruthi Geetha
2017년 7월 17일
In Simulink, you can implement this using If block and If action subsystem block. In the If block you can specify the number of inputs, If, elseif and else conditions. Connect three If action subsystems to each condition and generate the outputs as 1, sigma/theta and -1 for each of the conditions. You can also do this using a simple code in MATLAB Fcn block:
if sigma>theta
out = 1;
elseif (sigma>=-theta)&&(sigma<=theta)
out = sigma/theta;
else
out = -1;
end
댓글 수: 3
Endrias
2019년 1월 21일
Simulink have a nice IF expression block which you can program the sat(.) function without any matlab written code. If anybody interested to see the block code, let me know.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Discontinuities에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!