GRADS – Gradient search optimization

Block SymbolLicensing group: ADVANCED
Qt SVG Document Exported by REXYGEN Studio f x0 START BRK x xopt fopt BSY iter E iE GRADS

Function Description
The GRADS block performs one-dimensional optimization of the f(x,v) function by gradient method, where x xmin,xmax is the optimized variable and v is an arbitrary vector variable. It is assumed that the value of the function f(x,v) for given x at time k is enumerated and fed to the f input at time k + n TS, where TS is the execution period of the GRADS block. This means that the individual optimization iterations have a period of n TS. The length of step of the gradient method is given by

grad = fi fi1 dxi1 dxi = gamma grad,

where i stands for i-th iteration. The step size is restricted to lie within the interval dmin,dmax. The value of the optimized variable for the next iteration is given by

xi+1 = xi + (dx)i

This block does not propagate the signal quality. More information can be found in the 1.4 section.

Input

f

Value of the optimized function f(.) for given x

Double (F64)

x0

Optimization starting point

Double (F64)

START

Starting signal (rising edge)

Bool

BRK

Termination signal

Bool

Parameter

xmin

Lower limit for the x variable

Double (F64)

xmax

Upper limit for the x variable  10.0

Double (F64)

gamma

Step size coefficient  0.3

Double (F64)

d0

Initial step size  0.05

Double (F64)

dmin

Minimum step size  0.01

Double (F64)

dmax

Maximum step size  1.0

Double (F64)

n

Iteration period (in sampling periods Ts)  100

Long (I32)

itermax

Maximum number of iterations  20

Long (I32)

Output

x

Current value of the optimized variable

Double (F64)

xopt

Resulting optimal value of the x variable

Double (F64)

fopt

Resulting optimal value of the function f

Double (F64)

BSY

Busy flag

Bool

iter

Number of current iteration

Long (I32)

E

Error indicator

Bool

off ..

No error

on ...

An error occurred

iE

Error code

Long (I32)

1 ....

x out of limits

2 ....

x at the limit

2024 © REX Controls s.r.o., www.rexygen.com