In order to tune parameters in rapid accelerator mode without rebuilding the model in Simulink 7.9 (R2012a), perform the following steps:
1. Open the modified Van Der Pol demo model('vdp_tunable.mdl') attached below and collect the run-time parameters in a run-time parameter structure while building a rapid accelerator target executable using the Simulink.BlockDiagram.buildRapidAcceleratorTarget function.
open_system('vdp_tunable')
rtp = Simulink.BlockDiagram.buildRapidAcceleratorTarget(bdroot);
Before building the rapid accelerator target in Step 1, you also need to perform an additional step of enabling the "Inline Parameters" option which is required for Rapid Accelerator parameter tuning and then adding the tunable parameters from the list to the "Global(Tunable) Parameters" table. This has already been performed for this model as can be seen from navigating to Configuration Parameters -> Optimization->Signals and Parameters ->Inline Parameters->Configure.
2. Tune the parameters by modifying the parameter structure by using the Simulink.BlockDiagram.modifyTunableParameters function.
rtp = Simulink.BlockDiagram.modifyTunableParameters(rtp,'a',10);
3. Specify the modified parameters to the SIM command by using the RapidAcceleratorParameterSets and RapidAcceleratorUpToDateCheck parameters as follows:
sim(bdroot,'SimulationMode', 'rapid','RapidAcceleratorUpToDateCheck',..'off','RapidAcceleratorParameterSets',rtp);
The model simulates with the modified parameter without rebuilding.
Best Answer