├── Adaptive_Neural_Controller_F_V.slx ├── README.md ├── calcjjdjj1.m ├── csrchbac1.m ├── dyduvar1.m ├── predopt1.m └── ptest3sim21.mdl /Adaptive_Neural_Controller_F_V.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sina-97/ANPC_Control_Microgrid/649fa56e3439b8a944e4efbb032fdfccad7ff510/Adaptive_Neural_Controller_F_V.slx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ANPC_Control_Microgrid 2 | The goal of this project is to use an adaptive neural predictive controller for microgrid secondary control in Matlab Simulink. 3 | To run this code you need to change the directory of Matlab to this folder and try to use the latest version of Matlab. 4 | 5 | In this project, the NN Predictive Controller block was used and modified to work adaptively. We try to make the frequency and voltage 6 | of a specific point grid stable with the help of the secondary controller in case the load change. 7 | 8 | The microgrid is composed of Inner Loop and Outer Loop. The primary controller is responsible for the voltage and current of the inner loop, and the secondary controller is responsible for the control of the outer loop. Also, the PWM control method is used for controlling the inverter. 9 | 10 | Here is the image of Frequency control with ANPC: 11 | 12 | ![image](https://github.com/Sina-97/ANPC_Control_Microgrid/assets/134629943/ad71c190-a84b-498c-9493-be63d5d77442) 13 | 14 | And this is the image of Voltage control with ANPC: 15 | 16 | ![image](https://github.com/Sina-97/ANPC_Control_Microgrid/assets/134629943/aae6674a-c63d-4be2-b299-9c5cc19f7ac4) 17 | 18 | -------------------------------------------------------------------------------- /calcjjdjj1.m: -------------------------------------------------------------------------------- 1 | function [JJ,dJJ]=calcjjdjj1(u_vec,Ni1,Nu1,Nj1,N21,Ai,Ts1,ref,tiu,rho1,dUtilde_dU1,Normalize1,minp1,maxp1) 2 | %CALCJJDJJ Calculate the cost function JJ and the change in the cost function dJJ 3 | %with respect to U for the NN Predictive Controller. 4 | % 5 | % Synopsis 6 | % 7 | % [JJ,dJJ]=calcJJdJJ(u_vec,Ni,Nu,Nj,N2,Ai,Ts,ref,tiu,rho,dUtilde_dU,Normalize) 8 | % 9 | % Description 10 | % 11 | % This function predict the output of the system based on a previously trained 12 | % NN. With that information, calculates the cost function and the change in the 13 | % cost function based on the inputs to the plant. The cost function is: 14 | % 15 | % JJ = evec'*evec + rho*(duvec'*duvec); 16 | % 17 | % where: evec = Error during the cost horizon time. 18 | % duvec = Change in the control action during the control horizon time. 19 | % rho = Control weighting factor. 20 | % 21 | % [JJ,dJJ]=CALCJJDJJ(u_vec,Ni,Nu,Nj,N2,Ai,Ts,ref,tiu,rho,dUtilde_dU,Normalize) takes, 22 | % u_vec - Vector with sequence of control actions. 23 | % Ni - Number of delayed plant inputs. 24 | % Nu - Control Horizon. 25 | % Nj - Number of delayed plant outputs. 26 | % N2 - Cost Horizon. 27 | % Ai - Initial layer delay conditions. 28 | % Ts - Time steps. 29 | % ref - Reference input. 30 | % tiu - Initial time for U. 31 | % rho - Control weighting factor. 32 | % dUtlde_dU - Derivate of the difference of U(t)-U(t-1) respect U. 33 | % Normalize - Indicate if the NN has input-output normalized. 34 | % and returns, 35 | % JJ - Cost function value. 36 | % dJJ - Derivate of the cost function respect U. 37 | % 38 | % This function is being called by the line search functions (CSRCHBAC, CSRCHGOL, 39 | % CSRCHHYB, CSRCHCHA, CSRCHBRE) inside the function PREDOPT, that is located in 40 | % the Simulink block for the NN Predictive Controller. 41 | 42 | % Orlando De Jesus, Martin Hagan, 1-30-00 43 | % Copyright 1992-2002 The MathWorks, Inc. 44 | 45 | assignin('base','cont_u',evalin('base','cont_u')+1); 46 | 47 | set_param('ptest3sim21/Subsystem','u_init1',mat2str(u_vec(Ni1),20),'ud_init1',mat2str(u_vec(Ni1-1:-1:1),20), ... 48 | 'y_init1',mat2str(Ai{2,Nj1},20),'yd_init1',mat2str(cat(1,Ai{2,Nj1-1:-1:1}),20)); 49 | [time,xx0,Ac1,Ac2,E,gU,gUd,dY_dU] = sim('ptest3sim21',[0 N21*Ts1],[],[(0:Ts1:(N21-2)*Ts1)' u_vec(1:N21-1) ref(1:N21-1)]); 50 | 51 | yhat_vec=Ac1(1:N21+1,1)'; 52 | 53 | E=E(2:N21+1,:); 54 | gU=gU(1:N21,:)'; 55 | gUd=gUd(1:N21,:)'; 56 | 57 | evec=E; 58 | 59 | if tiu==1 60 | duvec = [0; u_vec(tiu+1:tiu+Nu1-1)-u_vec(tiu:tiu+Nu1-2)]; 61 | else 62 | duvec = u_vec(tiu:tiu+Nu1-1)-u_vec(tiu-1:tiu+Nu1-2); 63 | end 64 | 65 | JJ = evec'*evec + rho1*(duvec'*duvec); 66 | 67 | % Forward Perturbation 68 | dY_dU=dY_dU(2:N21+1,:)'; 69 | dJJ = 2*(-dY_dU*evec + rho1*(dUtilde_dU1*duvec)); 70 | if Normalize1 71 | dJJ=dJJ/(maxp1-minp1); 72 | end -------------------------------------------------------------------------------- /csrchbac1.m: -------------------------------------------------------------------------------- 1 | function [up_delta,J,dJdu_old,dJdu,retcode1,delta,tol] = csrchbac1(up,u_vec,ref,Ai,Nu,N1,N2,d,Ni,Nj,dX, ... 2 | dJdu,J,dperfa,delta,rho,dUtilde_dU,alpha,tol,Ts,min_i,max_i,Normalize,minp,maxp) 3 | 4 | %CSRCHBAC One-dimensional minimization using backtracking for the NN Predictive Controller. 5 | % 6 | % Syntax 7 | % 8 | % [up_delta,J,dJdu_old,dJdu,retcode1,delta,tol] = csrchbac(up,u_vec,ref,Ai,Nu,N1,N2,d,Ni,Nj,dX, ... 9 | % dJdu,J,dperfa,delta,rho,dUtilde_dU,alpha,tol,Ts,min_i,max_i,Normalize) 10 | % 11 | % Description 12 | % 13 | % CSRCHBAC is a linear search routine. It searches in a given direction 14 | % to locate the minimum of the performance function in that direction. 15 | % It uses a technique called backtracking. 16 | % 17 | % CSRCHBAC(...) takes these inputs, 18 | % up - Plant Inputs during the Control Horizon (Nu). 19 | % u - Plant Inputs during the Cost Horizon (N2). 20 | % ref - Reference input. 21 | % Ai - Initial input delay conditions. 22 | % Nu - Control Horizon. 23 | % N1 - Beginning of the Control and Cost Horizons (Usually 1). 24 | % N2 - Cost Horizon. 25 | % d - Counter that defined initial time (Usually 1). 26 | % Ni - Number of delayed plant inputs. 27 | % Nj - Number of delayed plant outputs. 28 | % dX - Search direction vector for U. 29 | % dJdu - Derivate of the cost function respect U. 30 | % J - Cost function value. 31 | % dperfa - Slope of performance value at current U in direction of dX. 32 | % delta - Initial step size. 33 | % rho - Control weighting factor. 34 | % dUtlde_dU - Derivate of the difference of U(t)-U(t-1) respect U. 35 | % alpha - Search parameter. 36 | % tol - Tolerance on search. 37 | % Ts - Time steps. 38 | % min_i - Minimum Input to the Plant. 39 | % max_i - Maximum Input to the Plant. 40 | % Normalize - Indicate if the NN has input-output normalized. 41 | % and returns, 42 | % up_delta - New Plant Inputs for the Control Horizon (Nu). 43 | % J - New Cost function value. 44 | % dJdu_old - Previous Derivate of the cost function respect U. 45 | % dJdu - New Derivate of the cost function respect U. 46 | % RETCODE - Return code which has three elements. The first two elements correspond to 47 | % the number of function evaluations in the two stages of the search 48 | % The third element is a return code. These will have different meanings 49 | % for different search algorithms. Some may not be used in this function. 50 | % 0 - normal; 1 - minimum step taken; 2 - maximum step taken; 51 | % 3 - beta condition not met. 52 | % DELTA - New initial step size. Based on the current step size. 53 | % TOL - New tolerance on search. 54 | % 55 | % Parameters used for the backstepping algorithm are: 56 | % alpha - Scale factor which determines sufficient reduction in perf. 57 | % beta - Scale factor which determines sufficiently large step size. 58 | % low_lim - Lower limit on change in step size. 59 | % up_lim - Upper limit on change in step size. 60 | % maxstep - Maximum step length. 61 | % minstep - Minimum step length. 62 | % scale_tol - Parameter which relates the tolerance tol to the initial step 63 | % size delta. Usually set to 20. 64 | % The defaults for these parameters are set in the training function which 65 | % calls it. See TRAINCGF, TRAINCGB, TRAINCGP, TRAINBFG, TRAINOSS 66 | % 67 | % Algorithm 68 | % 69 | % CSRCHBAC locates the minimum of the performance function in 70 | % the search direction dX, using the backtracking algorithm 71 | % described on page 126 and 328 of Dennis and Schnabel. 72 | % (Numerical Methods for Unconstrained Optimization and Nonlinear Equations 1983). 73 | % 74 | % See also CSRCHBRE, CSRCHCHA, CSRCHGOL, CSRCHHYB 75 | % 76 | % References 77 | % 78 | % Dennis and Schnabel, Numerical Methods for Unconstrained Optimization 79 | % and Nonlinear Equations, 1983. 80 | 81 | % Orlando De Jesus, Martin Hagan, 1-30-00 82 | % Copyright 1992-2002 The MathWorks, Inc. 83 | 84 | tiu = d-N1+Ni; 85 | upi = [1:Nu-1 Nu(ones(1,N2-d-Nu+2))]; % [1 2 ... Nu Nu ... Nu] 86 | uvi = [tiu:N2-N1+Ni]; 87 | 88 | % ALGORITHM PARAMETERS 89 | delta=1; 90 | scale_tol = 20; 91 | beta = 0.9; 92 | low_lim = 0.1; 93 | up_lim = 0.5; 94 | maxstep = 100; 95 | minstep = 1e-6; 96 | norm_dX = norm(dX); 97 | minlambda = minstep/norm_dX; 98 | maxlambda = maxstep/norm_dX; 99 | cnt1 = 0; 100 | cnt2 = 0; 101 | start = 1; 102 | 103 | perfa = J; 104 | delta_orig=delta; 105 | 106 | % TAKE INITIAL STEP 107 | lambda = 1; 108 | 109 | up_delta = max(min(up + lambda*dX,max_i),min_i); % A priori iteration 110 | u_vec(uvi) = up_delta(upi); % Insert updated controls 111 | 112 | % CALCULATE PERFORMANCE AT NEW POINT 113 | [JJ,dJJ]=calcjjdjj1(u_vec,Ni,Nu,Nj,N2,Ai,Ts,ref,tiu,rho,dUtilde_dU,Normalize,minp,maxp); 114 | perfb = JJ; 115 | dJdub = dJJ; 116 | 117 | perfb_old=perfb; 118 | lambda_old=lambda; 119 | g_flag = 0; 120 | cnt1 = cnt1 + 1; 121 | 122 | count = 0; 123 | % MINIMIZE ALONG A LINE (BACKTRACKING) 124 | retcode = 4; 125 | 126 | while retcode>3 127 | 128 | count=count+1; 129 | 130 | if (perfb <= perfa + alpha*lambda*dperfa) %CONDITION ALPHA IS SATISFIED 131 | 132 | if (g_flag == 0) 133 | dperfb = dJdub'*dX; 134 | end 135 | 136 | if (dperfb < beta * dperfa) %CONDITION BETA IS NOT SATISFIED 137 | 138 | if (start==1) & (norm_dX1)&(perfb>perfa+alpha*lambda*dperfa)) 168 | lambda_lo = min([lambda lambda_old]); 169 | lambda_diff = abs(lambda_old - lambda); 170 | 171 | if (lambda < lambda_old) 172 | perf_lo = perfb; 173 | perf_hi = perfb_old; 174 | else 175 | perf_lo = perfb_old; 176 | perf_hi = perfb; 177 | end 178 | 179 | while (dperfbminlambda) 180 | 181 | lambda_incr=-dperfb*(lambda_diff^2)/(2*(perf_hi-(perf_lo+dperfb*lambda_diff))); 182 | if (lambda_incr<0.2*lambda_diff) 183 | lambda_incr=0.2*lambda_diff; 184 | end 185 | 186 | %UPDATE X 187 | lambda = lambda_lo + lambda_incr; 188 | 189 | up_delta = max(min(up + lambda*dX,max_i),min_i); % A priori iteration 190 | u_vec(uvi) = up_delta(upi); % Insert updated controls 191 | 192 | % CALCULATE PERFORMANCE AT NEW POINT 193 | [JJ,dJJ]=calcjjdjj1(u_vec,Ni,Nu,Nj,N2,Ai,Ts,ref,tiu,rho,dUtilde_dU,Normalize,minp,maxp); 194 | perfb = JJ; 195 | dJdub = dJJ; 196 | 197 | g_flag = 0; 198 | cnt2 = cnt2 + 1; 199 | 200 | if (perfb>perfa+alpha*lambda*dperfa) 201 | lambda_diff = lambda_incr; 202 | perf_hi = perfb; 203 | else 204 | dperfb = dJdub'*dX; 205 | g_flag = 1; 206 | if (dperfb0.99*maxstep) % MAXIMUM STEP TAKEN 237 | retcode = 2; 238 | end 239 | 240 | else 241 | 242 | retcode = 0; 243 | 244 | if (lambda*norm_dX>0.99*maxstep) % MAXIMUM STEP TAKEN 245 | retcode = 2; 246 | end 247 | 248 | end 249 | 250 | elseif (lambda up_lim*lambda 279 | lambda_temp = up_lim*lambda; 280 | end 281 | 282 | % SAVE OLD VALUES OF LAMBDA AND FUNCTION DERIVATIVE 283 | lambda_old = lambda; 284 | perfb_old = perfb; 285 | dJdub_old = dJdub; 286 | upb_old=up_delta; 287 | 288 | 289 | % CHECK TO SEE THAT LAMBDA DOES NOT DECREASE TOO MUCH 290 | if lambda_temp < low_lim*lambda 291 | lambda = low_lim*lambda; 292 | else 293 | lambda = lambda_temp; 294 | end 295 | 296 | % COMPUTE PERFORMANCE AND SLOPE AT NEW END POINT 297 | up_delta = max(min(up + lambda*dX,max_i),min_i); % A priori iteration 298 | u_vec(uvi) = up_delta(upi); % Insert updated controls 299 | 300 | %----- Determine prediction yhat(t+k,up_delta) ----- 301 | [JJ,dJJ]=calcjjdjj1(u_vec,Ni,Nu,Nj,N2,Ai,Ts,ref,tiu,rho,dUtilde_dU,Normalize,minp,maxp); 302 | perfb = JJ; 303 | dJdub = dJJ; 304 | 305 | g_flag = 0; 306 | cnt2 = cnt2 + 1; 307 | 308 | end 309 | 310 | start = 0; 311 | 312 | end 313 | 314 | if perfb<=perfb_old 315 | J=perfb; 316 | dJdu_old=dJdu; 317 | dJdu=dJdub; 318 | a = lambda; 319 | else 320 | J=perfb_old; 321 | dJdu_old=dJdu; 322 | dJdu=dJdub_old; 323 | up_delta=upb_old; 324 | a = lambda_old; 325 | end 326 | 327 | 328 | % CHANGE INITIAL STEP SIZE TO PREVIOUS STEP 329 | delta=a; 330 | if delta < delta_orig 331 | delta = delta_orig; 332 | end 333 | if tol>delta/scale_tol 334 | tol=delta/scale_tol; 335 | end 336 | 337 | retcode1 = [cnt1 cnt2 retcode]; 338 | 339 | -------------------------------------------------------------------------------- /dyduvar1.m: -------------------------------------------------------------------------------- 1 | function [sys1,x01,str1,ts1] = dyduvar1(t1,x1,u1,flag1,Nu1,Ni1,Nj1,Ts1,minp1,maxp1,mint1,maxt1,Normalize1) 2 | %DYDUVAR This function calculates the partial derivative of the 3 | % output Y respect to the input U. It's intended to be used with 4 | % the function ptest2sim2 of the Neural Network Predictive Controller. 5 | % 6 | % See sfuntmpl.m for a general S-function template. 7 | % 8 | % See also SFUNTMPL. 9 | 10 | % Orlando De Jesus, Martin Hagan, 1-30-00 11 | % Copyright 1992-2010 The MathWorks, Inc. 12 | 13 | switch flag1, 14 | 15 | %%%%%%%%%%%%%%%%%% 16 | % Initialization % 17 | %%%%%%%%%%%%%%%%%% 18 | case 0, 19 | [sys1,x01,str1,ts1]=mdlInitializeSizes(Nu1,Ni1,Nj1,Ts1); 20 | 21 | %%%%%%%%%% 22 | % Update % 23 | %%%%%%%%%% 24 | case 2, 25 | sys1 = mdlUpdate(t1,x1,u1,Nu1,Ni1,Nj1); 26 | 27 | %%%%%%%%%% 28 | % Output % 29 | %%%%%%%%%% 30 | case 3, 31 | sys1 = mdlOutputs(t1,x1,u1,Nu1,Ni1,Nj1,minp1,maxp1,mint1,maxt1,Normalize1); 32 | 33 | %%%%%%%%%%%%% 34 | % Terminate % 35 | %%%%%%%%%%%%% 36 | case 9, 37 | sys1 = []; 38 | 39 | otherwise 40 | nnerr.throw('Control',['unhandled flag = ',num2str(flag1)]); 41 | end 42 | 43 | %end sfundsc1 44 | 45 | % 46 | %============================================================================= 47 | % mdlInitializeSizes 48 | % Return the sizes, initial conditions, and sample times for the S-function. 49 | %============================================================================= 50 | % 51 | function [sys1,x01,str1,ts1]=mdlInitializeSizes(Nu1,Ni1,Nj1,Ts1) 52 | 53 | sizes = simsizes; 54 | 55 | sizes.NumContStates = 0; 56 | sizes.NumDiscStates = Nu1*(Ni1+Nj1); 57 | sizes.NumOutputs = Nu1; 58 | sizes.NumInputs = -1; 59 | sizes.DirFeedthrough = 0; 60 | sizes.NumSampleTimes = 1; 61 | 62 | sys1 = simsizes(sizes); 63 | 64 | x01 = zeros(Nu1*(Ni1+Nj1),1); 65 | x01(1)=1; 66 | str1 = []; 67 | ts1 = [Ts1 0]; % Inherited sample time 68 | 69 | % end mdlInitializeSizes 70 | 71 | % 72 | %======================================================================= 73 | % mdlUpdate 74 | % Handle discrete state updates, sample time hits, and major time step 75 | % requirements. 76 | %======================================================================= 77 | % 78 | function sys1 = mdlOutputs(t1,x1,u1,Nu1,Ni1,Nj1,minp1,maxp1,mint1,maxt1,Normalize1) 79 | sys1 = x1(Ni1+1); 80 | for k=1:Nu1-1 81 | sys1 = [sys1;x1(k*(Ni1+Nj1)+Ni1+1)];%u; 82 | if Normalize1 83 | sys1=sys1*(maxt1-mint1)/(maxp1-minp1); 84 | end 85 | end 86 | 87 | %end mdlUpdate 88 | 89 | % 90 | %======================================================================= 91 | % mdlOutputs 92 | % Return the output vector for the S-function 93 | %======================================================================= 94 | % 95 | function sys1 = mdlUpdate(t1,x1,u1,Nu1,Ni1,Nj1) 96 | 97 | kk=(Nu1-1)*(Ni1+Nj1); 98 | out=u1(1:Ni1)'*x1(kk+1:kk+Ni1)+u1(Ni1+1:Ni1+Nj1)'*x1(kk+Ni1+1:kk+Ni1+Nj1); 99 | x1(kk+2:kk+Ni1)=x1(kk+1:kk+Ni1-1); 100 | if x1((Nu1-2)*(Ni1+Nj1)+1)==1 | x1(kk+1)==1 101 | x1(kk+1)=1; 102 | else 103 | x1(kk+1)=0; 104 | end 105 | x1(kk+Ni1+2:kk+(Ni1+Nj1))=x1(kk+Ni1+1:kk+(Ni1+Nj1)-1); 106 | x1(kk+Ni1+1)=out; 107 | 108 | for k=Nu1-1:-1:1 109 | kk=(k-1)*(Ni1+Nj1); 110 | out=u1(1:Ni1)'*x1(kk+1:kk+Ni1)+u1(Ni1+1:Ni1+Nj1)'*x1(kk+Ni1+1:kk+Ni1+Nj1); 111 | if k~=1 112 | x1(kk+1:kk+Ni1)=x1((k-2)*(Ni1+Nj1)+1:(k-2)*(Ni1+Nj1)+Ni1); 113 | else 114 | x1(kk+2:kk+Ni1)=x1(kk+1:kk+Ni1-1); 115 | x1(kk+1)=0; 116 | end 117 | x1(kk+Ni1+2:kk+Ni1+Nj1)=x1(kk+Ni1+1:kk+Ni1+Nj1-1); 118 | x1(kk+Ni1+1)=out; 119 | end 120 | 121 | 122 | sys1=x1; 123 | 124 | %end mdlUpdate 125 | 126 | 127 | -------------------------------------------------------------------------------- /predopt1.m: -------------------------------------------------------------------------------- 1 | function [sys1,x01,str1,ts1] = predopt1(t1,x1,u1,flag1,N21,Ts1,Nu1,maxiter1,csrchfun1,rho1,alpha1,S11,IW1,LW1_21,LW2_11,B11,B21,Ni1,Nj1,min_i1,max_i1,minp1,maxp1,mint1,maxt1,Normalize1) 2 | %PREDOPT Executes the Predictive Controller Approximation based on Gauss Newton. 3 | % 4 | 5 | % Copyright 1992-2010 The MathWorks, Inc. 6 | % Orlando De Jesus, Martin Hagan, 1-25-00 7 | 8 | switch flag1, 9 | 10 | %%%%%%%%%%%%%%%%%% 11 | % Initialization % 12 | %%%%%%%%%%%%%%%%%% 13 | case 0, 14 | load_system('ptest3sim21'); 15 | if Normalize1 16 | IW_gU1=((maxt1-mint1)/(maxp1-minp1))*IW1; 17 | else 18 | IW_gU1=IW1; 19 | end 20 | set_param('ptest3sim21/Subsystem','B21',num2str(B21,20),'B11',mat2str(B11,20),'LW2_11',mat2str(LW2_11,20), ... 21 | 'LW1_21',mat2str(LW1_21,20),'IW1',mat2str(IW1,20),'IW_gU1',mat2str(IW_gU1,20), ... 22 | 'Ts1',num2str(Ts1),'S11',num2str(S11),'Ni1',num2str(Ni1), ... 23 | 'Nj1',num2str(Nj1),'minp1',num2str(minp1,20),'maxp1',num2str(maxp1,20), ... 24 | 'minp1',num2str(minp1,20),'mint1',num2str(mint1,20),'maxt1',num2str(maxt1,20), ... 25 | 'Normalize1',num2str(Normalize1),'Nu1',num2str(Nu1)); 26 | assignin('base','t_init',cputime); 27 | assignin('base','cont_u',0); 28 | [sys1,x01,str1,ts1]=mdlInitializeSizes(N21,Ts1,Nu1,alpha1,S11,Ni1,Nj1,min_i1,max_i1); 29 | 30 | %%%%%%%%%% 31 | % Update % 32 | %%%%%%%%%% 33 | case 2, 34 | IW_gU1=IW1; 35 | 36 | set_param('ptest3sim21/Subsystem','B21',num2str(B21,20),'B11',mat2str(B11,20),'LW2_11',mat2str(LW2_11,20), ... 37 | 'LW1_21',mat2str(LW1_21,20),'IW1',mat2str(IW1,20),'IW_gU1',mat2str(IW_gU1,20), ... 38 | 'Ts1',num2str(Ts1),'S11',num2str(S11),'Ni1',num2str(Ni1), ... 39 | 'Nj1',num2str(Nj1),'minp1',num2str(minp1,20),'maxp1',num2str(maxp1,20), ... 40 | 'minp1',num2str(minp1,20),'mint1',num2str(mint1,20),'maxt1',num2str(maxt1,20), ... 41 | 'Normalize1',num2str(Normalize1),'Nu1',num2str(Nu1)); 42 | assignin('base','t_init',cputime); 43 | assignin('base','cont_u',0); 44 | sys1 = mdlUpdate(t1,x1,u1,N21,Ts1,Nu1,maxiter1,csrchfun1,rho1,alpha1,S11,Ni1,Nj1,min_i1,max_i1,minp1,maxp1,mint1,maxt1,Normalize1); 45 | 46 | %%%%%%%%%% 47 | % Output % 48 | %%%%%%%%%% 49 | case 3, 50 | sys1 = mdlOutputs(t1,x1,u1,Nu1,Ni1); 51 | 52 | %%%%%%%%%%%%% 53 | % Terminate % 54 | %%%%%%%%%%%%% 55 | case 9, 56 | close_system('ptest3sim21',0); 57 | assignin('base','t_end',cputime); 58 | sys1 = []; 59 | 60 | otherwise 61 | nnerr.throw('Control',['unhandled flag1 = ',num2str(flag1)]) 62 | end 63 | 64 | %end sfundscl 65 | 66 | % 67 | %============================================================================= 68 | % mdlInitializeSizes 69 | % Return the sizes, initial conditions, and sample times for the S-function. 70 | %============================================================================= 71 | % 72 | function [sys1,x01,str1,ts1]=mdlInitializeSizes(N21,Ts1,Nu1,alpha1,S11,Ni1,Nj1,min_i1,max_i1) 73 | 74 | global tiu1 dUtilde_dU1 75 | global N11 d1 alpha21 upi1 uvi1 76 | 77 | sizes = simsizes; 78 | 79 | sizes.NumContStates = 0; 80 | sizes.NumDiscStates = Ni1+Nu1-1+(S11+1)*(Nj1-1); 81 | sizes.NumOutputs = 1; 82 | sizes.NumInputs = -1; 83 | sizes.DirFeedthrough = 0; 84 | sizes.NumSampleTimes = 1; 85 | 86 | sys1 = simsizes(sizes); 87 | 88 | % State Index: 89 | % 90 | % x(1:Ni-1) = Previous Plant input u - Controller output (Size Ni-1). 91 | % x(Ni) = Actual Plant input u - Controller output (Size 1). 92 | % x(Ni+1:Nu+Ni-1) = Next Plant input u - Controller output (Size Nu-1). 93 | % x(Nu+Ni) = Previous NN 2nd layer output (Size 1). 94 | % x(Nu+Ni+1:Nu+Ni+S1) = Previous NN 1st layer output (Size S1). 95 | % 96 | % Last two variables will repeat in case of multiple outputs. Not tested yet. 97 | % 98 | x01 = zeros(Ni1+Nu1-1+(S11+1)*(Nj1-1),1); 99 | % ODJ 1-31-00 We place initial Plant input u - Controller output at mid range. 100 | x01(Ni1:Nu1+Ni1-1) = (max_i1-min_i1)/2; 101 | str1 = []; 102 | ts1 = [Ts1 0]; % Inherited sample time 103 | 104 | tiu1=Ni1; 105 | dUtilde_dU1 = eye(Nu1); 106 | dUtilde_dU1(1:Nu1-1,2:Nu1)=dUtilde_dU1(1:Nu1-1,2:Nu1)-eye(Nu1-1); 107 | N11=1; 108 | d1=1; 109 | alpha21 = alpha1*alpha1; 110 | upi1 = [1:Nu1-1 Nu1(ones(1,N21-d1-Nu1+2))]; 111 | uvi1 = [tiu1:N21-N11+Ni1]; 112 | 113 | % end mdlInitializeSizes 114 | 115 | % 116 | %======================================================================= 117 | % mdlUpdate 118 | % Handle discrete state updates, sample time hits, and major time step 119 | % requirements. 120 | %======================================================================= 121 | % 122 | function sys1 = mdlOutputs(t1,x1,u1,Nu1,Ni1) 123 | sys1 = x1(Ni1); 124 | 125 | %end mdlUpdate 126 | 127 | % 128 | %======================================================================= 129 | % mdlOutputs 130 | % Return the output vector for the S-function 131 | %======================================================================= 132 | % 133 | function sys1 = mdlUpdate(t1,x1,u1,N21,Ts1,Nu1,maxiter1,csrchfun1,rho1,alpha1,S11,Ni1,Nj1,min_i1,max_i1,minp1,maxp1,mint1,maxt1,Normalize1) 134 | 135 | global tiu1 dUtilde_dU1 136 | global N11 d1 alpha21 upi1 uvi1 137 | 138 | Ai=num2cell(zeros(2,Nj1)); 139 | for k=1:Nj1-1 140 | Ai{1,k}=x1(Nu1+Ni1+1+(k-1)*(S11+1):Nu1+Ni1+S11+(k-1)*(S11+1)); 141 | Ai{2,k}=x1(Nu1+Ni1+(k-1)*(S11+1)); % delayed plant output 142 | end 143 | Ai{1,Nj1}=u1(4:3+S11); 144 | 145 | ref(1:N21,1)=u1(1); 146 | initval = '[upmin(Nu1)]'; 147 | 148 | upmin=[x1(Ni1+1:Nu1+Ni1-1);x1(Nu1+Ni1-1)]; 149 | u_vec(1:Ni1-1,1)=x1(2:Ni1); 150 | if Normalize1 151 | ref=((ref-mint1)*2/(maxt1-mint1)-1); 152 | Ai{2,Nj1}=((u1(3)-mint1)*2/(maxt1-mint1)-1); % Actual NN output 153 | upmin=((upmin-minp1)*2/(maxp1-minp1)-1); 154 | u_vec=((u_vec-minp1)*2/(maxp1-minp1)-1); 155 | else 156 | Ai{2,Nj1}=u1(3); 157 | end 158 | 159 | upmin0 = upmin; 160 | einitval = eval(initval); % Evaluate inival string 161 | 162 | for tr=1:length(einitval), 163 | up=upmin0; % Initial value for numerical search for a new u 164 | up(Nu1)=einitval(tr); 165 | u_vec(uvi1,1) = up(upi1); 166 | dw = 1; % Flag specifying that up is new 167 | lambda = 0.1; % Initialize Levenberg-Marquardt parameter 168 | 169 | 170 | %>>>>>>>>>>>>>>> COMPUTE PREDICTIONS FROM TIME t+N1 TO t+N2 <<<<<<<<<<<<<<<< 171 | assignin('base','cont_u',evalin('base','cont_u')+1); 172 | 173 | set_param('ptest3sim21/Subsystem','u_init1',mat2str(u_vec(Ni1),20),'ud_init1',mat2str(u_vec(Ni1-1:-1:1),20), ... 174 | 'y_init1',mat2str(Ai{2,Nj1},20),'yd_init1',mat2str(cat(1,Ai{2,Nj1-1:-1:1}),20)); 175 | [time,xx0,Ac1,Ac2,E,gU,gUd,dY_dU] = sim('ptest3sim21',[0 N21*Ts1],[],[(0:Ts1:(N21-2)*Ts1)' u_vec(1:N21-1) ref(1:N21-1)]); 176 | 177 | yhat_vec=Ac1(1:N21+1,1)'; 178 | 179 | E=E(2:N21+1,:); 180 | 181 | gU=gU(1:N21,:)'; 182 | gUd=gUd(1:N21,:)'; 183 | 184 | evec=E; 185 | 186 | if tiu1==1 187 | duvec = [0; u_vec(tiu1+1:tiu1+Nu1-1)-u_vec(tiu1:tiu1+Nu1-2)]; 188 | else 189 | duvec = u_vec(tiu1:tiu1+Nu1-1)-u_vec(tiu1-1:tiu1+Nu1-2); 190 | end 191 | 192 | JJ = evec'*evec + rho1*(duvec'*duvec); 193 | 194 | % Forward Perturbation 195 | dY_dU=dY_dU(2:N21+1,:)'; 196 | dJJ = 2*(-dY_dU*evec + rho1*(dUtilde_dU1*duvec)); 197 | if Normalize1 198 | dJJ=dJJ/(maxp1-minp1); 199 | end 200 | 201 | %>>>>>>>>>>>>>>>>>>>>>> EVALUATE CRITERION <<<<<<<<<<<<<<<<<<<<<< 202 | J = JJ; 203 | 204 | 205 | %>>>>>>>>>>>>>>>>>>>>>>>> DETERMINE dyhat/du <<<<<<<<<<<<<<<<<<<<<<<<< 206 | 207 | %>>>>>>>>>>>>>>>>>>>>>>>>>>>> DETERMINE dJ/du <<<<<<<<<<<<<<<<<<<<<<<<<<<< 208 | dJdu = dJJ; 209 | 210 | 211 | %>>>>>>>>>>>>>>>>>>>>>> DETERMINE INVERSE HESSIAN <<<<<<<<<<<<<<<<<<<<<<<<< 212 | B = eye(Nu1); % Initialize Hessian to I 213 | 214 | 215 | delta=1; 216 | tol=1/delta; 217 | ch_perf = J; % for first iteration. 218 | %>>>>>>>>>>>>>>>>>>>>>>> BEGIN SEARCH FOR MINIMUM <<<<<<<<<<<<<<<<<<<<<< 219 | for m = 1:maxiter1, 220 | 221 | 222 | %>>>>>>>>>>>>>>>>>>>>>>> DETERMINE SEARCH DIRECTION <<<<<<<<<<<<<<<<<<<<<<< 223 | dX = -B*dJdu; 224 | 225 | if dX'*dJdu>0 % We reset the gradient if positive. 226 | %>>>>>>>>>>>>>>>>>>>>>> DETERMINE INVERSE HESSIAN <<<<<<<<<<<<<<<<<<<<<<<<< 227 | B = eye(Nu1); % Initialize Hessian to I 228 | delta=1; 229 | tol=1/delta; 230 | ch_perf = J; % for first iteration. 231 | %>>>>>>>>>>>>>>>>>>>>>>> DETERMINE SEARCH DIRECTION <<<<<<<<<<<<<<<<<<<<<<< 232 | dX = -B*dJdu; 233 | end 234 | 235 | if Normalize1 236 | switch csrchfun1, 237 | case 1, %'csrchgol', 238 | [up_delta,J,dJdu_old,dJdu,retcode,delta,tol]=csrchgol(up,u_vec,ref,Ai,Nu1,N11,N21,d1,Ni1,Nj1,dX,dJdu,J,dX'*dJdu,delta,rho1,dUtilde_dU1,alpha1,tol,Ts1,-1,1,Normalize1,minp1,maxp1); 239 | case 2 %'csrchbac1', 240 | [up_delta,J,dJdu_old,dJdu,retcode,delta,tol]=csrchbac1(up,u_vec,ref,Ai,Nu1,N11,N21,d1,Ni1,Nj1,dX,dJdu,J,dX'*dJdu,delta,rho1,dUtilde_dU1,alpha1,tol,Ts1,-1,1,Normalize1,minp1,maxp1); 241 | case 3 %'csrchhyb' 242 | [up_delta,J,dJdu_old,dJdu,retcode,delta,tol]=csrchhyb(up,u_vec,ref,Ai,Nu1,N11,N21,d1,Ni1,Nj1,dX,dJdu,J,dX'*dJdu,delta,rho1,dUtilde_dU1,alpha1,tol,Ts1,-1,1,Normalize1,minp1,maxp1); 243 | case 4 %'csrchbre' 244 | [up_delta,J,dJdu_old,dJdu,retcode,delta,tol]=csrchbre(up,u_vec,ref,Ai,Nu1,N11,N21,d1,Ni1,Nj1,dX,dJdu,J,dX'*dJdu,delta,rho1,dUtilde_dU1,alpha1,tol,Ts1,-1,1,Normalize1,minp1,maxp1); 245 | case 5 %'csrchcha' 246 | J_old=J; 247 | [up_delta,J,dJdu_old,dJdu,retcode,delta,tol]=csrchcha(up,u_vec,ref,Ai,Nu1,N11,N21,d1,Ni1,Nj1,dX,dJdu,J,dX'*dJdu,delta,rho1,dUtilde_dU1,alpha1,tol,Ts1,-1,1,Normalize1,minp1,maxp1,ch_perf); 248 | ch_perf = J - J_old; 249 | otherwise 250 | J_old=J; 251 | [up_delta,J,dJdu_old,dJdu,retcode,delta,tol]=feval(csrchfun1,up,u_vec,ref,Ai,Nu1,N11,N21,d1,Ni1,Nj1,dX,dJdu,J,dX'*dJdu,delta,rho1,dUtilde_dU1,alpha1,tol,Ts1,-1,1,Normalize1,minp1,maxp1,ch_perf); 252 | ch_perf = J - J_old; 253 | end 254 | else 255 | switch csrchfun1, 256 | case 1, %'csrchgol', 257 | [up_delta,J,dJdu_old,dJdu,retcode,delta,tol]=csrchgol(up,u_vec,ref,Ai,Nu1,N11,N21,d1,Ni1,Nj1,dX,dJdu,J,dX'*dJdu,delta,rho1,dUtilde_dU1,alpha1,tol,Ts1,min_i1,max_i1,Normalize1,minp1,maxp1); 258 | case 2 %'csrchbac1', 259 | [up_delta,J,dJdu_old,dJdu,retcode,delta,tol]=csrchbac1(up,u_vec,ref,Ai,Nu1,N11,N21,d1,Ni1,Nj1,dX,dJdu,J,dX'*dJdu,delta,rho1,dUtilde_dU1,alpha1,tol,Ts1,min_i1,max_i1,Normalize1,minp1,maxp1); 260 | case 3 %'csrchhyb' 261 | [up_delta,J,dJdu_old,dJdu,retcode,delta,tol]=csrchhyb(up,u_vec,ref,Ai,Nu1,N11,N21,d1,Ni1,Nj1,dX,dJdu,J,dX'*dJdu,delta,rho1,dUtilde_dU1,alpha1,tol,Ts1,min_i1,max_i1,Normalize1,minp1,maxp1); 262 | case 4 %'csrchbre' 263 | [up_delta,J,dJdu_old,dJdu,retcode,delta,tol]=csrchbre(up,u_vec,ref,Ai,Nu1,N11,N21,d1,Ni1,Nj1,dX,dJdu,J,dX'*dJdu,delta,rho1,dUtilde_dU1,alpha1,tol,Ts1,min_i1,max_i1,Normalize1,minp1,maxp1); 264 | case 5 %'csrchcha' 265 | J_old=J; 266 | [up_delta,J,dJdu_old,dJdu,retcode,delta,tol]=csrchcha(up,u_vec,ref,Ai,Nu1,N11,N21,d1,Ni1,Nj1,dX,dJdu,J,dX'*dJdu,delta,rho1,dUtilde_dU1,alpha1,tol,Ts1,min_i1,max_i1,Normalize1,minp1,maxp1,ch_perf); 267 | ch_perf = J - J_old; 268 | otherwise 269 | J_old=J; 270 | [up_delta,J,dJdu_old,dJdu,retcode,delta,tol]=feval(csrchfun1,up,u_vec,ref,Ai,Nu1,N11,N21,d1,Ni1,Nj1,dX,dJdu,J,dX'*dJdu,delta,rho1,dUtilde_dU1,alpha1,tol,Ts1,min_i1,max_i1,Normalize1,minp1,maxp1,ch_perf); 271 | ch_perf = J - J_old; 272 | end 273 | end 274 | 275 | 276 | %>>>>>>>>>>>>>>>>>>>>>>>> UPDATE FUTURE CONTROLS <<<<<<<<<<<<<<<<<<<<<<<<< 277 | up_old = up; 278 | up = up_delta; 279 | 280 | 281 | %>>>>>>>>>>>>>>>>>>>>>>>> CHECK STOP CONDITION <<<<<<<<<<<<<<<<<<<<<<< 282 | dup = up-up_old; 283 | if (dup'*dup < alpha21) | (ch_perf==0), 284 | break; 285 | end 286 | 287 | 288 | %>>>>>>>>>>>>>>>>>>> BFGS UPDATE OF INVERSE HESSIAN <<<<<<<<<<<<<<<<<< 289 | dG = dJdu - dJdu_old; 290 | BdG = B*dG; 291 | dupdG = dup'*dG; 292 | fac = 1/dupdG; 293 | diff = dup - BdG; 294 | dupfac=dup*fac; 295 | diffdup = diff*(dupfac'); 296 | B = B + diffdup + diffdup' - (diff'*dG)*(dupfac*dupfac'); 297 | end 298 | 299 | 300 | %>>>>>>>>>>>>>>>>>>>>>>> SELECT BEST MINIMUM <<<<<<<<<<<<<<<<<<<<<<<<< 301 | if tr==1, 302 | Jmin_old = J; 303 | upmin = up; 304 | else 305 | if J1 | upmin(1)<-1 313 | upmin(1)=upmin(1); 314 | end 315 | if Normalize1 316 | upmin=(upmin+1)*(maxp1-minp1)/2+minp1; 317 | end 318 | x1(Ni1:Nu1+Ni1-1)=upmin; % State 1 to Nu = actual controls 319 | for k=1:Nj1-2 320 | x1(Nu1+Ni1+1+(k-1)*(S11+1):Nu1+Ni1+S11+(k-1)*(S11+1))=x1(Nu1+Ni1+1+(k)*(S11+1):Nu1+Ni1+S11+(k)*(S11+1)); 321 | x1(Nu1+Ni1+(k-1)*(S11+1))=x1(Nu1+Ni1+(k)*(S11+1)); % delayed plant output 322 | end 323 | if Nj1>=2 324 | if Normalize1 325 | x1(Nu1+Ni1+(Nj1-2)*(S11+1))=((u1(3)-mint1)*2/(maxt1-mint1)-1); % state Nu+1 = NN output 326 | else 327 | x1(Nu1+Ni1+(Nj1-2)*(S11+1))=u1(2); 328 | end 329 | x1(Nu1+Ni1+1+(Nj1-2)*(S11+1):Nu1+Ni1+S11+(Nj1-2)*(S11+1))=Ai{1,Nj1}; % State Nu+2... = delayed layer 1 output. 330 | end 331 | 332 | 333 | sys1=x1; 334 | 335 | 336 | %end mdlUpdate 337 | 338 | 339 | x1(Nu1+Ni1+1+(Nj1-2)*(S11+1):Nu1+Ni1+S11+(Nj1-2)*(S11+1))=Ai{1,Nj1}; % State Nu+2... = delayed layer 1 output. 340 | sys1=x1; 341 | 342 | 343 | %end mdlUpdate 344 | 345 | 346 | -------------------------------------------------------------------------------- /ptest3sim21.mdl: -------------------------------------------------------------------------------- 1 | Model { 2 | Name "ptest3sim21" 3 | Version 8.6 4 | MdlSubVersion 0 5 | SavedCharacterEncoding "windows-1252" 6 | GraphicalInterface { 7 | NumRootInports 2 8 | Inport { 9 | Name "Inport" 10 | BusObject "" 11 | OutputFunctionCall "off" 12 | } 13 | Inport { 14 | Name "Inport1" 15 | BusObject "" 16 | OutputFunctionCall "off" 17 | } 18 | NumRootOutports 6 19 | Outport { 20 | Name "Outport1" 21 | BusObject "" 22 | BusOutputAsStruct "off" 23 | } 24 | Outport { 25 | Name "Outport2" 26 | BusObject "" 27 | BusOutputAsStruct "off" 28 | } 29 | Outport { 30 | Name "Outport3" 31 | BusObject "" 32 | BusOutputAsStruct "off" 33 | } 34 | Outport { 35 | Name "Outport4 (gU)" 36 | BusObject "" 37 | BusOutputAsStruct "off" 38 | } 39 | Outport { 40 | Name "Outport5 (gUd)" 41 | BusObject "" 42 | BusOutputAsStruct "off" 43 | } 44 | Outport { 45 | Name "Outport6" 46 | BusObject "" 47 | BusOutputAsStruct "off" 48 | } 49 | ParameterArgumentNames "" 50 | ComputedModelVersion "1.49" 51 | NumModelReferences 0 52 | NumTestPointedSignals 0 53 | } 54 | ScopeRefreshTime 0.035000 55 | OverrideScopeRefreshTime on 56 | DisableAllScopes off 57 | DataTypeOverride "UseLocalSettings" 58 | DataTypeOverrideAppliesTo "AllNumericTypes" 59 | MinMaxOverflowLogging "UseLocalSettings" 60 | MinMaxOverflowArchiveMode "Overwrite" 61 | FPTRunName "Run 1" 62 | MaxMDLFileLineLength 120 63 | Object { 64 | $PropName "BdWindowsInfo" 65 | $ObjectID 1 66 | $ClassName "Simulink.BDWindowsInfo" 67 | Object { 68 | $PropName "WindowsInfo" 69 | $ObjectID 2 70 | $ClassName "Simulink.WindowInfo" 71 | IsActive [1] 72 | Location [-7.0, 0.0, 1548.0, 848.0] 73 | Object { 74 | $PropName "ModelBrowserInfo" 75 | $ObjectID 3 76 | $ClassName "Simulink.ModelBrowserInfo" 77 | Visible [0] 78 | DockPosition "Left" 79 | Width [50] 80 | Height [50] 81 | Filter [9] 82 | } 83 | Object { 84 | $PropName "ExplorerBarInfo" 85 | $ObjectID 4 86 | $ClassName "Simulink.ExplorerBarInfo" 87 | Visible [0] 88 | } 89 | Array { 90 | Type "Simulink.EditorInfo" 91 | Dimension 2 92 | Object { 93 | $ObjectID 5 94 | IsActive [0] 95 | ViewObjType "SimulinkTopLevel" 96 | LoadSaveID "0" 97 | Extents [1876.0, 884.0] 98 | ZoomFactor [1.0] 99 | Offset [0.0, 0.0] 100 | } 101 | Object { 102 | $ObjectID 6 103 | IsActive [1] 104 | ViewObjType "SimulinkSubsys" 105 | LoadSaveID "3" 106 | Extents [1876.0, 884.0] 107 | ZoomFactor [1.0] 108 | Offset [0.0, 0.0] 109 | } 110 | PropName "EditorsInfo" 111 | } 112 | } 113 | } 114 | Created "Fri Oct 16 21:07:47 1998" 115 | Creator "The MathWorks, Inc." 116 | UpdateHistory "UpdateHistoryNever" 117 | ModifiedByFormat "%" 118 | LastModifiedBy "98915" 119 | ModifiedDateFormat "%" 120 | LastModifiedDate "Wed Sep 29 16:06:49 2021" 121 | RTWModifiedTimeStamp 554832407 122 | ModelVersionFormat "1.%" 123 | ConfigurationManager "none" 124 | SampleTimeColors off 125 | SampleTimeAnnotations off 126 | LibraryLinkDisplay "none" 127 | WideLines off 128 | ShowLineDimensions off 129 | ShowPortDataTypes off 130 | ShowDesignRanges off 131 | ShowLoopsOnError on 132 | IgnoreBidirectionalLines off 133 | ShowStorageClass off 134 | ShowTestPointIcons on 135 | ShowSignalResolutionIcons on 136 | ShowViewerIcons on 137 | SortedOrder off 138 | ExecutionContextIcon off 139 | ShowLinearizationAnnotations on 140 | ShowVisualizeInsertedRTB on 141 | ShowMarkup on 142 | BlockNameDataTip off 143 | BlockParametersDataTip on 144 | BlockDescriptionStringDataTip off 145 | ToolBar on 146 | StatusBar on 147 | BrowserShowLibraryLinks off 148 | BrowserLookUnderMasks off 149 | SimulationMode "normal" 150 | PauseTimes "5" 151 | NumberOfSteps 1 152 | SnapshotBufferSize 10 153 | SnapshotInterval 10 154 | NumberOfLastSnapshots 0 155 | LinearizationMsg "none" 156 | Profile off 157 | ParamWorkspaceSource "MATLABWorkspace" 158 | AccelSystemTargetFile "accel.tlc" 159 | AccelTemplateMakefile "accel_default_tmf" 160 | AccelMakeCommand "make_rtw" 161 | TryForcingSFcnDF off 162 | Object { 163 | $PropName "DataLoggingOverride" 164 | $ObjectID 7 165 | $ClassName "Simulink.SimulationData.ModelLoggingInfo" 166 | model_ "ptest3sim21" 167 | Array { 168 | Type "Cell" 169 | Dimension 1 170 | Cell "ptest3sim21" 171 | PropName "logAsSpecifiedByModels_" 172 | } 173 | Array { 174 | Type "Cell" 175 | Dimension 1 176 | Cell "" 177 | PropName "logAsSpecifiedByModelsSSIDs_" 178 | } 179 | } 180 | ExtModeBatchMode off 181 | ExtModeEnableFloating on 182 | ExtModeTrigType "manual" 183 | ExtModeTrigMode "oneshot" 184 | ExtModeTrigPort "1" 185 | ExtModeTrigElement "any" 186 | ExtModeTrigDuration 1000 187 | ExtModeTrigDurationFloating "auto" 188 | ExtModeTrigHoldOff 0 189 | ExtModeTrigDelay 0 190 | ExtModeTrigDirection "rising" 191 | ExtModeTrigLevel 0 192 | ExtModeArchiveMode "off" 193 | ExtModeAutoIncOneShot off 194 | ExtModeIncDirWhenArm off 195 | ExtModeAddSuffixToVar off 196 | ExtModeWriteAllDataToWs off 197 | ExtModeArmWhenConnect off 198 | ExtModeSkipDownloadWhenConnect off 199 | ExtModeLogAll on 200 | ExtModeAutoUpdateStatusClock on 201 | ShowModelReferenceBlockVersion off 202 | ShowModelReferenceBlockIO off 203 | Array { 204 | Type "Handle" 205 | Dimension 1 206 | Simulink.ConfigSet { 207 | $ObjectID 8 208 | Version "1.15.1" 209 | Array { 210 | Type "Handle" 211 | Dimension 9 212 | Simulink.SolverCC { 213 | $ObjectID 9 214 | Version "1.15.1" 215 | StartTime "0.0" 216 | StopTime "999999" 217 | AbsTol "1e-6" 218 | FixedStep "auto" 219 | InitialStep "auto" 220 | MaxNumMinSteps "-1" 221 | MaxOrder 5 222 | ZcThreshold "auto" 223 | ConsecutiveZCsStepRelTol "10*128*eps" 224 | MaxConsecutiveZCs "1000" 225 | ExtrapolationOrder 4 226 | NumberNewtonIterations 1 227 | MaxStep "10" 228 | MinStep "auto" 229 | MaxConsecutiveMinStep "1" 230 | RelTol "1e-3" 231 | SolverMode "SingleTasking" 232 | EnableConcurrentExecution off 233 | ConcurrentTasks off 234 | Solver "FixedStepDiscrete" 235 | SolverName "FixedStepDiscrete" 236 | SolverJacobianMethodControl "auto" 237 | ShapePreserveControl "DisableAll" 238 | ZeroCrossControl "UseLocalSettings" 239 | ZeroCrossAlgorithm "Nonadaptive" 240 | AlgebraicLoopSolver "TrustRegion" 241 | SolverInfoToggleStatus off 242 | IsAutoAppliedInSIP off 243 | SolverResetMethod "Fast" 244 | PositivePriorityOrder off 245 | AutoInsertRateTranBlk off 246 | SampleTimeConstraint "Unconstrained" 247 | InsertRTBMode "Whenever possible" 248 | } 249 | Simulink.DataIOCC { 250 | $ObjectID 10 251 | Version "1.15.1" 252 | Decimation "1" 253 | ExternalInput "[t, u]" 254 | FinalStateName "xFinal" 255 | InitialState "xInitial" 256 | LimitDataPoints off 257 | MaxDataPoints "1000" 258 | LoadExternalInput off 259 | LoadInitialState off 260 | SaveFinalState off 261 | SaveCompleteFinalSimState off 262 | SaveFormat "Array" 263 | SignalLoggingSaveFormat "Dataset" 264 | SaveOutput off 265 | SaveState off 266 | SignalLogging on 267 | DSMLogging on 268 | InspectSignalLogs off 269 | VisualizeSimOutput on 270 | StreamToWorkspace off 271 | StreamVariableName "streamout" 272 | SaveTime off 273 | ReturnWorkspaceOutputs off 274 | StateSaveName "xout" 275 | TimeSaveName "tout" 276 | OutputSaveName "yout" 277 | SignalLoggingName "logsout" 278 | DSMLoggingName "dsmout" 279 | OutputOption "RefineOutputTimes" 280 | OutputTimes "[]" 281 | ReturnWorkspaceOutputsName "out" 282 | Refine "1" 283 | LoggingIntervals "[-inf, inf]" 284 | } 285 | Simulink.OptimizationCC { 286 | $ObjectID 11 287 | Version "1.15.1" 288 | BlockReduction on 289 | BooleanDataType off 290 | ConditionallyExecuteInputs on 291 | DefaultParameterBehavior "Tunable" 292 | UseDivisionForNetSlopeComputation "off" 293 | UseFloatMulNetSlope off 294 | DefaultUnderspecifiedDataType "double" 295 | UseSpecifiedMinMax off 296 | InlineInvariantSignals off 297 | OptimizeBlockIOStorage on 298 | BufferReuse on 299 | EnhancedBackFolding off 300 | CachingGlobalReferences off 301 | GlobalBufferReuse on 302 | StrengthReduction off 303 | ExpressionFolding on 304 | BooleansAsBitfields off 305 | BitfieldContainerType "uint_T" 306 | EnableMemcpy on 307 | MemcpyThreshold 64 308 | PassReuseOutputArgsAs "Structure reference" 309 | PassReuseOutputArgsThreshold 12 310 | ExpressionDepthLimit 128 311 | LocalBlockOutputs on 312 | RollThreshold 5 313 | StateBitsets off 314 | DataBitsets off 315 | ActiveStateOutputEnumStorageType "Native Integer" 316 | ZeroExternalMemoryAtStartup on 317 | ZeroInternalMemoryAtStartup on 318 | InitFltsAndDblsToZero on 319 | NoFixptDivByZeroProtection off 320 | EfficientFloat2IntCast off 321 | EfficientMapNaN2IntZero on 322 | OptimizeModelRefInitCode off 323 | LifeSpan "inf" 324 | MaxStackSize "Inherit from target" 325 | BufferReusableBoundary on 326 | SimCompilerOptimization "off" 327 | AccelVerboseBuild off 328 | } 329 | Simulink.DebuggingCC { 330 | $ObjectID 12 331 | Version "1.15.1" 332 | RTPrefix "error" 333 | ConsistencyChecking "none" 334 | ArrayBoundsChecking "none" 335 | SignalInfNanChecking "none" 336 | SignalRangeChecking "none" 337 | ReadBeforeWriteMsg "UseLocalSettings" 338 | WriteAfterWriteMsg "UseLocalSettings" 339 | WriteAfterReadMsg "UseLocalSettings" 340 | AlgebraicLoopMsg "warning" 341 | ArtificialAlgebraicLoopMsg "warning" 342 | SaveWithDisabledLinksMsg "warning" 343 | SaveWithParameterizedLinksMsg "none" 344 | CheckSSInitialOutputMsg on 345 | UnderspecifiedInitializationDetection "Classic" 346 | MergeDetectMultiDrivingBlocksExec "none" 347 | CheckExecutionContextPreStartOutputMsg off 348 | CheckExecutionContextRuntimeOutputMsg off 349 | SignalResolutionControl "TryResolveAllWithWarning" 350 | BlockPriorityViolationMsg "warning" 351 | MinStepSizeMsg "warning" 352 | TimeAdjustmentMsg "none" 353 | MaxConsecutiveZCsMsg "error" 354 | MaskedZcDiagnostic "warning" 355 | IgnoredZcDiagnostic "warning" 356 | SolverPrmCheckMsg "none" 357 | InheritedTsInSrcMsg "warning" 358 | MultiTaskDSMMsg "warning" 359 | MultiTaskCondExecSysMsg "none" 360 | MultiTaskRateTransMsg "error" 361 | SingleTaskRateTransMsg "none" 362 | TasksWithSamePriorityMsg "warning" 363 | SigSpecEnsureSampleTimeMsg "warning" 364 | CheckMatrixSingularityMsg "none" 365 | IntegerOverflowMsg "warning" 366 | Int32ToFloatConvMsg "warning" 367 | ParameterDowncastMsg "error" 368 | ParameterOverflowMsg "error" 369 | ParameterUnderflowMsg "none" 370 | ParameterPrecisionLossMsg "warning" 371 | ParameterTunabilityLossMsg "warning" 372 | FixptConstUnderflowMsg "none" 373 | FixptConstOverflowMsg "none" 374 | FixptConstPrecisionLossMsg "none" 375 | UnderSpecifiedDataTypeMsg "none" 376 | UnnecessaryDatatypeConvMsg "none" 377 | VectorMatrixConversionMsg "none" 378 | InvalidFcnCallConnMsg "error" 379 | FcnCallInpInsideContextMsg "UseLocalSettings" 380 | SignalLabelMismatchMsg "none" 381 | UnconnectedInputMsg "warning" 382 | UnconnectedOutputMsg "warning" 383 | UnconnectedLineMsg "warning" 384 | SFcnCompatibilityMsg "none" 385 | FrameProcessingCompatibilityMsg "error" 386 | UniqueDataStoreMsg "none" 387 | BusObjectLabelMismatch "warning" 388 | RootOutportRequireBusObject "warning" 389 | AssertControl "UseLocalSettings" 390 | AllowSymbolicDim off 391 | ModelReferenceIOMsg "none" 392 | ModelReferenceMultiInstanceNormalModeStructChecksumCheck "error" 393 | ModelReferenceVersionMismatchMessage "none" 394 | ModelReferenceIOMismatchMessage "none" 395 | UnknownTsInhSupMsg "warning" 396 | ModelReferenceDataLoggingMessage "warning" 397 | ModelReferenceSymbolNameMessage "warning" 398 | ModelReferenceExtraNoncontSigs "error" 399 | StateNameClashWarn "none" 400 | SimStateInterfaceChecksumMismatchMsg "warning" 401 | SimStateOlderReleaseMsg "error" 402 | InitInArrayFormatMsg "warning" 403 | StrictBusMsg "None" 404 | BusNameAdapt "WarnAndRepair" 405 | NonBusSignalsTreatedAsBus "none" 406 | SymbolicDimMinMaxWarning "warning" 407 | BlockIODiagnostic "none" 408 | SFUnusedDataAndEventsDiag "warning" 409 | SFUnexpectedBacktrackingDiag "warning" 410 | SFInvalidInputDataAccessInChartInitDiag "warning" 411 | SFNoUnconditionalDefaultTransitionDiag "warning" 412 | SFTransitionOutsideNaturalParentDiag "warning" 413 | SFUnconditionalTransitionShadowingDiag "warning" 414 | SFUndirectedBroadcastEventsDiag "warning" 415 | SFTransitionActionBeforeConditionDiag "warning" 416 | SFOutputUsedAsStateInMooreChartDiag "error" 417 | IntegerSaturationMsg "warning" 418 | } 419 | Simulink.HardwareCC { 420 | $ObjectID 13 421 | Version "1.15.1" 422 | ProdBitPerChar 8 423 | ProdBitPerShort 16 424 | ProdBitPerInt 32 425 | ProdBitPerLong 32 426 | ProdBitPerLongLong 64 427 | ProdBitPerFloat 32 428 | ProdBitPerDouble 64 429 | ProdBitPerPointer 32 430 | ProdLargestAtomicInteger "Char" 431 | ProdLargestAtomicFloat "None" 432 | ProdIntDivRoundTo "Undefined" 433 | ProdEndianess "Unspecified" 434 | ProdWordSize 32 435 | ProdShiftRightIntArith on 436 | ProdLongLongMode off 437 | ProdHWDeviceType "32-bit Generic" 438 | TargetBitPerChar 8 439 | TargetBitPerShort 16 440 | TargetBitPerInt 32 441 | TargetBitPerLong 32 442 | TargetBitPerLongLong 64 443 | TargetBitPerFloat 32 444 | TargetBitPerDouble 64 445 | TargetBitPerPointer 32 446 | TargetLargestAtomicInteger "Char" 447 | TargetLargestAtomicFloat "None" 448 | TargetShiftRightIntArith on 449 | TargetLongLongMode off 450 | TargetIntDivRoundTo "Undefined" 451 | TargetEndianess "Unspecified" 452 | TargetWordSize 32 453 | TargetPreprocMaxBitsSint 32 454 | TargetPreprocMaxBitsUint 32 455 | TargetHWDeviceType "Specified" 456 | TargetUnknown on 457 | ProdEqTarget on 458 | } 459 | Simulink.ModelReferenceCC { 460 | $ObjectID 14 461 | Version "1.15.1" 462 | UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange" 463 | EnableRefExpFcnMdlSchedulingChecks on 464 | CheckModelReferenceTargetMessage "error" 465 | EnableParallelModelReferenceBuilds off 466 | ParallelModelReferenceErrorOnInvalidPool on 467 | ParallelModelReferenceMATLABWorkerInit "None" 468 | ModelReferenceNumInstancesAllowed "Multi" 469 | PropagateVarSize "Infer from blocks in model" 470 | ModelReferencePassRootInputsByReference on 471 | ModelReferenceMinAlgLoopOccurrences off 472 | PropagateSignalLabelsOutOfModel off 473 | SupportModelReferenceSimTargetCustomCode off 474 | } 475 | Simulink.SFSimCC { 476 | $ObjectID 15 477 | Version "1.15.1" 478 | SFSimEcho on 479 | SimCtrlC on 480 | SimIntegrity on 481 | SimUseLocalCustomCode off 482 | SimParseCustomCode on 483 | SimBuildMode "sf_incremental_build" 484 | SimGenImportedTypeDefs off 485 | } 486 | Simulink.RTWCC { 487 | $BackupClass "Simulink.RTWCC" 488 | $ObjectID 16 489 | Version "1.15.1" 490 | SystemTargetFile "grt.tlc" 491 | TLCOptions "" 492 | GenCodeOnly off 493 | MakeCommand "make_rtw" 494 | GenerateMakefile on 495 | PackageGeneratedCodeAndArtifacts off 496 | TemplateMakefile "grt_vc.tmf" 497 | PostCodeGenCommand "" 498 | Description "" 499 | GenerateReport off 500 | SaveLog off 501 | RTWVerbose on 502 | RetainRTWFile off 503 | ProfileTLC off 504 | TLCDebug off 505 | TLCCoverage off 506 | TLCAssert off 507 | RTWUseLocalCustomCode off 508 | RTWUseSimCustomCode off 509 | Toolchain "Automatically locate an installed toolchain" 510 | BuildConfiguration "Faster Builds" 511 | IncludeHyperlinkInReport off 512 | LaunchReport off 513 | PortableWordSizes off 514 | CreateSILPILBlock "None" 515 | CodeExecutionProfiling off 516 | CodeExecutionProfileVariable "executionProfile" 517 | CodeProfilingSaveOptions "SummaryOnly" 518 | CodeProfilingInstrumentation off 519 | SILDebugging off 520 | TargetLang "C" 521 | IncludeBusHierarchyInRTWFileBlockHierarchyMap off 522 | GenerateTraceInfo off 523 | GenerateTraceReport off 524 | GenerateTraceReportSl off 525 | GenerateTraceReportSf off 526 | GenerateTraceReportEml off 527 | GenerateWebview off 528 | GenerateCodeMetricsReport off 529 | GenerateCodeReplacementReport off 530 | GenerateMissedCodeReplacementReport off 531 | RTWCompilerOptimization "off" 532 | RTWCustomCompilerOptimizations "" 533 | CheckMdlBeforeBuild "Off" 534 | SharedConstantsCachingThreshold 1024 535 | Array { 536 | Type "Handle" 537 | Dimension 2 538 | Simulink.CodeAppCC { 539 | $ObjectID 17 540 | Version "1.15.1" 541 | ForceParamTrailComments off 542 | GenerateComments on 543 | CommentStyle "Auto" 544 | IgnoreCustomStorageClasses on 545 | IgnoreTestpoints off 546 | IncHierarchyInIds off 547 | MaxIdLength 31 548 | PreserveName off 549 | PreserveNameWithParent off 550 | ShowEliminatedStatement off 551 | OperatorAnnotations off 552 | IncAutoGenComments off 553 | SimulinkDataObjDesc off 554 | SFDataObjDesc off 555 | MATLABFcnDesc off 556 | IncDataTypeInIds off 557 | MangleLength 1 558 | CustomSymbolStrGlobalVar "$R$N$M" 559 | CustomSymbolStrType "$N$R$M_T" 560 | CustomSymbolStrField "$N$M" 561 | CustomSymbolStrFcn "$R$N$M$F" 562 | CustomSymbolStrFcnArg "rt$I$N$M" 563 | CustomSymbolStrBlkIO "rtb_$N$M" 564 | CustomSymbolStrTmpVar "$N$M" 565 | CustomSymbolStrMacro "$R$N$M" 566 | CustomSymbolStrUtil "$N$C" 567 | DefineNamingRule "None" 568 | ParamNamingRule "None" 569 | SignalNamingRule "None" 570 | InsertBlockDesc off 571 | InsertPolySpaceComments off 572 | SimulinkBlockComments on 573 | MATLABSourceComments off 574 | EnableCustomComments off 575 | InternalIdentifier "Shortened" 576 | InlinedPrmAccess "Literals" 577 | ReqsInCode off 578 | UseSimReservedNames off 579 | } 580 | Simulink.GRTTargetCC { 581 | $BackupClass "Simulink.TargetCC" 582 | $ObjectID 18 583 | Version "1.15.1" 584 | Array { 585 | Type "Cell" 586 | Dimension 1 587 | Cell "GenerateAllocFcn" 588 | PropName "DisabledProps" 589 | } 590 | TargetFcnLib "ansi_tfl_tmw.mat" 591 | TargetLibSuffix "" 592 | TargetPreCompLibLocation "" 593 | GenFloatMathFcnCalls "NOT IN USE" 594 | TargetLangStandard "C89/C90 (ANSI)" 595 | CodeReplacementLibrary "None" 596 | UtilityFuncGeneration "Auto" 597 | ERTMultiwordTypeDef "System defined" 598 | ERTMultiwordLength 256 599 | MultiwordLength 2048 600 | GenerateFullHeader on 601 | InferredTypesCompatibility off 602 | GenerateSampleERTMain off 603 | GenerateTestInterfaces off 604 | ModelReferenceCompliant on 605 | ParMdlRefBuildCompliant on 606 | CompOptLevelCompliant on 607 | ConcurrentExecutionCompliant on 608 | IncludeMdlTerminateFcn on 609 | GeneratePreprocessorConditionals "Use local settings" 610 | CombineOutputUpdateFcns off 611 | CombineSignalStateStructs off 612 | SuppressErrorStatus off 613 | ERTFirstTimeCompliant off 614 | IncludeFileDelimiter "Auto" 615 | ERTCustomFileBanners off 616 | SupportAbsoluteTime on 617 | LogVarNameModifier "rt_" 618 | MatFileLogging on 619 | MultiInstanceERTCode off 620 | CodeInterfacePackaging "Nonreusable function" 621 | SupportNonFinite on 622 | SupportComplex on 623 | PurelyIntegerCode off 624 | SupportContinuousTime on 625 | SupportNonInlinedSFcns on 626 | SupportVariableSizeSignals off 627 | ParenthesesLevel "Nominal" 628 | CastingMode "Nominal" 629 | MATLABClassNameForMDSCustomization "Simulink.SoftwareTarget.GRTCustomization" 630 | ModelStepFunctionPrototypeControlCompliant off 631 | CPPClassGenCompliant on 632 | AutosarCompliant off 633 | GRTInterface on 634 | GenerateAllocFcn off 635 | UseToolchainInfoCompliant on 636 | GenerateSharedConstants on 637 | UseMalloc off 638 | ExtMode off 639 | ExtModeStaticAlloc off 640 | ExtModeTesting off 641 | ExtModeStaticAllocSize 1000000 642 | ExtModeTransport 0 643 | ExtModeMexFile "ext_comm" 644 | ExtModeIntrfLevel "Level1" 645 | RTWCAPISignals off 646 | RTWCAPIParams off 647 | RTWCAPIStates off 648 | RTWCAPIRootIO off 649 | GenerateASAP2 off 650 | MultiInstanceErrorCode "Error" 651 | } 652 | PropName "Components" 653 | } 654 | } 655 | SlCovCC.ConfigComp { 656 | $ObjectID 19 657 | Version "1.15.1" 658 | Description "Simulink Coverage Configuration Component" 659 | Name "Simulink Coverage" 660 | RecordCoverage off 661 | CovPath "/" 662 | CovSaveName "covdata" 663 | CovMetricSettings "dw" 664 | CovNameIncrementing off 665 | CovHtmlReporting on 666 | CovForceBlockReductionOff on 667 | CovEnableCumulative on 668 | CovSaveCumulativeToWorkspaceVar on 669 | CovSaveSingleToWorkspaceVar on 670 | CovCumulativeVarName "covCumulativeData" 671 | CovCumulativeReport off 672 | CovReportOnPause on 673 | CovModelRefEnable "Off" 674 | CovExternalEMLEnable off 675 | CovSFcnEnable on 676 | CovBoundaryAbsTol 1e-05 677 | CovBoundaryRelTol 0.01 678 | CovUseTimeInterval off 679 | CovStartTime 0 680 | CovStopTime 0 681 | } 682 | PropName "Components" 683 | } 684 | Name "Configuration" 685 | CurrentDlgPage "Real-Time Workshop" 686 | ConfigPrmDlgPosition [ 100, 192, 1180, 832 ] 687 | } 688 | PropName "ConfigurationSets" 689 | } 690 | Simulink.ConfigSet { 691 | $PropName "ActiveConfigurationSet" 692 | $ObjectID 8 693 | } 694 | Object { 695 | $PropName "DataTransfer" 696 | $ObjectID 20 697 | $ClassName "Simulink.GlobalDataTransfer" 698 | DefaultTransitionBetweenSyncTasks "Ensure deterministic transfer (maximum delay)" 699 | DefaultTransitionBetweenAsyncTasks "Ensure data integrity only" 700 | DefaultTransitionBetweenContTasks "Ensure deterministic transfer (minimum delay)" 701 | DefaultExtrapolationMethodBetweenContTasks "None" 702 | AutoInsertRateTranBlk [0] 703 | } 704 | ExplicitPartitioning off 705 | BlockDefaults { 706 | ForegroundColor "black" 707 | BackgroundColor "white" 708 | DropShadow off 709 | NamePlacement "normal" 710 | FontName "Helvetica" 711 | FontSize 10 712 | FontWeight "normal" 713 | FontAngle "normal" 714 | ShowName on 715 | BlockRotation 0 716 | BlockMirror off 717 | } 718 | AnnotationDefaults { 719 | HorizontalAlignment "center" 720 | VerticalAlignment "middle" 721 | ForegroundColor "black" 722 | BackgroundColor "white" 723 | DropShadow off 724 | FontName "Helvetica" 725 | FontSize 10 726 | FontWeight "normal" 727 | FontAngle "normal" 728 | UseDisplayTextAsClickCallback off 729 | } 730 | LineDefaults { 731 | FontName "Helvetica" 732 | FontSize 9 733 | FontWeight "normal" 734 | FontAngle "normal" 735 | } 736 | MaskDefaults { 737 | SelfModifiable "off" 738 | IconFrame "on" 739 | IconOpaque "on" 740 | RunInitForIconRedraw "off" 741 | IconRotate "none" 742 | PortRotate "default" 743 | IconUnits "autoscale" 744 | } 745 | MaskParameterDefaults { 746 | Evaluate "on" 747 | Tunable "on" 748 | NeverSave "off" 749 | Internal "off" 750 | ReadOnly "off" 751 | Enabled "on" 752 | Visible "on" 753 | ToolTip "on" 754 | } 755 | BlockParameterDefaults { 756 | Block { 757 | BlockType Constant 758 | Value "1" 759 | VectorParams1D on 760 | SamplingMode "Sample based" 761 | OutMin "[]" 762 | OutMax "[]" 763 | OutDataTypeStr "Inherit: Inherit from 'Constant value'" 764 | LockScale off 765 | SampleTime "inf" 766 | FramePeriod "inf" 767 | PreserveConstantTs off 768 | } 769 | Block { 770 | BlockType DiscreteStateSpace 771 | A "1" 772 | B "1" 773 | C "1" 774 | D "1" 775 | X0 "0" 776 | SampleTime "1" 777 | StateMustResolveToSignalObject off 778 | RTWStateStorageClass "Auto" 779 | Realization "auto" 780 | } 781 | Block { 782 | BlockType Gain 783 | Gain "1" 784 | Multiplication "Element-wise(K.*u)" 785 | ParamMin "[]" 786 | ParamMax "[]" 787 | ParamDataTypeStr "Inherit: Same as input" 788 | OutMin "[]" 789 | OutMax "[]" 790 | OutDataTypeStr "Inherit: Same as input" 791 | LockScale off 792 | RndMeth "Floor" 793 | SaturateOnIntegerOverflow on 794 | SampleTime "-1" 795 | } 796 | Block { 797 | BlockType Inport 798 | Port "1" 799 | OutputFunctionCall off 800 | OutMin "[]" 801 | OutMax "[]" 802 | OutDataTypeStr "Inherit: auto" 803 | LockScale off 804 | BusOutputAsStruct off 805 | PortDimensions "-1" 806 | VarSizeSig "Inherit" 807 | SampleTime "-1" 808 | SignalType "auto" 809 | SamplingMode "auto" 810 | LatchByDelayingOutsideSignal off 811 | LatchInputForFeedbackSignals off 812 | Interpolate on 813 | } 814 | Block { 815 | BlockType Math 816 | Operator "exp" 817 | OutputSignalType "auto" 818 | SampleTime "-1" 819 | OutMin "[]" 820 | OutMax "[]" 821 | OutDataTypeStr "Inherit: Same as first input" 822 | LockScale off 823 | RndMeth "Floor" 824 | SaturateOnIntegerOverflow on 825 | IntermediateResultsDataTypeStr "Inherit: Inherit via internal rule" 826 | AlgorithmType "Newton-Raphson" 827 | Iterations "3" 828 | } 829 | Block { 830 | BlockType Mux 831 | Inputs "4" 832 | DisplayOption "none" 833 | UseBusObject off 834 | BusObject "BusObject" 835 | NonVirtualBus off 836 | } 837 | Block { 838 | BlockType Outport 839 | Port "1" 840 | OutMin "[]" 841 | OutMax "[]" 842 | OutDataTypeStr "Inherit: auto" 843 | LockScale off 844 | BusOutputAsStruct off 845 | PortDimensions "-1" 846 | VarSizeSig "Inherit" 847 | SampleTime "-1" 848 | SignalType "auto" 849 | SamplingMode "auto" 850 | SourceOfInitialOutputValue "Dialog" 851 | OutputWhenDisabled "held" 852 | InitialOutput "[]" 853 | } 854 | Block { 855 | BlockType Product 856 | Inputs "2" 857 | Multiplication "Element-wise(.*)" 858 | CollapseMode "All dimensions" 859 | CollapseDim "1" 860 | InputSameDT on 861 | OutMin "[]" 862 | OutMax "[]" 863 | OutDataTypeStr "Inherit: Same as first input" 864 | LockScale off 865 | RndMeth "Zero" 866 | SaturateOnIntegerOverflow on 867 | SampleTime "-1" 868 | } 869 | Block { 870 | BlockType S-Function 871 | FunctionName "system" 872 | SFunctionModules "''" 873 | PortCounts "[]" 874 | } 875 | Block { 876 | BlockType SubSystem 877 | ShowPortLabels "FromPortIcon" 878 | Permissions "ReadWrite" 879 | PermitHierarchicalResolution "All" 880 | TreatAsAtomicUnit off 881 | MinAlgLoopOccurrences off 882 | PropExecContextOutsideSubsystem off 883 | CheckFcnCallInpInsideContextMsg off 884 | SystemSampleTime "-1" 885 | RTWSystemCode "Auto" 886 | RTWFcnNameOpts "Auto" 887 | RTWFileNameOpts "Auto" 888 | FunctionInterfaceSpec "void_void" 889 | FunctionWithSeparateData off 890 | RTWMemSecFuncInitTerm "Inherit from model" 891 | RTWMemSecFuncExecute "Inherit from model" 892 | RTWMemSecDataConstants "Inherit from model" 893 | RTWMemSecDataInternal "Inherit from model" 894 | RTWMemSecDataParameters "Inherit from model" 895 | SimViewingDevice off 896 | DataTypeOverride "UseLocalSettings" 897 | DataTypeOverrideAppliesTo "AllNumericTypes" 898 | MinMaxOverflowLogging "UseLocalSettings" 899 | Opaque off 900 | MaskHideContents off 901 | SFBlockType "NONE" 902 | GeneratePreprocessorConditionals off 903 | ContentPreviewEnabled off 904 | IsWebBlock off 905 | } 906 | Block { 907 | BlockType Sum 908 | IconShape "rectangular" 909 | Inputs "++" 910 | CollapseMode "All dimensions" 911 | CollapseDim "1" 912 | InputSameDT on 913 | AccumDataTypeStr "Inherit: Inherit via internal rule" 914 | OutMin "[]" 915 | OutMax "[]" 916 | OutDataTypeStr "Inherit: Same as first input" 917 | LockScale off 918 | RndMeth "Floor" 919 | SaturateOnIntegerOverflow on 920 | SampleTime "-1" 921 | } 922 | Block { 923 | BlockType UnitDelay 924 | InitialCondition "0" 925 | InputProcessing "Inherited" 926 | SampleTime "1" 927 | StateMustResolveToSignalObject off 928 | CodeGenStateStorageClass "Auto" 929 | HasFrameUpgradeWarning on 930 | } 931 | } 932 | System { 933 | Name "ptest3sim21" 934 | Location [-7, 0, 1541, 848] 935 | Open on 936 | ModelBrowserVisibility off 937 | ModelBrowserWidth 200 938 | ScreenColor "white" 939 | PaperOrientation "landscape" 940 | PaperPositionMode "auto" 941 | PaperType "usletter" 942 | PaperUnits "inches" 943 | TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] 944 | TiledPageScale 1 945 | ShowPageBoundaries off 946 | ZoomFactor "100" 947 | ReportName "simulink-default.rpt" 948 | SIDHighWatermark "62" 949 | Block { 950 | BlockType Inport 951 | Name "Inport" 952 | SID "1" 953 | Position [70, 155, 90, 175] 954 | ZOrder -1 955 | BackgroundColor "lightBlue" 956 | IconDisplay "Port number" 957 | PortDimensions "1" 958 | } 959 | Block { 960 | BlockType Inport 961 | Name "Inport1" 962 | SID "2" 963 | Position [70, 205, 90, 225] 964 | ZOrder -2 965 | BackgroundColor "lightBlue" 966 | Port "2" 967 | IconDisplay "Port number" 968 | PortDimensions "1" 969 | } 970 | Block { 971 | BlockType SubSystem 972 | Name "Subsystem" 973 | SID "3" 974 | Ports [2, 6] 975 | Position [135, 138, 390, 237] 976 | ZOrder -3 977 | RequestExecContextInheritance off 978 | Variant off 979 | Object { 980 | $PropName "MaskObject" 981 | $ObjectID 21 982 | $ClassName "Simulink.Mask" 983 | Array { 984 | Type "Simulink.MaskParameter" 985 | Dimension 20 986 | Object { 987 | $ObjectID 22 988 | Type "edit" 989 | Name "yd_init1" 990 | Prompt "yd_init1" 991 | Value "[]" 992 | } 993 | Object { 994 | $ObjectID 23 995 | Type "edit" 996 | Name "y_init1" 997 | Prompt "y_init1" 998 | Value "[]" 999 | } 1000 | Object { 1001 | $ObjectID 24 1002 | Type "edit" 1003 | Name "ud_init1" 1004 | Prompt "ud_init1" 1005 | Value "[]" 1006 | } 1007 | Object { 1008 | $ObjectID 25 1009 | Type "edit" 1010 | Name "u_init1" 1011 | Prompt "u_init1" 1012 | Value "[]" 1013 | } 1014 | Object { 1015 | $ObjectID 26 1016 | Type "edit" 1017 | Name "mint1" 1018 | Prompt "mint1" 1019 | Value "217.62128892307953" 1020 | } 1021 | Object { 1022 | $ObjectID 27 1023 | Type "edit" 1024 | Name "maxt1" 1025 | Prompt "maxt1" 1026 | Value "34.372117523742894" 1027 | } 1028 | Object { 1029 | $ObjectID 28 1030 | Type "edit" 1031 | Name "minp1" 1032 | Prompt "minp1" 1033 | Value "-14.518123641385754" 1034 | } 1035 | Object { 1036 | $ObjectID 29 1037 | Type "edit" 1038 | Name "maxp1" 1039 | Prompt "maxp1" 1040 | Value "34.372117523742894" 1041 | } 1042 | Object { 1043 | $ObjectID 30 1044 | Type "edit" 1045 | Name "Ts1" 1046 | Prompt "Ts1" 1047 | Value "0.05" 1048 | } 1049 | Object { 1050 | $ObjectID 31 1051 | Type "edit" 1052 | Name "S11" 1053 | Prompt "S11" 1054 | Value "30" 1055 | } 1056 | Object { 1057 | $ObjectID 32 1058 | Type "edit" 1059 | Name "Nu1" 1060 | Prompt "Nu1" 1061 | Value "2" 1062 | } 1063 | Object { 1064 | $ObjectID 33 1065 | Type "edit" 1066 | Name "Normalize1" 1067 | Prompt "Normalize1" 1068 | Value "0" 1069 | } 1070 | Object { 1071 | $ObjectID 34 1072 | Type "edit" 1073 | Name "Nj1" 1074 | Prompt "Nj1" 1075 | Value "8" 1076 | } 1077 | Object { 1078 | $ObjectID 35 1079 | Type "edit" 1080 | Name "Ni1" 1081 | Prompt "Ni1" 1082 | Value "3" 1083 | } 1084 | Object { 1085 | $ObjectID 36 1086 | Type "edit" 1087 | Name "LW2_11" 1088 | Prompt "LW2_11" 1089 | Value "[-26.064437811822213 22.382889355042366 22.398837452917832 -0.038286916694043924 1.216688905180568 0." 1090 | "10267800941528266 -31.001649977902009 22.809795495362049 0.14942990031167722 0.048217737772188428 -4.470743211535" 1091 | "9147 0.12178330692895029 -0.23851607275022915 -23.921580806620806 0.054556286879472386 -24.423700290603563 0.7027" 1092 | "3727827187649 -22.882781864161863 -24.604415673380409 -0.081830133233886743 -0.13387227258563716 -1.0474484701964" 1093 | "166 -0.016841195793368118 0.11673448004303272 0.22617275989991151 25.430599242235367 22.099207513017429 -2.876308" 1094 | "9810507201 -0.56899532933082742 0.30349310587430406]" 1095 | } 1096 | Object { 1097 | $ObjectID 37 1098 | Type "edit" 1099 | Name "LW1_21" 1100 | Prompt "LW1_21" 1101 | Value "[0.14502232133705253 -0.19818602514849301 -0.60030350491395079 -0.1091436710422941 0.3340973505331894" 1102 | "5 -0.22419571803249635 -0.11973734213668785 0.17770764249420579;0.61880869696550134 0.97723668947232223 1.3461112" 1103 | "999321452 0.3542669376814257 -0.55884694662707912 -0.28939105831102441 -0.68790748729887186 -0.33182701878380871;" 1104 | "-0.26934359396580165 -0.094325885979179278 -0.0051102057497130968 0.65645318710181122 -0.43125476840555776 0.9581" 1105 | "2084203300774 0.13802281101576963 0.025946861741987223;-8.7196630145784848 6.8832507745514659 -0.2674605716367021" 1106 | "7 1.6903423388513836 3.1068326405173576 -13.658263649124519 6.3432430899147514 5.1557368296910964;-0.420533309416" 1107 | "32955 0.0021066596747489549 2.3804057933097043 -0.66379186998163353 -2.2639798510471443 -2.1967847104136267 -0.87" 1108 | "63419273661075 2.1150437956429156;-7.1419732168053276 6.531169454969092 2.7215070785300126 7.0971881132216801 -3." 1109 | "5746092990403722 -6.5025240568661253 -6.6290198132326461 6.8568101700956525;-0.015771842955708899 0.0057460854063" 1110 | "624087 -0.00056353334053432336 0.00021011981240546708 -7.4544898266139608e-05 0.00039588102987094778 0.0004467721" 1111 | "6599032772 -0.0014763192468849311;0.31151126507962201 0.11936889656995812 0.067520964291386834 0.1245130599517106" 1112 | "8 -0.036455595088563678 -0.27775588229622139 -0.35117788310761511 0.20728982648327363;11.390624155429196 -8.34338" 1113 | "09517666262 -9.4147211666194917 -4.8690895934680718 10.081396381472576 6.0836080054306887 -1.5840948822947798 -3." 1114 | "2969620561875552;1.0838166192685366 2.8302531028433888 6.0145929419319568 7.1158034515286479 9.6848381769370597 -" 1115 | "4.7393408643914956 -16.78957164310528 -4.9485693068314962;-1.2072042547676116 -0.10007996802061325 -0.56957359064" 1116 | "428426 0.31160078810101088 -0.52907645533917813 0.54983749296665951 -0.13793506464915217 -0.7486731666214963;0.49" 1117 | "642374282030055 -0.91929128492921641 -3.9060463084663337 7.2702803268945964 7.3561279992136575 -6.773831051643571" 1118 | "6 -1.0602552755938028 -2.4638781476749152;-0.93518454404494655 5.2998976823039143 3.8608812498302982 -5.089472740" 1119 | "6121811 -3.4015910704902041 0.86539048744327884 0.39814684093945646 3.3621968909144693;-0.0035735280319696555 -0." 1120 | "10656868580625431 -0.061320877011787484 -0.035511896314988869 0.0041861499133045918 -0.015968778853224376 -0.0470" 1121 | "93240620693602 -0.064798701154283239;-8.2722783163792819 6.3466203448402334 9.8759249225987595 0.7638779954221867" 1122 | "1 -6.8167353900920613 -0.77527271379467255 0.81361460958365017 -3.0326228793873296;0.37380922340158035 0.63911609" 1123 | "62361726 -1.2495932575943429 -0.28017027281391477 -0.74666397338505752 0.065941275603083715 0.69166332882506598 0" 1124 | ".20136822412624111;2.6115793379678371 -6.0681600126871462 4.7445282811131637 -3.5610352160654468 -10.359909014176" 1125 | "985 10.563424520127153 -9.0756344807167046 16.518703424325352;-0.70234986199369964 -0.17469610726357687 -0.030016" 1126 | "69111107063 0.02612133762570161 0.082789827161885182 -0.0006553685984739782 0.28277301528104837 0.212369070728558" 1127 | "62;-0.003946231444981383 -0.64512381160267984 -1.7987939159474886 0.99773115006692348 0.24897143993074494 -0.5115" 1128 | "453193903271 -0.048266160438610116 1.2190161110380973;6.8673264325130532 7.3803565449334778 -9.3143920545849337 -" 1129 | "7.7132136285015722 -0.038113443475049379 -0.19907892662547941 3.1378648399070221 0.38685604142055852;-10.08074669" 1130 | "0315406 1.586722263572262 1.1906230862174914 1.2601665584162989 -4.8438413621869447 -2.3124231961994854 21.692379" 1131 | "716674314 -9.556199690855669;0.50394263177350407 13.666229500118867 -6.4353963093274356 2.8787469553955596 -3.766" 1132 | "1310538645001 0.065584133519514198 -4.7658927478393345 1.3776799184387216;-25.209345319364061 -4.0686774170865609" 1133 | " 8.6463104242327997 -3.7201723905081718 -0.65310481926140851 10.099887870222826 4.4989934760756434 9.138753106049" 1134 | "7924;0.3525198504373101 0.19932470222582813 -2.0493336024776427 -0.3271272328144369 0.5052560341723944 -3.3039844" 1135 | "970379195 3.8047824205524825 -3.5061638492871174;-1.9580626778247048 -3.1549493778988245 -8.4717854780401893 -0.8" 1136 | "5467953969785948 2.9569972800286322 2.2831828826620972 2.6374229413713053 8.5339067869340575;0.31603309619199138 " 1137 | "0.47415519207548412 -0.30071547762289891 -0.14691399732008634 0.42316207323395522 0.0020930660218923605 -0.116042" 1138 | "69008255327 0.029507633247835913;0.35239107375229434 -0.03030979268564165 0.12866074548731685 0.09977024426745423" 1139 | "3 -0.1782983297458906 0.23878104863784483 0.58325806989380113 -0.82103772714233236;-2.8560211762547452 6.23655347" 1140 | "23158538 -4.0180589918340202 7.7768472891992602 0.0072968012231771073 -3.8847557820839231 1.5944598302527593 11.2" 1141 | "04320220670024;6.51062499515219 2.5173866099088671 -1.4645410231835441 -4.5064195103024556 0.20490546396693937 -3" 1142 | ".3397613207710775 0.16147049801099767 0.60913464230187453;3.7571058159892958 -3.2716217679421873 -2.3467813563967" 1143 | "344 -3.4630245199237937 -0.79582635818827552 0.51924150590107554 0.43835610499529981 3.9587148948293116]" 1144 | } 1145 | Object { 1146 | $ObjectID 38 1147 | Type "edit" 1148 | Name "IW_gU1" 1149 | Prompt "IW_gU1" 1150 | Value "[0.033749633509924319 0.51953797110680611 0.023953451058919214;-1.0570051190545673 -1.153771985903325" 1151 | "1 0.42725864185800633;0.78198964403097426 -1.9244427859818585 -1.1072794700998263;-2.665630567437741 4.4773623634" 1152 | "30867 -7.3543001126906802;0.21961341017723846 0.54708393700106972 -0.26136462634935154;4.8729663671470229 1.37018" 1153 | "05335023274 -1.0133600095268858;-0.020104489318732578 0.010062701534381654 -0.0039861656524516394;0.1321281439549" 1154 | "8115 0.88938303327521406 0.70243984219654032;-4.7645188512536549 3.3805095101858416 -1.0232751022757849;7.5371264" 1155 | "222675549 -12.790033145066447 4.2322004394291248;-0.46616123477808313 -0.52800676314474115 0.8378056528735468;-13" 1156 | ".531196625565929 9.0933120302301464 6.3144783944710534;-9.2656430427380982 -11.822209180334529 -11.07951857100778" 1157 | "3;-3.4594199678477516e-06 -0.024067454126836117 -0.053008941256448602;-18.968530056782342 -10.000225011921206 -3." 1158 | "162982825532243;0.31016269407956709 -0.33899020830424847 -0.076532678861312126;8.5236807005538946 5.7934820183082" 1159 | "66 0.2267443105300363;-0.98798745799044374 -1.0407776006619636 0.043771841805682034;-1.4186006521322074 1.5182006" 1160 | "130106442 -0.27506256155117775;-0.83263801153775019 2.1589660973629616 -7.3848566431678586;10.546585044494808 11." 1161 | "239237542296129 -0.086595538531225091;1.1144254437189585 -8.6727039498850633 -7.9974962312798965;4.78917272153446" 1162 | "66 -5.5975119529414235 9.7078941580829721;13.658156109610113 14.054243379505479 13.83709294556418;16.702262680390" 1163 | "49 -8.19270321836993 -9.798271605925704;0.13904179904099778 0.77678213857190559 1.3944541255894785;1.449935848628" 1164 | "2008 -0.051626218254679161 -0.84425652617503177;-14.699896211239166 13.082109346033086 10.652415472508936;-1.6396" 1165 | "349693196193 1.3329230717599549 0.78660485907763611;-0.58060303719033945 1.7004396167783182 -13.0281679262245]" 1166 | } 1167 | Object { 1168 | $ObjectID 39 1169 | Type "edit" 1170 | Name "IW1" 1171 | Prompt "IW1" 1172 | Value "[0.033749633509924319 0.51953797110680611 0.023953451058919214;-1.0570051190545673 -1.153771985903325" 1173 | "1 0.42725864185800633;0.78198964403097426 -1.9244427859818585 -1.1072794700998263;-2.665630567437741 4.4773623634" 1174 | "30867 -7.3543001126906802;0.21961341017723846 0.54708393700106972 -0.26136462634935154;4.8729663671470229 1.37018" 1175 | "05335023274 -1.0133600095268858;-0.020104489318732578 0.010062701534381654 -0.0039861656524516394;0.1321281439549" 1176 | "8115 0.88938303327521406 0.70243984219654032;-4.7645188512536549 3.3805095101858416 -1.0232751022757849;7.5371264" 1177 | "222675549 -12.790033145066447 4.2322004394291248;-0.46616123477808313 -0.52800676314474115 0.8378056528735468;-13" 1178 | ".531196625565929 9.0933120302301464 6.3144783944710534;-9.2656430427380982 -11.822209180334529 -11.07951857100778" 1179 | "3;-3.4594199678477516e-06 -0.024067454126836117 -0.053008941256448602;-18.968530056782342 -10.000225011921206 -3." 1180 | "162982825532243;0.31016269407956709 -0.33899020830424847 -0.076532678861312126;8.5236807005538946 5.7934820183082" 1181 | "66 0.2267443105300363;-0.98798745799044374 -1.0407776006619636 0.043771841805682034;-1.4186006521322074 1.5182006" 1182 | "130106442 -0.27506256155117775;-0.83263801153775019 2.1589660973629616 -7.3848566431678586;10.546585044494808 11." 1183 | "239237542296129 -0.086595538531225091;1.1144254437189585 -8.6727039498850633 -7.9974962312798965;4.78917272153446" 1184 | "66 -5.5975119529414235 9.7078941580829721;13.658156109610113 14.054243379505479 13.83709294556418;16.702262680390" 1185 | "49 -8.19270321836993 -9.798271605925704;0.13904179904099778 0.77678213857190559 1.3944541255894785;1.449935848628" 1186 | "2008 -0.051626218254679161 -0.84425652617503177;-14.699896211239166 13.082109346033086 10.652415472508936;-1.6396" 1187 | "349693196193 1.3329230717599549 0.78660485907763611;-0.58060303719033945 1.7004396167783182 -13.0281679262245]" 1188 | } 1189 | Object { 1190 | $ObjectID 40 1191 | Type "edit" 1192 | Name "B21" 1193 | Prompt "B21" 1194 | Value "24.992136850997451" 1195 | } 1196 | Object { 1197 | $ObjectID 41 1198 | Type "edit" 1199 | Name "B11" 1200 | Prompt "B11" 1201 | Value "[-36.093687166784058;-12.305889740475774;-5.3023355649171329;-12.182040660818414;10.135270477537007;8" 1202 | ".0430063124967486;3.0174318673985403;29.621858949022169;-0.48454974365016329;-32.040207569052725;-19.070457729234" 1203 | "576;20.548211928919049;-2.0183656641746404;-8.1912048609880159;40.791767675235391;4.6706071066423558;9.7388139484" 1204 | "696374;-41.138203994054322;-8.2477628443093263;25.890733055108694;-25.299908828489205;-45.374295607353503;34.3927" 1205 | "21015628311;0.74592894079050842;-15.073682539786347;-30.718114798670658;25.564327668539196;-23.56231663956774;29." 1206 | "489094041256738;-8.6827696859839438]" 1207 | } 1208 | PropName "Parameters" 1209 | } 1210 | } 1211 | System { 1212 | Name "Subsystem" 1213 | Location [-7, 0, 1541, 848] 1214 | Open on 1215 | ModelBrowserVisibility off 1216 | ModelBrowserWidth 200 1217 | ScreenColor "white" 1218 | PaperOrientation "landscape" 1219 | PaperPositionMode "auto" 1220 | PaperType "usletter" 1221 | PaperUnits "inches" 1222 | TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] 1223 | TiledPageScale 1 1224 | ShowPageBoundaries off 1225 | ZoomFactor "100" 1226 | Block { 1227 | BlockType Inport 1228 | Name "In1" 1229 | SID "4" 1230 | Position [25, 343, 55, 357] 1231 | ZOrder -1 1232 | IconDisplay "Port number" 1233 | } 1234 | Block { 1235 | BlockType Inport 1236 | Name "In2" 1237 | SID "5" 1238 | Position [690, 433, 720, 447] 1239 | ZOrder -2 1240 | Port "2" 1241 | IconDisplay "Port number" 1242 | } 1243 | Block { 1244 | BlockType Constant 1245 | Name "Constant" 1246 | SID "6" 1247 | Position [265, 410, 285, 430] 1248 | ZOrder -3 1249 | Value "B11" 1250 | } 1251 | Block { 1252 | BlockType Constant 1253 | Name "Constant1" 1254 | SID "7" 1255 | Position [435, 420, 455, 440] 1256 | ZOrder -4 1257 | Value "B21" 1258 | } 1259 | Block { 1260 | BlockType Constant 1261 | Name "Constant2" 1262 | SID "8" 1263 | Position [425, 55, 445, 75] 1264 | ZOrder -5 1265 | } 1266 | Block { 1267 | BlockType Constant 1268 | Name "Constant3" 1269 | SID "9" 1270 | Position [420, 179, 475, 201] 1271 | ZOrder -6 1272 | Value "ones(S11,1)" 1273 | } 1274 | Block { 1275 | BlockType DiscreteStateSpace 1276 | Name "Discrete State-Space" 1277 | SID "10" 1278 | Position [140, 341, 250, 379] 1279 | ZOrder -7 1280 | A "[0 zeros(1,Ni1-2);eye(Ni1-2,Ni1-1)]" 1281 | B "[zeros(double(Ni1==1));eye(Ni1-1,1)]" 1282 | C "[0 zeros(1,Ni1-2);eye(Ni1-1,Ni1-1)]" 1283 | D "eye(Ni1,1) " 1284 | X0 "ud_init1" 1285 | SampleTime "Ts1" 1286 | } 1287 | Block { 1288 | BlockType DiscreteStateSpace 1289 | Name "Discrete State-Space2" 1290 | SID "11" 1291 | Position [125, 266, 235, 304] 1292 | ZOrder -8 1293 | A "[0 zeros(1,Nj1-2);eye(Nj1-2,Nj1-1)]" 1294 | B "[zeros(double(Nj1==1));eye(Nj1-1,1)]" 1295 | C "[0 zeros(1,Nj1-2);eye(Nj1-1,Nj1-1)]" 1296 | D "eye(Nj1,1) " 1297 | X0 "yd_init1" 1298 | SampleTime "Ts1" 1299 | } 1300 | Block { 1301 | BlockType Gain 1302 | Name "LW2,1" 1303 | SID "12" 1304 | Position [485, 50, 515, 80] 1305 | ZOrder -9 1306 | Gain "LW2_11'" 1307 | Multiplication "Matrix(K*u)" 1308 | } 1309 | Block { 1310 | BlockType Gain 1311 | Name "Matrix\nGain" 1312 | SID "13" 1313 | Position [265, 345, 295, 375] 1314 | ZOrder -10 1315 | Gain "IW1" 1316 | Multiplication "Matrix(K*u)" 1317 | } 1318 | Block { 1319 | BlockType Gain 1320 | Name "Matrix\nGain1" 1321 | SID "14" 1322 | Position [260, 270, 290, 300] 1323 | ZOrder -11 1324 | Gain "LW1_21" 1325 | Multiplication "Matrix(K*u)" 1326 | } 1327 | Block { 1328 | BlockType Gain 1329 | Name "Matrix\nGain2" 1330 | SID "15" 1331 | Position [430, 345, 460, 375] 1332 | ZOrder -12 1333 | Gain "LW2_11" 1334 | Multiplication "Matrix(K*u)" 1335 | } 1336 | Block { 1337 | BlockType Gain 1338 | Name "Matrix\nGain3" 1339 | SID "16" 1340 | Position [675, 25, 705, 55] 1341 | ZOrder -13 1342 | Gain "IW_gU1'" 1343 | Multiplication "Matrix(K*u)" 1344 | } 1345 | Block { 1346 | BlockType Gain 1347 | Name "Matrix\nGain4" 1348 | SID "17" 1349 | Position [660, 200, 690, 230] 1350 | ZOrder -14 1351 | Gain "LW1_21'" 1352 | Multiplication "Matrix(K*u)" 1353 | } 1354 | Block { 1355 | BlockType Mux 1356 | Name "Mux6" 1357 | SID "18" 1358 | Ports [2, 1] 1359 | Position [785, 98, 820, 147] 1360 | ZOrder -15 1361 | Inputs "2" 1362 | } 1363 | Block { 1364 | BlockType Product 1365 | Name "Product" 1366 | SID "19" 1367 | Ports [2, 1] 1368 | Position [445, 117, 475, 148] 1369 | ZOrder -16 1370 | } 1371 | Block { 1372 | BlockType Product 1373 | Name "Product1" 1374 | SID "20" 1375 | Ports [2, 1] 1376 | Position [575, 57, 605, 88] 1377 | ZOrder -17 1378 | } 1379 | Block { 1380 | BlockType S-Function 1381 | Name "S-Function" 1382 | SID "21" 1383 | Ports [1, 1] 1384 | Position [860, 110, 920, 140] 1385 | ZOrder -18 1386 | FunctionName "dyduvar1" 1387 | Parameters "Nu1,Ni1,Nj1,Ts1,minp1,maxp1,mint1,maxt1,Normalize1" 1388 | SFunctionDeploymentMode off 1389 | EnableBusSupport off 1390 | } 1391 | Block { 1392 | BlockType Sum 1393 | Name "Sum" 1394 | SID "22" 1395 | Ports [2, 1] 1396 | Position [745, 417, 775, 448] 1397 | ZOrder -19 1398 | Inputs "-+" 1399 | } 1400 | Block { 1401 | BlockType Sum 1402 | Name "Sum1" 1403 | SID "23" 1404 | Ports [2, 1] 1405 | Position [510, 127, 540, 158] 1406 | ZOrder -20 1407 | Inputs "-+" 1408 | } 1409 | Block { 1410 | BlockType UnitDelay 1411 | Name "Unit Delay2" 1412 | SID "24" 1413 | Position [580, 355, 610, 385] 1414 | ZOrder -21 1415 | InitialCondition "y_init1" 1416 | SampleTime "Ts1" 1417 | } 1418 | Block { 1419 | BlockType UnitDelay 1420 | Name "Unit Delay3" 1421 | SID "25" 1422 | Position [80, 335, 110, 365] 1423 | ZOrder -22 1424 | InitialCondition "u_init1" 1425 | SampleTime "Ts1" 1426 | } 1427 | Block { 1428 | BlockType SubSystem 1429 | Name "netsum" 1430 | SID "26" 1431 | Ports [3, 1] 1432 | Position [320, 339, 345, 381] 1433 | ZOrder -23 1434 | RequestExecContextInheritance off 1435 | Variant off 1436 | Object { 1437 | $PropName "MaskObject" 1438 | $ObjectID 42 1439 | $ClassName "Simulink.Mask" 1440 | Display "disp('+')" 1441 | } 1442 | System { 1443 | Name "netsum" 1444 | Location [286, 45, 834, 581] 1445 | Open off 1446 | ModelBrowserVisibility off 1447 | ModelBrowserWidth 200 1448 | ScreenColor "white" 1449 | PaperOrientation "landscape" 1450 | PaperPositionMode "auto" 1451 | PaperType "usletter" 1452 | PaperUnits "inches" 1453 | TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] 1454 | TiledPageScale 1 1455 | ShowPageBoundaries off 1456 | ZoomFactor "100" 1457 | Block { 1458 | BlockType Inport 1459 | Name "In1" 1460 | SID "27" 1461 | Position [20, 50, 40, 70] 1462 | ZOrder -1 1463 | IconDisplay "Port number" 1464 | } 1465 | Block { 1466 | BlockType Inport 1467 | Name "In2" 1468 | SID "28" 1469 | Position [20, 90, 40, 110] 1470 | ZOrder -2 1471 | Port "2" 1472 | IconDisplay "Port number" 1473 | } 1474 | Block { 1475 | BlockType Inport 1476 | Name "In3" 1477 | SID "29" 1478 | Position [20, 130, 40, 150] 1479 | ZOrder -3 1480 | Port "3" 1481 | IconDisplay "Port number" 1482 | } 1483 | Block { 1484 | BlockType Sum 1485 | Name "netsum" 1486 | SID "30" 1487 | Ports [3, 1] 1488 | Position [90, 59, 115, 101] 1489 | ZOrder -4 1490 | Inputs "3" 1491 | } 1492 | Block { 1493 | BlockType Outport 1494 | Name "Out1" 1495 | SID "31" 1496 | Position [145, 80, 165, 100] 1497 | ZOrder -5 1498 | IconDisplay "Port number" 1499 | } 1500 | Line { 1501 | ZOrder 1 1502 | SrcBlock "In1" 1503 | SrcPort 1 1504 | DstBlock "netsum" 1505 | DstPort 1 1506 | } 1507 | Line { 1508 | ZOrder 2 1509 | SrcBlock "In2" 1510 | SrcPort 1 1511 | DstBlock "netsum" 1512 | DstPort 2 1513 | } 1514 | Line { 1515 | ZOrder 3 1516 | SrcBlock "In3" 1517 | SrcPort 1 1518 | DstBlock "netsum" 1519 | DstPort 3 1520 | } 1521 | Line { 1522 | ZOrder 4 1523 | SrcBlock "netsum" 1524 | SrcPort 1 1525 | DstBlock "Out1" 1526 | DstPort 1 1527 | } 1528 | } 1529 | } 1530 | Block { 1531 | BlockType SubSystem 1532 | Name "netsum1" 1533 | SID "32" 1534 | Ports [2, 1] 1535 | Position [490, 350, 515, 385] 1536 | ZOrder -24 1537 | RequestExecContextInheritance off 1538 | Variant off 1539 | Object { 1540 | $PropName "MaskObject" 1541 | $ObjectID 43 1542 | $ClassName "Simulink.Mask" 1543 | Display "disp('+')" 1544 | } 1545 | System { 1546 | Name "netsum1" 1547 | Location [286, 45, 834, 581] 1548 | Open off 1549 | ModelBrowserVisibility off 1550 | ModelBrowserWidth 200 1551 | ScreenColor "white" 1552 | PaperOrientation "landscape" 1553 | PaperPositionMode "auto" 1554 | PaperType "usletter" 1555 | PaperUnits "inches" 1556 | TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] 1557 | TiledPageScale 1 1558 | ShowPageBoundaries off 1559 | ZoomFactor "100" 1560 | Block { 1561 | BlockType Inport 1562 | Name "In1" 1563 | SID "33" 1564 | Position [20, 65, 40, 85] 1565 | ZOrder -1 1566 | IconDisplay "Port number" 1567 | } 1568 | Block { 1569 | BlockType Inport 1570 | Name "In2" 1571 | SID "34" 1572 | Position [20, 105, 40, 125] 1573 | ZOrder -2 1574 | Port "2" 1575 | IconDisplay "Port number" 1576 | } 1577 | Block { 1578 | BlockType Sum 1579 | Name "netsum1" 1580 | SID "35" 1581 | Ports [2, 1] 1582 | Position [90, 60, 115, 95] 1583 | ZOrder -3 1584 | Inputs "2" 1585 | } 1586 | Block { 1587 | BlockType Outport 1588 | Name "Out1" 1589 | SID "36" 1590 | Position [145, 80, 165, 100] 1591 | ZOrder -4 1592 | IconDisplay "Port number" 1593 | } 1594 | Line { 1595 | ZOrder 1 1596 | SrcBlock "In1" 1597 | SrcPort 1 1598 | DstBlock "netsum1" 1599 | DstPort 1 1600 | } 1601 | Line { 1602 | ZOrder 2 1603 | SrcBlock "In2" 1604 | SrcPort 1 1605 | DstBlock "netsum1" 1606 | DstPort 2 1607 | } 1608 | Line { 1609 | ZOrder 3 1610 | SrcBlock "netsum1" 1611 | SrcPort 1 1612 | DstBlock "Out1" 1613 | DstPort 1 1614 | } 1615 | } 1616 | } 1617 | Block { 1618 | BlockType SubSystem 1619 | Name "purelin" 1620 | SID "37" 1621 | Ports [1, 1] 1622 | Position [530, 358, 555, 382] 1623 | ZOrder -25 1624 | RequestExecContextInheritance off 1625 | Variant off 1626 | Object { 1627 | $PropName "MaskObject" 1628 | $ObjectID 44 1629 | $ClassName "Simulink.Mask" 1630 | Display "plot([-1 1],[0 0],[-1 1],[-1 1])" 1631 | } 1632 | System { 1633 | Name "purelin" 1634 | Location [-7, 0, 1541, 848] 1635 | Open off 1636 | ModelBrowserVisibility off 1637 | ModelBrowserWidth 200 1638 | ScreenColor "white" 1639 | PaperOrientation "landscape" 1640 | PaperPositionMode "auto" 1641 | PaperType "usletter" 1642 | PaperUnits "inches" 1643 | TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] 1644 | TiledPageScale 1 1645 | ShowPageBoundaries off 1646 | ZoomFactor "100" 1647 | Block { 1648 | BlockType Inport 1649 | Name "n" 1650 | SID "38" 1651 | Position [25, 33, 55, 47] 1652 | ZOrder -1 1653 | IconDisplay "Port number" 1654 | } 1655 | Block { 1656 | BlockType Outport 1657 | Name "a" 1658 | SID "39" 1659 | Position [205, 33, 235, 47] 1660 | ZOrder -2 1661 | IconDisplay "Port number" 1662 | } 1663 | Line { 1664 | ZOrder 1 1665 | SrcBlock "n" 1666 | SrcPort 1 1667 | DstBlock "a" 1668 | DstPort 1 1669 | } 1670 | } 1671 | } 1672 | Block { 1673 | BlockType SubSystem 1674 | Name "tansig" 1675 | SID "40" 1676 | Ports [1, 1] 1677 | Position [370, 348, 395, 372] 1678 | ZOrder -26 1679 | RequestExecContextInheritance off 1680 | Variant off 1681 | Object { 1682 | $PropName "MaskObject" 1683 | $ObjectID 45 1684 | $ClassName "Simulink.Mask" 1685 | Display "plot([-1 1],[0 0],[-1 -.9 -.8 -.7 -.6 -.5 -.4 -.3 -.2 -.1 0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1],2./(1+exp" 1686 | "(-8*[-1 -.9 -.8 -.7 -.6 -.5 -.4 -.3 -.2 -.1 0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1]))-1)" 1687 | } 1688 | System { 1689 | Name "tansig" 1690 | Location [-7, 0, 1541, 848] 1691 | Open off 1692 | ModelBrowserVisibility off 1693 | ModelBrowserWidth 200 1694 | ScreenColor "white" 1695 | PaperOrientation "landscape" 1696 | PaperPositionMode "auto" 1697 | PaperType "usletter" 1698 | PaperUnits "inches" 1699 | TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] 1700 | TiledPageScale 1 1701 | ShowPageBoundaries off 1702 | ZoomFactor "100" 1703 | Block { 1704 | BlockType Inport 1705 | Name "n" 1706 | SID "41" 1707 | Position [25, 33, 55, 47] 1708 | ZOrder -1 1709 | IconDisplay "Port number" 1710 | } 1711 | Block { 1712 | BlockType Math 1713 | Name "Exp" 1714 | SID "42" 1715 | Ports [1, 1] 1716 | Position [155, 25, 185, 55] 1717 | ZOrder -2 1718 | } 1719 | Block { 1720 | BlockType Gain 1721 | Name "Gain" 1722 | SID "43" 1723 | Position [90, 25, 120, 55] 1724 | ZOrder -3 1725 | Gain "-2" 1726 | } 1727 | Block { 1728 | BlockType Gain 1729 | Name "Gain1" 1730 | SID "44" 1731 | Position [370, 30, 400, 60] 1732 | ZOrder -4 1733 | Gain "2" 1734 | } 1735 | Block { 1736 | BlockType Math 1737 | Name "Reciprocal" 1738 | SID "45" 1739 | Ports [1, 1] 1740 | Position [295, 30, 325, 60] 1741 | ZOrder -5 1742 | Operator "reciprocal" 1743 | } 1744 | Block { 1745 | BlockType Sum 1746 | Name "Sum" 1747 | SID "46" 1748 | Ports [2, 1] 1749 | Position [225, 27, 255, 58] 1750 | ZOrder -6 1751 | } 1752 | Block { 1753 | BlockType Sum 1754 | Name "Sum1" 1755 | SID "47" 1756 | Ports [2, 1] 1757 | Position [445, 27, 475, 58] 1758 | ZOrder -7 1759 | Inputs "+-" 1760 | } 1761 | Block { 1762 | BlockType Constant 1763 | Name "one" 1764 | SID "48" 1765 | Position [160, 85, 180, 105] 1766 | ZOrder -8 1767 | } 1768 | Block { 1769 | BlockType Constant 1770 | Name "one1" 1771 | SID "49" 1772 | Position [375, 85, 395, 105] 1773 | ZOrder -9 1774 | } 1775 | Block { 1776 | BlockType Outport 1777 | Name "a" 1778 | SID "50" 1779 | Position [515, 38, 545, 52] 1780 | ZOrder -10 1781 | IconDisplay "Port number" 1782 | } 1783 | Line { 1784 | ZOrder 1 1785 | SrcBlock "n" 1786 | SrcPort 1 1787 | DstBlock "Gain" 1788 | DstPort 1 1789 | } 1790 | Line { 1791 | ZOrder 2 1792 | SrcBlock "Gain" 1793 | SrcPort 1 1794 | DstBlock "Exp" 1795 | DstPort 1 1796 | } 1797 | Line { 1798 | ZOrder 3 1799 | SrcBlock "Exp" 1800 | SrcPort 1 1801 | Points [20, 0] 1802 | DstBlock "Sum" 1803 | DstPort 1 1804 | } 1805 | Line { 1806 | ZOrder 4 1807 | SrcBlock "one" 1808 | SrcPort 1 1809 | Points [25, 0] 1810 | DstBlock "Sum" 1811 | DstPort 2 1812 | } 1813 | Line { 1814 | ZOrder 5 1815 | SrcBlock "Sum" 1816 | SrcPort 1 1817 | DstBlock "Reciprocal" 1818 | DstPort 1 1819 | } 1820 | Line { 1821 | ZOrder 6 1822 | SrcBlock "Reciprocal" 1823 | SrcPort 1 1824 | DstBlock "Gain1" 1825 | DstPort 1 1826 | } 1827 | Line { 1828 | ZOrder 7 1829 | SrcBlock "Gain1" 1830 | SrcPort 1 1831 | Points [25, 0] 1832 | DstBlock "Sum1" 1833 | DstPort 1 1834 | } 1835 | Line { 1836 | ZOrder 8 1837 | SrcBlock "one1" 1838 | SrcPort 1 1839 | Points [30, 0] 1840 | DstBlock "Sum1" 1841 | DstPort 2 1842 | } 1843 | Line { 1844 | ZOrder 9 1845 | SrcBlock "Sum1" 1846 | SrcPort 1 1847 | DstBlock "a" 1848 | DstPort 1 1849 | } 1850 | } 1851 | } 1852 | Block { 1853 | BlockType Outport 1854 | Name "Out1" 1855 | SID "51" 1856 | Position [730, 363, 760, 377] 1857 | ZOrder -27 1858 | IconDisplay "Port number" 1859 | } 1860 | Block { 1861 | BlockType Outport 1862 | Name "Out2" 1863 | SID "52" 1864 | Position [425, 308, 455, 322] 1865 | ZOrder -28 1866 | Port "2" 1867 | IconDisplay "Port number" 1868 | } 1869 | Block { 1870 | BlockType Outport 1871 | Name "Out3" 1872 | SID "53" 1873 | Position [800, 428, 830, 442] 1874 | ZOrder -29 1875 | Port "3" 1876 | IconDisplay "Port number" 1877 | } 1878 | Block { 1879 | BlockType Outport 1880 | Name "Out4" 1881 | SID "54" 1882 | Position [760, 33, 790, 47] 1883 | ZOrder -30 1884 | Port "4" 1885 | IconDisplay "Port number" 1886 | } 1887 | Block { 1888 | BlockType Outport 1889 | Name "Out5" 1890 | SID "55" 1891 | Position [750, 208, 780, 222] 1892 | ZOrder -31 1893 | Port "5" 1894 | IconDisplay "Port number" 1895 | } 1896 | Block { 1897 | BlockType Outport 1898 | Name "Out2a" 1899 | SID "56" 1900 | Position [945, 118, 975, 132] 1901 | ZOrder -32 1902 | Port "6" 1903 | IconDisplay "Port number" 1904 | } 1905 | Line { 1906 | ZOrder 1 1907 | SrcBlock "LW2,1" 1908 | SrcPort 1 1909 | DstBlock "Product1" 1910 | DstPort 1 1911 | } 1912 | Line { 1913 | ZOrder 2 1914 | SrcBlock "Product1" 1915 | SrcPort 1 1916 | Points [15, 0] 1917 | Branch { 1918 | ZOrder 3 1919 | Points [0, 140] 1920 | DstBlock "Matrix\nGain4" 1921 | DstPort 1 1922 | } 1923 | Branch { 1924 | ZOrder 4 1925 | Points [0, -35] 1926 | DstBlock "Matrix\nGain3" 1927 | DstPort 1 1928 | } 1929 | } 1930 | Line { 1931 | ZOrder 5 1932 | SrcBlock "Constant2" 1933 | SrcPort 1 1934 | DstBlock "LW2,1" 1935 | DstPort 1 1936 | } 1937 | Line { 1938 | ZOrder 6 1939 | SrcBlock "Product" 1940 | SrcPort 1 1941 | DstBlock "Sum1" 1942 | DstPort 1 1943 | } 1944 | Line { 1945 | ZOrder 7 1946 | SrcBlock "Constant3" 1947 | SrcPort 1 1948 | Points [10, 0; 0, -40] 1949 | DstBlock "Sum1" 1950 | DstPort 2 1951 | } 1952 | Line { 1953 | ZOrder 8 1954 | SrcBlock "Sum1" 1955 | SrcPort 1 1956 | Points [10, 0; 0, -65] 1957 | DstBlock "Product1" 1958 | DstPort 2 1959 | } 1960 | Line { 1961 | ZOrder 9 1962 | SrcBlock "netsum1" 1963 | SrcPort 1 1964 | DstBlock "purelin" 1965 | DstPort 1 1966 | } 1967 | Line { 1968 | ZOrder 10 1969 | SrcBlock "Constant1" 1970 | SrcPort 1 1971 | Points [10, 0; 0, -55] 1972 | DstBlock "netsum1" 1973 | DstPort 2 1974 | } 1975 | Line { 1976 | ZOrder 11 1977 | SrcBlock "Matrix\nGain2" 1978 | SrcPort 1 1979 | DstBlock "netsum1" 1980 | DstPort 1 1981 | } 1982 | Line { 1983 | ZOrder 12 1984 | SrcBlock "Constant" 1985 | SrcPort 1 1986 | Points [15, 0] 1987 | DstBlock "netsum" 1988 | DstPort 3 1989 | } 1990 | Line { 1991 | ZOrder 13 1992 | SrcBlock "Matrix\nGain1" 1993 | SrcPort 1 1994 | Points [10, 0] 1995 | DstBlock "netsum" 1996 | DstPort 1 1997 | } 1998 | Line { 1999 | ZOrder 14 2000 | SrcBlock "Discrete State-Space2" 2001 | SrcPort 1 2002 | DstBlock "Matrix\nGain1" 2003 | DstPort 1 2004 | } 2005 | Line { 2006 | ZOrder 15 2007 | SrcBlock "Matrix\nGain" 2008 | SrcPort 1 2009 | DstBlock "netsum" 2010 | DstPort 2 2011 | } 2012 | Line { 2013 | ZOrder 16 2014 | SrcBlock "tansig" 2015 | SrcPort 1 2016 | Points [5, 0] 2017 | Branch { 2018 | ZOrder 17 2019 | Points [0, -45] 2020 | Branch { 2021 | ZOrder 18 2022 | Points [0, -175] 2023 | Branch { 2024 | ZOrder 19 2025 | Points [0, -15] 2026 | DstBlock "Product" 2027 | DstPort 1 2028 | } 2029 | Branch { 2030 | ZOrder 20 2031 | DstBlock "Product" 2032 | DstPort 2 2033 | } 2034 | } 2035 | Branch { 2036 | ZOrder 21 2037 | DstBlock "Out2" 2038 | DstPort 1 2039 | } 2040 | } 2041 | Branch { 2042 | ZOrder 22 2043 | DstBlock "Matrix\nGain2" 2044 | DstPort 1 2045 | } 2046 | } 2047 | Line { 2048 | ZOrder 23 2049 | SrcBlock "purelin" 2050 | SrcPort 1 2051 | DstBlock "Unit Delay2" 2052 | DstPort 1 2053 | } 2054 | Line { 2055 | ZOrder 24 2056 | SrcBlock "Unit Delay2" 2057 | SrcPort 1 2058 | Points [5, 0] 2059 | Branch { 2060 | ZOrder 25 2061 | Points [0, -125; -520, 0; 0, 40] 2062 | DstBlock "Discrete State-Space2" 2063 | DstPort 1 2064 | } 2065 | Branch { 2066 | ZOrder 26 2067 | Points [90, 0] 2068 | Branch { 2069 | ZOrder 27 2070 | Points [0, 55] 2071 | DstBlock "Sum" 2072 | DstPort 1 2073 | } 2074 | Branch { 2075 | ZOrder 28 2076 | DstBlock "Out1" 2077 | DstPort 1 2078 | } 2079 | } 2080 | } 2081 | Line { 2082 | ZOrder 29 2083 | SrcBlock "Discrete State-Space" 2084 | SrcPort 1 2085 | DstBlock "Matrix\nGain" 2086 | DstPort 1 2087 | } 2088 | Line { 2089 | ZOrder 30 2090 | SrcBlock "Matrix\nGain4" 2091 | SrcPort 1 2092 | Points [35, 0] 2093 | Branch { 2094 | ZOrder 31 2095 | Points [0, -80] 2096 | DstBlock "Mux6" 2097 | DstPort 2 2098 | } 2099 | Branch { 2100 | ZOrder 32 2101 | DstBlock "Out5" 2102 | DstPort 1 2103 | } 2104 | } 2105 | Line { 2106 | ZOrder 33 2107 | SrcBlock "Mux6" 2108 | SrcPort 1 2109 | DstBlock "S-Function" 2110 | DstPort 1 2111 | } 2112 | Line { 2113 | ZOrder 34 2114 | SrcBlock "Unit Delay3" 2115 | SrcPort 1 2116 | Points [10, 0] 2117 | DstBlock "Discrete State-Space" 2118 | DstPort 1 2119 | } 2120 | Line { 2121 | ZOrder 35 2122 | SrcBlock "Matrix\nGain3" 2123 | SrcPort 1 2124 | Points [30, 0] 2125 | Branch { 2126 | ZOrder 36 2127 | Points [0, 70] 2128 | DstBlock "Mux6" 2129 | DstPort 1 2130 | } 2131 | Branch { 2132 | ZOrder 37 2133 | DstBlock "Out4" 2134 | DstPort 1 2135 | } 2136 | } 2137 | Line { 2138 | ZOrder 38 2139 | SrcBlock "S-Function" 2140 | SrcPort 1 2141 | DstBlock "Out2a" 2142 | DstPort 1 2143 | } 2144 | Line { 2145 | ZOrder 39 2146 | SrcBlock "In1" 2147 | SrcPort 1 2148 | DstBlock "Unit Delay3" 2149 | DstPort 1 2150 | } 2151 | Line { 2152 | ZOrder 40 2153 | SrcBlock "Sum" 2154 | SrcPort 1 2155 | DstBlock "Out3" 2156 | DstPort 1 2157 | } 2158 | Line { 2159 | ZOrder 41 2160 | SrcBlock "In2" 2161 | SrcPort 1 2162 | DstBlock "Sum" 2163 | DstPort 2 2164 | } 2165 | Line { 2166 | ZOrder 42 2167 | SrcBlock "netsum" 2168 | SrcPort 1 2169 | DstBlock "tansig" 2170 | DstPort 1 2171 | } 2172 | } 2173 | } 2174 | Block { 2175 | BlockType Outport 2176 | Name "Outport1" 2177 | SID "57" 2178 | Position [550, 45, 570, 65] 2179 | ZOrder -4 2180 | BackgroundColor "lightBlue" 2181 | IconDisplay "Port number" 2182 | } 2183 | Block { 2184 | BlockType Outport 2185 | Name "Outport2" 2186 | SID "58" 2187 | Position [550, 100, 570, 120] 2188 | ZOrder -5 2189 | BackgroundColor "lightBlue" 2190 | Port "2" 2191 | IconDisplay "Port number" 2192 | } 2193 | Block { 2194 | BlockType Outport 2195 | Name "Outport3" 2196 | SID "59" 2197 | Position [550, 150, 570, 170] 2198 | ZOrder -6 2199 | BackgroundColor "lightBlue" 2200 | Port "3" 2201 | IconDisplay "Port number" 2202 | } 2203 | Block { 2204 | BlockType Outport 2205 | Name "Outport4 (gU)" 2206 | SID "60" 2207 | Position [555, 205, 575, 225] 2208 | ZOrder -7 2209 | BackgroundColor "lightBlue" 2210 | Port "4" 2211 | IconDisplay "Port number" 2212 | } 2213 | Block { 2214 | BlockType Outport 2215 | Name "Outport5 (gUd)" 2216 | SID "61" 2217 | Position [555, 260, 575, 280] 2218 | ZOrder -8 2219 | BackgroundColor "lightBlue" 2220 | Port "5" 2221 | IconDisplay "Port number" 2222 | } 2223 | Block { 2224 | BlockType Outport 2225 | Name "Outport6" 2226 | SID "62" 2227 | Position [555, 335, 575, 355] 2228 | ZOrder -9 2229 | BackgroundColor "lightBlue" 2230 | Port "6" 2231 | IconDisplay "Port number" 2232 | } 2233 | Line { 2234 | ZOrder 1 2235 | SrcBlock "Subsystem" 2236 | SrcPort 2 2237 | Points [20, 0; 0, -55] 2238 | DstBlock "Outport2" 2239 | DstPort 1 2240 | } 2241 | Line { 2242 | ZOrder 2 2243 | SrcBlock "Subsystem" 2244 | SrcPort 1 2245 | Points [5, 0; 0, -95] 2246 | DstBlock "Outport1" 2247 | DstPort 1 2248 | } 2249 | Line { 2250 | ZOrder 3 2251 | SrcBlock "Subsystem" 2252 | SrcPort 3 2253 | Points [45, 0; 0, -20] 2254 | DstBlock "Outport3" 2255 | DstPort 1 2256 | } 2257 | Line { 2258 | ZOrder 4 2259 | SrcBlock "Inport1" 2260 | SrcPort 1 2261 | DstBlock "Subsystem" 2262 | DstPort 2 2263 | } 2264 | Line { 2265 | ZOrder 5 2266 | SrcBlock "Subsystem" 2267 | SrcPort 5 2268 | Points [20, 0; 0, 60] 2269 | DstBlock "Outport5 (gUd)" 2270 | DstPort 1 2271 | } 2272 | Line { 2273 | ZOrder 6 2274 | SrcBlock "Inport" 2275 | SrcPort 1 2276 | DstBlock "Subsystem" 2277 | DstPort 1 2278 | } 2279 | Line { 2280 | ZOrder 7 2281 | SrcBlock "Subsystem" 2282 | SrcPort 4 2283 | Points [45, 0; 0, 20] 2284 | DstBlock "Outport4 (gU)" 2285 | DstPort 1 2286 | } 2287 | Line { 2288 | ZOrder 8 2289 | SrcBlock "Subsystem" 2290 | SrcPort 6 2291 | Points [0, 120] 2292 | DstBlock "Outport6" 2293 | DstPort 1 2294 | } 2295 | } 2296 | } 2297 | --------------------------------------------------------------------------------