% Tutorial: generat cmprhnsv_Data using function gen_cmprhnsv_Data.p >> sysc=[tf(1,[1 1]), tf(2,[10 1]);tf(1,[5 1],'inputdelay',2), tf(3,[8 1],'inputdelay',1)]; % generate continuous TF >> sysd=c2d(sysc,1); % try discrete TF >> sysK=dcgain(sysc); % try gain matrix. Note LMIPA can take continuous model, discrete mode, or simply gain matrix >> y=randn(100,2); % generate output data randomly >> u=randn(100,2); % generate input data randomly (ignore actual input-output relation for illustration purpose) >> LL=-10*ones(4,1); % low constraint limit >> UU=10*ones(4,1); % high constrain limit >> Lc=randn(4,1); % linear coefficient for the objective function >> Qc=randn(4,1); % Quadratic coefficient for the objective function >> Tc=zeros(4,1); % Target coefficient for the objective function (see manual for explanation) >> gen_cmprhnsv_Data % generate data and model for LMIPA Consider a process with m inputs and p outputs 1. Plant model (continuous/discrete): p x m tf matrix or static gain matrix 1. Output data (y): N x p matrix 2. Input data (u): N x m matrix 3. Sampling time 4. Low limit data: (p + m) x 1 vector 5. High limit data: (p + m) x 1 vector 6. Linear coefficients: (p + m) x 1 vector 7. Quadratic coefficients: (p + m) x 1 vector 8. Target coefficients: (p + m) x 1 vector Continuous/discrete transfer function matrix: sysc % try continuous TF Output data matrix y Input data matrix u Sampling time: 1 Low limit data vector: LL High limit data vector: UU Linear coefficients data vector: Lc Quadratic coefficients data vector: Qc Target coefficients data vector: Tc The file name to save comprehensive data (e.g. test_cmprhnsv_data): test_cmprhnsv_data_con The file name to save plant model (e.g. test_model): test_model_con >> % Data/model generation has completed. Let's try to generate alternative data/model using discrete TF >> gen_cmprhnsv_Data Consider a process with m inputs and p outputs 1. Plant model (continuous/discrete): p x m tf matrix or static gain matrix 1. Output data (y): N x p matrix 2. Input data (u): N x m matrix 3. Sampling time 4. Low limit data: (p + m) x 1 vector 5. High limit data: (p + m) x 1 vector 6. Linear coefficients: (p + m) x 1 vector 7. Quadratic coefficients: (p + m) x 1 vector 8. Target coefficients: (p + m) x 1 vector Continuous/discrete transfer function matrix: sysd Output data matrix y Input data matrix u Sampling time: 1 Low limit data vector: LL High limit data vector: UU Linear coefficients data vector: Lc Quadratic coefficients data vector: Qc Target coefficients data vector: Tc The file name to save comprehensive data (e.g. test_cmprhnsv_data): test_cmprhnsv_data_dis The file name to save plant model (e.g. test_model): test_model_dis >> % Data/model generation using discrete TF has completed. Let's try to use gain directly next >> gen_cmprhnsv_Data Consider a process with m inputs and p outputs 1. Plant model (continuous/discrete): p x m tf matrix or static gain matrix 1. Output data (y): N x p matrix 2. Input data (u): N x m matrix 3. Sampling time 4. Low limit data: (p + m) x 1 vector 5. High limit data: (p + m) x 1 vector 6. Linear coefficients: (p + m) x 1 vector 7. Quadratic coefficients: (p + m) x 1 vector 8. Target coefficients: (p + m) x 1 vector Continuous/discrete transfer function matrix: sysK Output data matrix y Input data matrix u Sampling time: 1 Low limit data vector: LL High limit data vector: UU Linear coefficients data vector: Lc Quadratic coefficients data vector: Qc Target coefficients data vector: Tc The file name to save comprehensive data (e.g. test_cmprhnsv_data): test_cmprhnsv_data_K The file name to save plant model (e.g. test_model): test_model_K >> % We have generate 3 sets of data/models. They are equivalent. We can use any one for LMIPA and the results should be same >> % Next we shall start main_lmipa in the directory contaving LMIPA and then input any of the three generated data/models for economic performance assessment