Preview

Real-Time Computing and Control

Good Essays
Open Document
Open Document
832 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Real-Time Computing and Control
Using the recursive least squares method, obtain parameter estimates for different model structures. The program is below: clear all close all N=1500; % set lenghth of data y=zeros(1,N); u=zeros(1,N); yhat=zeros(1,N); e=zeros(1,N); noise=rand(1,N); % generate noise %ny=2; true value %nu=3; true value %ny=2; good// model with different order :test 1 %nu=4; %ny=3; bad %nu=5; %ny=4; bad %nu=5; %ny=3; good %nu=3; %ny=2; with more numerator terms:test 2 %nu=4; ny=2; %test 3 nu=3; m=ny+nu; P=eye(m,m)*1000; % set initial value of matrix P k=zeros(1,m); Phi=zeros(N,m); phi=zeros(1,m); theta=zeros(m,1); % set initial guess of parameters for i=1:5 % 5 loops results in 1500 iterations % each iteration contains 300 steps to ensure convergence of estimation for j=2*(i-1)*150+1:((2*i)-1)*150 u(j)=1; % u is defined as a step signal,repeated every 300 steps. end; end; for i=(nu+1):N %y(i)=0.5*y(i-1)-0.4*y(i-2)+0.2*u(i-2)+0.3*u(i-3)+0.4*u(i-4) %+0.0003*(noise(i)-0.5*noise(i-1)+0.4*noise(i-2)); %for text 2 %y(i)=0.5*y(i-2)-0.4*y(i-3)+0.2*u(i-3)+0.3*u(i-4) % +0.0003*(noise(i)-0.5*noise(i-1)+0.4*noise(i-2)); %for test 3 %y(i)=0.5*y(i-3)-0.4*y(i-4)+0.2*u(i-3)+0.3*u(i-4) %+0.0003*(noise(i)-0.5*noise(i-1)+0.4*noise(i-2)); %for test 3 % % test for different model structure above our noise suppression test

y(i)=0.5*y(i-1)-0.4*y(i-2)+0.2*u(i-2)+0.3*u(i-3)+0.3*(noise(i)-0.5*noise(i1)+0.4*noise(i-2)); % generate real output data end; for i=(max(nu,ny)+1):N for j=1:ny Phi(i,j)=y(i-j); end; % update Phi matrix for j=(ny+1):m Phi(i,j)=u(i-(j-ny)); % For this line, max of (j-ny) is nu, to have (i-(jny)) positive, i should be i>nu. % Therefore, i should be defined as i=(max(nu,ny)+1):N. end; % Each row of Phi is made of 2 steps of past value of y and 2 steps of past value of u. % It is assumed here that the guesses on % numbers of entries in the numerator and % denominator are both successful.

phi=Phi(i,:); % phi is the last row in Phi.% P=P-P*phi'*inv(1+phi*P*phi')*phi*P; % P is derived

You May Also Find These Documents Helpful

  • Good Essays

    Response | |1 |3.86 |-0.0140 |-0.0512 |-0.198 |- |0.0240 |0.00704 |0.0272 |- | |2 |7.72 |0.0210 |0.0768 |0.296 |- |0.0370 |0.0109 |0.0421 |- | |3 |11.6 |0.0610 |0.223 |0.861 |- |0.0300 |0.00880 |0.0340 |- | |4 |15.4 |0.0280 |0.102 |0.394 |- |0.314 |0.0921 |0.356 |+ | |5 |19.3 |-0.0610 |-0.223 |-0.861 |- |0.0800 |0.0235 |0.0907 |- | |6 |23.2 |0.0470 |0.172 |0.664 |+ |0.0480 |0.0141 |0.0544 |- | |7 |27.0 |0.459 |1.68 |6.48 |+ |0.000 |0.000 |0.000 |- | |8 |30.9 |0.727 |2.66 |10.3 |+ |0.0240 |0.00704 |0.0272 |- | |9…

    • 1380 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    OPRE/411 Week 4

    • 379 Words
    • 2 Pages

    complete the model in the given file in Blackboard and report the optimal solution and…

    • 379 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Step 3: Complete the following pseudocode based on the algorithm and the variables you declared above.…

    • 777 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    ECON 2206 assignment 2

    • 607 Words
    • 3 Pages

    MLR 1 (Linear in Parameters) – From observation of equation (2) we can see that the model in the population can be written in the form y = β0 + β1X1 + …+ βkXk + u. In the model β1, β2 …βk are the unknown parameters of interest and u is an unobserved random error.…

    • 607 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    This model provided the lowest combination of Bias, MAD and MAPE. A table (Exhibit 1) is included following this memo showing the numerical results of running this model.…

    • 247 Words
    • 1 Page
    Satisfactory Essays
  • Good Essays

    No partial credit is given, so please carefully check anything typed into MATLAB, and check the…

    • 1357 Words
    • 17 Pages
    Good Essays
  • Powerful Essays

    Best Case Scenarios

    • 442 Words
    • 2 Pages

    c1n + c2(n-1) + c3n^2 + c4(n^2-1) + c5(0) + c6(n^2-1) + c7(0) + c8(0) + c9(0) =…

    • 442 Words
    • 2 Pages
    Powerful Essays
  • Powerful Essays

    The purpose of this experiment was to separate proteins on the basis of their net charge at a particular pH. In cation exchange chromatography positively charged molecules are attracted to a negatively charged column. Conversely, in anion exchange chromatography, negatively charged molecules are attracted to a positively charged column. Experimental results could be monitored in a predictable way by controlling running pH, salt concentration, and by selecting the type of ion exchanger.…

    • 1244 Words
    • 5 Pages
    Powerful Essays
  • Good Essays

    Controlling Systems

    • 773 Words
    • 4 Pages

    Kaiser Permanente has opted to use the bureaucratic control system to help meet the challenges of such complex environment. Bureaucratic control system is design to measure progress toward planned performance and to ensure that they are in line with management's objectives (2004). Today, bureaucratic ideas are still widely used among organizations to ensure success. Kaiser Permanente has found this system to be reliable, accurate and secure; all these terms have assisted our large complex organization to control its vast amount of employees.…

    • 773 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Decision Making Problem

    • 1292 Words
    • 6 Pages

    of quantitative models. The technical appendix should include a formulation of a linear model, as we…

    • 1292 Words
    • 6 Pages
    Good Essays
  • Good Essays

    Producer vs Consumer

    • 590 Words
    • 3 Pages

    Comments are available in the code that will provide a full understanding of the program itself; however abstraction of the problem will be featured in this lab report. In the abstraction of this problem I had to reference…

    • 590 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Insert the Multisim capture of the input CH-1 and output CH-2 waveforms here. Record the positive and negative peak voltages and average voltage for the input and output signals. Enter the data in Table 1 under the Simulation column.…

    • 800 Words
    • 8 Pages
    Powerful Essays
  • Powerful Essays

    Property Crime Report

    • 1476 Words
    • 6 Pages

    I used the multiple regression equation of the least squares point estimates of ŷ =…

    • 1476 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    Control Systems

    • 759 Words
    • 4 Pages

    This paper will first explain exactly what a control system is and the purpose it serves. Next, this paper will turn its focus towards an incident of misreporting hours that happened in Dalman and Lei’s growing business, Sandwich Blitz Inc, and how the situation should be handled. The four step control process will be implemented and used accordingly to solve this problem within the company.…

    • 759 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Protac

    • 827 Words
    • 4 Pages

    1. 2. 3. 4. 5. Solver y programación lineal El modelo Optimización Informes en excel Ejercicios…

    • 827 Words
    • 4 Pages
    Good Essays

Related Topics