# Estimate Parameters of System Using Simulink Recursive Estimator Block

This example shows how to estimate the parameters of a two-parameter system and compare the measured and estimated outputs.

This example is the Simulink version of the command-line parameter-estimation example provided in recursiveLS.

The system has two parameters and is represented as: Here,

• and are the real-time input and output data, respectively.

• and are the regressors, , of the system.

• and are the parameters, , of the system.

Load the data and extract the input, output, and time information.

To directly compare this example with the command-line recursiveLS example, shift the time vector by one position. This shift synchronizes the Simulink input (time starts at 0) with the command-line input (time starts at the first sample time).

load iddata3 input = z3.u; output = z3.y; time = z3.SamplingInstants-1; 

Construct Input and Output signals for Simulink.

input_sig = timeseries(input,time); output_sig = timeseries(output,time); 

Open a preconfigured Simulink model based on the Recursive Least Squares Estimator block. In this model:

• The input_sig and output_sig blocks import input_sig and output_sig.

• The model constructs the Regressors signal by routing input_sig through a delay-line block, and then multiplexing the delayed signal with the original signal.

• An Error port provides the estimated error signal. A Sum block subtracts this error from input_sig to produce the estimated output.

• A Mux block then combines the measured (output_sig) and estimated output signals so that you can view them together on the scope.

rls = 'ex_RLS_Estimator_Block_sb_inf'; open_system(rls) Run the simulation. The Parameter Scope shows the progression of the estimation. The adjacent Parameter Display displays the final numerical values. The Outputs Scope plots the measured and estimated outputs together.

sim(rls) open_system([rls '/Parameter Scope']) open_system([rls '/Outputs Scope']) You can explore other block configurations by modifying the model parameters. For instance,

• Change Estimation Method to see how your algorithm choices affect your results.

• Change History to finite and your Window Length to 30 to apply the sliding-window algorithm.
{"ft_lang_label":"__label__en","ft_lang_prob":0.6948665,"math_prob":0.9243398,"size":2248,"snap":"2020-45-2020-50","text_gpt3_token_len":475,"char_repetition_ratio":0.14260249,"word_repetition_ratio":0.0,"special_character_ratio":0.19795373,"punctuation_ratio":0.12010444,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9938093,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],"im_url_duplicate_count":[null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,2,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-10-22T16:01:07Z\",\"WARC-Record-ID\":\"<urn:uuid:7028e1bb-326a-4e6a-92dc-3b0a49838678>\",\"Content-Length\":\"71974\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:717c0a44-0ce3-42c0-aee5-8ce61d4be832>\",\"WARC-Concurrent-To\":\"<urn:uuid:c0d27c2b-989c-4727-ac0b-7ee731a1a7ad>\",\"WARC-IP-Address\":\"23.223.252.57\",\"WARC-Target-URI\":\"https://uk.mathworks.com/help/ident/ug/estimate-parameters-using-simulink-recursive-block.html\",\"WARC-Payload-Digest\":\"sha1:N4M2TNG37K22JP35UPYU7F36KZG5GLLF\",\"WARC-Block-Digest\":\"sha1:255EWLIMKRBA574MVNFHVURHL4LEXVIR\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-45/CC-MAIN-2020-45_segments_1603107879673.14_warc_CC-MAIN-20201022141106-20201022171106-00587.warc.gz\"}"}