Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Design Optimization   

initpar - Specify initial parameter values in response optimization project

Syntax

initpar(proj)

Description

initpar(proj) updates the parameters' initial guess in proj with the current parameter values in the model or base workspace. proj is a response optimization project, created using getsro or newsro.

Before using initpar, open the Simulink model associated with proj.

Examples

Initialize a response optimization project with updated parameter values:

  1. Run an optimization to meet step response requirements.

    % Open Simulink model.
    sldo_model1_constrblk
    % Create response optimization project to optimize
    % parameters Kd, Ki and Kp.
    proj=newsro('sldo_model1_constrblk',{'Kd','Ki','Kp'})
    % Extract design requirements from Signal Constraint block. 
    constr=findconstr(proj,...
    'sldo_model1_constrblk/Signal Constraint')
    % Specify step response requirements.
    constr.LowerBoundX=[0 10;10 15;15 50]; 
    constr.LowerBoundX=[0 10;10 30;30 50]; 
    constr.UpperBoundX=[0 30;30 50];
    constr.UpperBoundY=[1.1 1.1;1.01 1.01];
    % View initial value of Kd.
    proj.parameter(1).InitialGuess
    % Optimize parameters to meet step response requirements.
    optimize(proj);
    
  2. Specify a reference signal, and initialize proj with updated parameter values before running a new optimization.

    % Specify reference signal.
    constr.CostEnable='on'; 
    constr.ReferenceX=linspace(0,50,200)';
    constr.ReferenceY=1-exp(-0.3*linspace(0,50,200))';
    % The values of Kd, Ki and Kp are not updated
    % in proj. For example:
    proj.parameter(1).InitialGuess
    % Update proj with updated parameter values.
    initpar(proj);
    % View the updated initial value of Kd, which is now updated. 
    % The same is true for Ki and Kp.
    proj.parameter(1).InitialGuess
    % Rerun optimization to meet step requirements and
    % track the reference signal simultaneously.
    optimize(proj);
    

See Also

findconstr | findpar | newsro | optimize

Tutorials

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS