can someone please help me coding this saturation equations in matlab

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
  • - - - - - - - - - - - - - - - - - - - - - - -

 Akzeptierte Antwort

Torsten
Torsten am 9 Apr. 2024
Bearbeitet: Torsten am 9 Apr. 2024
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

Weitere Antworten (0)

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by