Difference between revisions of "Penalty.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(→‎Arguments)
(→‎Arguments)
Line 15: Line 15:
 
      
 
      
 
     type        - string which identifies penalty type:
 
     type        - string which identifies penalty type:
−
 
+
 
             'NS'    - norm square, designed to favour low-power  
 
             'NS'    - norm square, designed to favour low-power  
 
                       waveforms over high-power ones.
 
                       waveforms over high-power ones.
Line 25: Line 25:
 
                       part of the waveform with values outside the  
 
                       part of the waveform with values outside the  
 
                       floor and ceiling bounds.
 
                       floor and ceiling bounds.
−
 
+
 
     fb          - floor bound, the lower bound on waveform used in the
 
     fb          - floor bound, the lower bound on waveform used in the
 
                     'SNS' penalty function.
 
                     'SNS' penalty function.

Revision as of 18:07, 21 July 2017


Penalty terms for the Optimal Control module.

Syntax

    [pen_term,pen_grad,pen_hess]=penalty(wf,type,fb,cb)

Description

Returns the penalty function and its gradient for the waveform, which should be supplied as row vector or a horizontal stack thereof.

Arguments

    wf           - control sequence waveform.
    
    type         - string which identifies penalty type:

            'NS'    - norm square, designed to favour low-power 
                      waveforms over high-power ones.
    
            'DNS'   - derivative norm square, designed to favour 
                      smooth waveforms over jagged ones.
    
            'SNS'   - spillout norm square, 'NS' applied to the 
                      part of the waveform with values outside the 
                      floor and ceiling bounds.

    fb           - floor bound, the lower bound on waveform used in the
                   'SNS' penalty function.
    
    cb           - ceiling bound, the upper bound on waveform used in the
                   'SNS' penalty function.

Returns

    pen_term     - value of the penalty term.
    
    pen_grad     - gradient of the penalty term with respect to wf.
    
    pen_hess     - Hessian of the penalty term with respect to wf.

Notes

The waveforms on different channels are assumed to be stored in the rows of the input array. The Hessian elements correspond to the elements of the waveform array ordered as:

   [X1 Y1 Z1 X2 Y2 Z2 ... Xn Yn Zn]

where X,Y,Z are different control channels and the index enumerates the time discretization points. Gradient dimensions and element order are the same as the input waveform dimensions and element order.

See also

grape.m, grape_xy.m, grape_phase.m, ensemble.m


Version 2.0, authors: Ilya Kuprov, David Goodwin