Change Perturbation Level of Blocks Perturbed During
Linearization
Blocks that do not have preprogrammed analytic Jacobians linearize using numerical
perturbation.
Change Block Perturbation Level
This example shows how to change the perturbation level to the Magnetic Ball Plant block
in the magball model. Changing the perturbation level changes the linearization results.
The default perturbation size is 10-5(1+|x|), where x is the operating point value of the
perturbed state or the input.
Open the model before changing the perturbation level.
To change the perturbation level of the states to 10 −^7 1+ x , where x is the state value,
type:
blockname='magball/Magnetic Ball Plant'
set_param(blockname,'StatePerturbationForJacobian','1e-7')
To change the perturbation level of the input to 10 −^7 1+ x , where x is the input signal
value:
(^1) Open the system and get the block port handles.
sys = 'magball';
open_system(sys)
blockname = 'magball/Magnetic Ball Plant';
ph = get_param(blockname,'PortHandles')
(^2) Get the handle to the inport value.
p_in = ph.Inport(1)
3 Set the inport perturbation level.
set_param(p_in,'PerturbationForJacobian','1e-7')
Change Perturbation Level of Blocks Perturbed During Linearization