can someone please help me coding this saturation equations in matlab

38 views (last 30 days)
hello
u_s = sat(u) = [sat(u_1),.....,sat(u_m)]^T
sat(u_i) = sign(u_i)*min{|u_i|,u_max,i} ,u_max,i >0
U_i = [-u_max,i , u_max,i]
u_s = sat(u) = (1+psi_sat(u))*u
psi_sat(u) = diag (psi_1(u_1),....,psi_m(u_m))
where psi_i(u_i) ∈ R is a non-linear function
psi_i(u_i) = 0 for u_i ∈ U_i
or
psi_i(u_i) = (sat(u_i) /|u_i|)-1 for u_i ∉ U_i
can some tell me how to code this saturation equations . thank you
  • - - - - - - - - - - - - - - - - - - - - - - -

Accepted Answer

Torsten
Torsten on 9 Apr 2024 at 15:01
Edited: Torsten on 9 Apr 2024 at 15:02
m, umax and u have to be defined previously.
psi = zeros(m,1);
idx = abs(u) > umax;
psi(idx) = sign(u(idx)).*min(abs(u(idx)),umax(idx));
psi_sat = diag(psi);
us = (1 + psi_sat)*u

More Answers (0)

Categories

Find more on Mathematics and 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!