Programmatically changing the parameters of a LTI System Block in Simulink

Illustration
Madalynn - 2020-12-18T09:59:16+00:00
Question: Programmatically changing the parameters of a LTI System Block in Simulink

I am using an algorithm to iteratively optimize my controller during the simulation, so i need to update my controller parameters while the simulation is running, before i changed to using LTI System block I've used set_param function to programmatically change numerator and denominator parameters in a transfer function to update my controller during the simulation but now i need to be using the LTI System block and i can't seem to find out what the 'LTI system variable parameter' is called by. This is the function i am using right now: set_param('ES_Optimizer/LTI System', 'LTI system variable', [char('tf(['), num2str(K1), char(' '), num2str(K2), char(' '), num2str(K3), char('],[1 '), num2str(K4), char(' '), num2str(K5), char('])')]) Where K1 through K5 are my controller parameters for a 2nd order controller However it is giving me the error: An error occurred while running the simulation and the simulation was terminated Caused by: LTI Block block (mask) does not have a parameter named 'LTI system variable' I believe the "LTI system variable" parameter needs to be something else but i couldn't find what is the correct name for the parameter.

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

The parameter names are "sys" and "IC".

 

get_param('ES_Optimizer/LTI System','sys')
get_param('ES_Optimizer/LTI System','IC')


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!