Baixe o app para aproveitar ainda mais
Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original
5 - Lyapunov e Energia/Lyapunov_e_Energia.pdf Faculdade de Engenharia To´picos Especiais II - ECA Introduc¸a˜o a` Teoria de Lyapunov Controle baseado em energia 1 Introduc¸a˜o Certamente a teoria mais importante ja´ desenvolvida para a ana´lise e controle de sistemas na˜o-lineares e´ a chamada Teoria de Lyapunov. Ela se baseia em uma generalizac¸a˜o do conceito de energia e permite que concluso˜es sobre a estabilidade do sistema sejam tiradas a partir de uma func¸a˜o escalar. Ou seja, atrave´s deste me´todo na˜o e´ necessa´rio solucionar as equac¸o˜es diferenciais que descrevem o sistema para tirar concluso˜es sobre o mesmo. Ale´m disto, o me´todo direto de Lyapunov na˜o utiliza nenhuma aproximac¸a˜o do sistema, portanto e´ uma ferramenta muito mais poderosa do que a simples linearizac¸a˜o do mesmo. 2 Energia Vs. Estabilidade Existe uma relac¸a˜o direta entre a energia de um sistema e a estabilidade do mesmo. De forma geral, pode-se dizer que: 1. todo o ponto em que a energia e´ zero e´ um ponto de equil´ıbrio do sistema; 2. estabilidade assinto´tica implica a convergeˆncia do sistema mecaˆnico para o ponto de energia zero; 3. instabilidade e´ relacionada ao crescimento de energia; Portanto, para analisar a estabilidade de um sistema dinaˆmico nos basta analisar a variac¸a˜o da energia do mesmo. Tomemos como exemplo o sistema massa mola amortecedor, descrito por, mx¨+ bx˙+ k0x = 0 (1) A energia E do sistema e´ dada pela soma da energia cine´tica e da energia potencial do mesmo: E(x) = 1 2 mx˙2 + 1 2 k0x 2 > 0 (2) 1 e sua variac¸a˜o e´, E˙(x) = mx˙x¨+ k0xx˙ = −bx˙ 2 ≤ 0 (3) A variac¸a˜o da energia e´ negativa (perda de energia), portanto o sistema tende ao ponto de energia zero, ou seja, e´ assintoticamente esta´vel. Esta e´ a resposta esperada uma vez que b > 0 e´ o atrito presente no sistema. Neste mesmo exemplo, se b = 0 enta˜o ter´ıamos que E˙(x) = 0, ou seja, o sistema na˜o dissipa energia. Ao inve´s disto ele mante´m uma oscilac¸a˜o sustenta´vel, sempre transformando energia cine´tica em potencial e vice-versa. 3 Func¸o˜es de Lyapunov A teoria de Lyapunov pode ser vista como uma generalizac¸a˜o do conceito de Energia. Lyapunov explorou o fato de que na˜o e´ necessa´rio descrever a energia de um sistema para conseguir analisar a sua estabilidade. Precisamos apenas de uma func¸a˜o que seja similar a` energia. Antes de descrevermos o me´todo de Lyapunov, precisamos de uma de- finic¸a˜o sobre a positividade de func¸o˜es escalares. Definic¸a˜o 1 Uma func¸a˜o escalar cont´ınua V (x) e´ dita positiva definida se V (0) = 0 e V (x) > 0 ∀ x 6= 0. Note que a func¸a˜o (2) e´ positiva definida. De uma forma geral, func¸o˜es que representam a energia de um dado sistema sa˜o positivas definidas, ou seja, satisfazem a condic¸a˜o de que E(0) = 0 e E(x) > 0 para todo x 6= 0. Pore´m, na˜o apenas func¸o˜es que repre- sentam a energia do sistema sa˜o po- sitivas definidas. Outro exemplo e´ a func¸a˜o quadra´tica V (x1, x2) = x 2 1+x 2 2 representada na figura ao lado. Note que ela tambe´m satisfaz as condic¸o˜es de positividade definida, mas na˜o re- presenta nenhuma grandesa f´ısica. −10 −5 0 5 10 −10 −5 0 5 10 0 20 40 60 80 100 120 140 Para analisar a estabilidade de um sistema basta encontrar uma func¸a˜o positiva definida com derivada negativa semi-definida. Em outras palavras, se existe uma func¸a˜o V (x) > 0 para todo x 6= 0 tal que V˙ (x) ≤ 0, onde x sa˜o os estados de um sistema de interesse, podemos afirmar que este sistema e´ esta´vel. Ale´m disto, se V˙ (x) < 0 para todo x 6= 0, enta˜o o sistema e´ dito ser assintoticamente esta´vel. Func¸o˜es que satisfazem essas condic¸o˜es sa˜o chamadas Func¸o˜es de Lyapu- nov, e representam uma generalizac¸a˜o do conceito de energia e dissipac¸a˜o de energia. 2 4 Tarefas Neste trabalho usaremos o conceito de Energia e func¸a˜o de Lyapunov para re- alizar o swing-up do peˆndulo invertido. Para tanto, iremos considerar apenas a dinaˆmica do peˆndulo, que pode ser descrito por, Jθ¨ +mgl sin(θ) +ml cos(θ) · u = 0. Esta e´ apenas uma aproximac¸a˜o do modelo real do peˆndulo, aqui u e´ a acelerac¸a˜o do carro. A energia deste sistema e´ dada pela soma das componentes cine´tica e potencial do mesmo: E = J 2 θ˙2 +mgl(1− cos(θ)) Note que esta func¸a˜o e´ positiva definida, e que no ponto de equil´ıbrio desejado θ = pi temos que Ed = 2mgl. Portanto, usaremos a seguinte “func¸a˜o candidata” de Lyapunov, V (θ, θ˙) = (E−Ed) 2 2 (4) Pede-se: 1. (2.0 pontos) Encontrar a variac¸a˜o da taxa de energia do sistema, ou seja, encontrar a expressa˜o V˙ (θ, θ˙) = (E − Ed) · E˙. 2. (2.0 pontos) Encontrar a lei de controle u que faz com que V˙ seja negativa definida. 3. (2.0 pontos) Implementar a lei de controle nos arquivos dispon´ıveis no moodle para que o peˆndulo parta de uma condic¸a˜o inicial θ ≈ 0 e chegue em θ ≈ pi. 4. (2.0 pontos) Uma vez em θ ≈ pi, fac¸a a troca da lei de controle na˜o- linear para uma lei do tipo u = F · r−K · x, para que o peˆndulo fique no ponto de equil´ıbrio xe = [1 0 pi 0] T . 5. Apresente o trabalho para o professor ate´ a data estipulada em aula. Boa sorte. Refereˆncias [1] Astro¨m, Karl Johan, and Katsuhisa Furuta. “Swinging up a pendulum by energy control.” Automatica 36.2 (2000): 287-295. [2] Slotine, J.J.E. e W. Li. Applied Nonlinear Control. Prentice Hall. 1991. [3] Khalil, H. K., Nonlinear Systems, 3rd ed. Upper Saddle river, NJ: Prentice Hall, 2002. 3 5 - Lyapunov e Energia/Parte 1/SimPenInvZero.m clear all; clc T = 0.001; ttotal = 10; %% Dados do sistema g=9.8; % gravidade l=1; % lenght of rod M=1; % mass of cart m=0.1; % mass of Pendulum b1= 0.5; % cart friction b2= 0; % pendulum friction sat = 8;% saturation of controller J = m*l^2; IC1=0; IC2=2.9; %IC2=pi*1.01; r0=2; % %% Linearizacao em theta = 0; % A0 =[0 1 0 0 % 0 -b1/M m*g/M b2/l/M % 0 0 0 1 % 0 -b1/(M*l) -(M+m)*g/(M*l) -b2*(M+m)/(m*l)/(M*l)]; % % A0 = A0*T+eye(4); % B0 = [0 1/M 0 -1/(M*l)]'; % % B0 = B0*T; % % p = 0; % r0 = 1; % % %% Linearizacao em theta = pi; % A = [0 1 0 0 % 0 -b1/M m*g/M -b2/l/M % 0 0 0 1 % 0 -b1/(M*l) (M+m)*g/(M*l) -b2*(M+m)/(m*l)/(M*l)]; % % A = A*T+eye(4); % B = [0 1/M 0 1/(M*l)]'; % % B = B*T; % C = [1 0 0 0; 0 0 1 0]; % D = [0;0]; %% Linearizacao em theta = 0; A0 =[0 1 0 0 0 -b1/M m*g/M b2/(M*l) 0 0 0 1 0 b1/(M*l) -(M+m)*g/(M*l) -b2*(M+m)/(m*M*l^2)]; B0 = [0 l/M 0 -1/(M*l)]'; p = 0; %% Linearizacao em theta = pi; A = [0 1 0 0 0 -b1/M m*g/M -b2/(M*l) 0 0 0 1 0 -b1/(M*l) (M+m)*g/(M*l) -b2*(M+m)/(m*M*l^2)]; B = [0 l/M 0 1/(M*l)]'; C = [1 0 0 0; 0 0 1 0]; D = [0;0]; %% Controle linear ksi = 1; wn = 4.2/ksi; den = [1 2*ksi*wn wn^2]; root = roots(den) P = [root(1) root(2) 1.1*root(1) 1.1*root(2)] K = acker(A,B,P) F = inv([1 0 0 0]*inv(eye(4)*0-A+B*K)*B); t1 = eig(A-B*K) %F=0; %% Controle nao linear th = 0; KK = 0; %% simulacao sim('SysPenduloInvZero'); %% animacao N=size(simout.signals.values); N=N(1); % y(:,1)=simout.signals.values(:,1); % y(:,2)=simout.signals.values(:,2); y(:,1)=simout.signals.values(1:10:end,1); y(:,2)=simout.signals.values(1:10:end,2); for k =1:length(y(:,1)) Z1 = [y(k,1)-0.3 y(k,1)+0.3]; Z2 = [0 0]; plot(Z1,Z2,'r','LineWidth',7); hold on plot([-5 -1 -1 -1 0 0 0 1 1 1 5],[-0.1 -0.1 -0.2 -0.1 -0.1 -0.2 -0.1 -0.1 -0.2 -0.1 -0.1],'k','LineWidth',1); plot([y(k,1) y(k,1)+l*sin(y(k,2))],[0 -l*cos(y(k,2))],'LineWidth',0.5); plot([y(k,1)+l*sin(y(k,2))],[-l*cos(y(k,2))],'*','LineWidth',5); axis off; axis equal; axis([-3 3 -3 3]); drawnow hold off pause(0.01) end return 5 - Lyapunov e Energia/Parte 1/slprj/_sfprj/SysPenduloInvZero/_self/sfun/info/binfo.mat 5 - Lyapunov e Energia/Parte 1/slprj/_sfprj/SysPenduloInvZero/_self/sfun/info/chart2_wbGiK8XvQs0sikmJ2oz8aG.mat 5 - Lyapunov e Energia/Parte 1/slprj/_sfprj/SysPenduloInvZero/_self/sfun/src/c2_SysPenduloInvZero.c /* Include files */ #include "blascompat32.h" #include "SysPenduloInvZero_sfun.h" #include "c2_SysPenduloInvZero.h" #include "mwmathutil.h" #define CHARTINSTANCE_CHARTNUMBER (chartInstance->chartNumber) #define CHARTINSTANCE_INSTANCENUMBER (chartInstance->instanceNumber) #include "SysPenduloInvZero_sfun_debug_macros.h" /* Type Definitions */ /* Named Constants */ /* Variable Declarations */ /* Variable Definitions */ static const char * c2_debug_family_names[17] = { "nargin", "nargout", "r", "x", "F", "K", "KK", "th", "J", "m", "g", "l", "b1", "b2", "T", "u", "u2" }; /* Function Declarations */ static void initialize_c2_SysPenduloInvZero(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance); static void initialize_params_c2_SysPenduloInvZero (SFc2_SysPenduloInvZeroInstanceStruct *chartInstance); static void enable_c2_SysPenduloInvZero(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance); static void disable_c2_SysPenduloInvZero(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance); static void c2_update_debugger_state_c2_SysPenduloInvZero (SFc2_SysPenduloInvZeroInstanceStruct *chartInstance); static const mxArray *get_sim_state_c2_SysPenduloInvZero (SFc2_SysPenduloInvZeroInstanceStruct *chartInstance); static void set_sim_state_c2_SysPenduloInvZero (SFc2_SysPenduloInvZeroInstanceStruct *chartInstance, const mxArray *c2_st); static void finalize_c2_SysPenduloInvZero(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance); static void sf_c2_SysPenduloInvZero(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance); static void initSimStructsc2_SysPenduloInvZero (SFc2_SysPenduloInvZeroInstanceStruct *chartInstance); static void init_script_number_translation(uint32_T c2_machineNumber, uint32_T c2_chartNumber); static const mxArray *c2_sf_marshallOut(void *chartInstanceVoid, void *c2_inData); static real_T c2_emlrt_marshallIn(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance, const mxArray *c2_u2, const char_T *c2_identifier); static real_T c2_b_emlrt_marshallIn(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance, const mxArray *c2_u, const emlrtMsgIdentifier *c2_parentId); static void c2_sf_marshallIn(void *chartInstanceVoid, const mxArray *c2_mxArrayInData, const char_T *c2_varName, void *c2_outData); static const mxArray *c2_b_sf_marshallOut(void *chartInstanceVoid, void *c2_inData); static void c2_c_emlrt_marshallIn(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance, const mxArray *c2_u, const emlrtMsgIdentifier *c2_parentId, real_T c2_y[4]); static void c2_b_sf_marshallIn(void *chartInstanceVoid, const mxArray *c2_mxArrayInData, const char_T *c2_varName, void *c2_outData); static const mxArray *c2_c_sf_marshallOut(void *chartInstanceVoid, void *c2_inData); static const mxArray *c2_d_sf_marshallOut(void *chartInstanceVoid, void *c2_inData); static int32_T c2_d_emlrt_marshallIn(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance, const mxArray *c2_u, const emlrtMsgIdentifier *c2_parentId); static void c2_c_sf_marshallIn(void *chartInstanceVoid, const mxArray *c2_mxArrayInData, const char_T *c2_varName, void *c2_outData); static uint8_T c2_e_emlrt_marshallIn(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance, const mxArray *c2_b_is_active_c2_SysPenduloInvZero, const char_T *c2_identifier); static uint8_T c2_f_emlrt_marshallIn(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance, const mxArray *c2_u, const emlrtMsgIdentifier *c2_parentId); static void init_dsm_address_info(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance); /* Function Definitions */ static void initialize_c2_SysPenduloInvZero(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance) { chartInstance->c2_sfEvent = CALL_EVENT; _sfTime_ = (real_T)ssGetT(chartInstance->S); chartInstance->c2_is_active_c2_SysPenduloInvZero = 0U; } static void initialize_params_c2_SysPenduloInvZero (SFc2_SysPenduloInvZeroInstanceStruct *chartInstance) { real_T c2_d0; real_T c2_dv0[4]; int32_T c2_i0; real_T c2_d1; real_T c2_d2; real_T c2_d3; real_T c2_d4; real_T c2_d5; real_T c2_d6; real_T c2_d7; real_T c2_d8; sf_set_error_prefix_string( "Error evaluating data 'F' in the parent workspace.\n"); sf_mex_import_named("F", sf_mex_get_sfun_param(chartInstance->S, 0, 0), &c2_d0, 0, 0, 0U, 0, 0U, 0); chartInstance->c2_F = c2_d0; sf_set_error_prefix_string("Stateflow Runtime Error (chart): "); sf_set_error_prefix_string( "Error evaluating data 'K' in the parent workspace.\n"); sf_mex_import_named("K", sf_mex_get_sfun_param(chartInstance->S, 2, 0), c2_dv0, 0, 0, 0U, 1, 0U, 2, 1, 4); for (c2_i0 = 0; c2_i0 < 4; c2_i0++) { chartInstance->c2_K[c2_i0] = c2_dv0[c2_i0]; } sf_set_error_prefix_string("Stateflow Runtime Error (chart): "); sf_set_error_prefix_string( "Error evaluating data 'KK' in the parent workspace.\n"); sf_mex_import_named("KK", sf_mex_get_sfun_param(chartInstance->S, 3, 0), &c2_d1, 0, 0, 0U, 0, 0U, 0); chartInstance->c2_KK = c2_d1; sf_set_error_prefix_string("Stateflow Runtime Error (chart): "); sf_set_error_prefix_string( "Error evaluating data 'th' in the parent workspace.\n"); sf_mex_import_named("th", sf_mex_get_sfun_param(chartInstance->S, 9, 0), &c2_d2, 0, 0, 0U, 0, 0U, 0); chartInstance->c2_th = c2_d2; sf_set_error_prefix_string("Stateflow Runtime Error (chart): "); sf_set_error_prefix_string( "Error evaluating data 'J' in the parent workspace.\n"); sf_mex_import_named("J", sf_mex_get_sfun_param(chartInstance->S, 1, 0), &c2_d3, 0, 0, 0U, 0, 0U, 0); chartInstance->c2_J = c2_d3; sf_set_error_prefix_string("Stateflow Runtime Error (chart): "); sf_set_error_prefix_string( "Error evaluating data 'm' in the parent workspace.\n"); sf_mex_import_named("m", sf_mex_get_sfun_param(chartInstance->S, 8, 0), &c2_d4, 0, 0, 0U, 0, 0U, 0); chartInstance->c2_m = c2_d4; sf_set_error_prefix_string("Stateflow Runtime Error (chart): "); sf_set_error_prefix_string( "Error evaluating data 'g' in the parent workspace.\n"); sf_mex_import_named("g", sf_mex_get_sfun_param(chartInstance->S, 6, 0), &c2_d5, 0, 0, 0U, 0, 0U, 0); chartInstance->c2_g = c2_d5; sf_set_error_prefix_string("Stateflow Runtime Error (chart): "); sf_set_error_prefix_string( "Error evaluating data 'l' in the parent workspace.\n"); sf_mex_import_named("l", sf_mex_get_sfun_param(chartInstance->S, 7, 0), &c2_d6, 0, 0, 0U, 0, 0U, 0); chartInstance->c2_l = c2_d6; sf_set_error_prefix_string("Stateflow Runtime Error (chart): "); sf_set_error_prefix_string( "Error evaluating data 'b1' in the parent workspace.\n"); sf_mex_import_named("b1", sf_mex_get_sfun_param(chartInstance->S, 5, 0), &c2_d7, 0, 0, 0U, 0, 0U, 0); chartInstance->c2_b1 = c2_d7; sf_set_error_prefix_string("Stateflow Runtime Error (chart): "); sf_set_error_prefix_string( "Error evaluating data 'T' in the parent workspace.\n"); sf_mex_import_named("T", sf_mex_get_sfun_param(chartInstance->S, 4, 0), &c2_d8, 0, 0, 0U, 0, 0U, 0); chartInstance->c2_T = c2_d8; sf_set_error_prefix_string("Stateflow Runtime Error (chart): "); } static void enable_c2_SysPenduloInvZero(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance) { _sfTime_ = (real_T)ssGetT(chartInstance->S); } static void disable_c2_SysPenduloInvZero(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance) { _sfTime_ = (real_T)ssGetT(chartInstance->S); } static void c2_update_debugger_state_c2_SysPenduloInvZero (SFc2_SysPenduloInvZeroInstanceStruct *chartInstance) { } static const mxArray *get_sim_state_c2_SysPenduloInvZero (SFc2_SysPenduloInvZeroInstanceStruct *chartInstance) { const mxArray *c2_st; const mxArray *c2_y = NULL; real_T c2_hoistedGlobal; real_T c2_u; const mxArray *c2_b_y = NULL; real_T c2_b_hoistedGlobal; real_T c2_b_u; const mxArray *c2_c_y = NULL; uint8_T c2_c_hoistedGlobal; uint8_T c2_c_u; const mxArray *c2_d_y = NULL; real_T *c2_d_u; real_T *c2_u2; c2_u2 = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2); c2_d_u = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); c2_st = NULL; c2_st = NULL; c2_y = NULL; sf_mex_assign(&c2_y, sf_mex_createcellarray(3), FALSE); c2_hoistedGlobal = *c2_d_u; c2_u = c2_hoistedGlobal; c2_b_y = NULL; sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_u, 0, 0U, 0U, 0U, 0), FALSE); sf_mex_setcell(c2_y, 0, c2_b_y); c2_b_hoistedGlobal = *c2_u2; c2_b_u = c2_b_hoistedGlobal; c2_c_y = NULL; sf_mex_assign(&c2_c_y, sf_mex_create("y", &c2_b_u, 0, 0U, 0U, 0U, 0), FALSE); sf_mex_setcell(c2_y, 1, c2_c_y); c2_c_hoistedGlobal = chartInstance->c2_is_active_c2_SysPenduloInvZero; c2_c_u = c2_c_hoistedGlobal; c2_d_y = NULL; sf_mex_assign(&c2_d_y, sf_mex_create("y", &c2_c_u, 3, 0U, 0U, 0U, 0), FALSE); sf_mex_setcell(c2_y, 2, c2_d_y); sf_mex_assign(&c2_st, c2_y, FALSE); return c2_st; } static void set_sim_state_c2_SysPenduloInvZero (SFc2_SysPenduloInvZeroInstanceStruct *chartInstance, const mxArray *c2_st) { const mxArray *c2_u; real_T *c2_b_u; real_T *c2_u2; c2_u2 = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2); c2_b_u = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); chartInstance->c2_doneDoubleBufferReInit = TRUE; c2_u = sf_mex_dup(c2_st); *c2_b_u = c2_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c2_u, 0)), "u"); *c2_u2 = c2_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c2_u, 1)), "u2"); chartInstance->c2_is_active_c2_SysPenduloInvZero = c2_e_emlrt_marshallIn (chartInstance, sf_mex_dup(sf_mex_getcell(c2_u, 2)), "is_active_c2_SysPenduloInvZero"); sf_mex_destroy(&c2_u); c2_update_debugger_state_c2_SysPenduloInvZero(chartInstance); sf_mex_destroy(&c2_st); } static void finalize_c2_SysPenduloInvZero(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance) { } static void sf_c2_SysPenduloInvZero(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance) { int32_T c2_i1; int32_T c2_i2; real_T c2_hoistedGlobal; real_T c2_b_hoistedGlobal; real_T c2_c_hoistedGlobal; real_T c2_d_hoistedGlobal; real_T c2_e_hoistedGlobal; real_T c2_f_hoistedGlobal; real_T c2_g_hoistedGlobal; real_T c2_h_hoistedGlobal; real_T c2_i_hoistedGlobal; real_T c2_j_hoistedGlobal; real_T c2_k_hoistedGlobal; real_T c2_r; int32_T c2_i3; real_T c2_x[4]; real_T c2_b_F; int32_T c2_i4; real_T c2_b_K[4]; real_T c2_b_KK; real_T c2_b_th; real_T c2_b_J; real_T c2_b_m; real_T c2_b_g; real_T c2_b_l; real_T c2_b_b1; real_T c2_b2; real_T c2_b_T; uint32_T c2_debug_family_var_map[17]; real_T c2_nargin = 13.0; real_T c2_nargout = 2.0; real_T c2_u; real_T c2_u2; real_T c2_a; real_T c2_b_a; real_T c2_ak; real_T c2_c; real_T c2_c_a; real_T c2_b; real_T c2_y; real_T c2_A; real_T c2_b_x; real_T c2_c_x; real_T c2_b_y; real_T c2_d_a; real_T c2_b_b; real_T c2_c_y; real_T c2_e_a; real_T c2_c_b; real_T c2_d_y; real_T c2_d_x; real_T c2_e_x; real_T c2_f_a; real_T c2_d_b; real_T c2_e_y; real_T c2_g_a; real_T c2_e_b; real_T c2_f_y; real_T c2_h_a; real_T c2_f_b; real_T c2_g_y; real_T c2_i_a; real_T c2_g_b; real_T c2_h_y; real_T c2_f_x; real_T c2_g_x; real_T c2_j_a; real_T c2_h_b; real_T c2_i_y; real_T c2_k_a; real_T c2_i_b; real_T c2_l_a; real_T c2_j_b; real_T c2_j_y; real_T c2_m_a; real_T c2_k_b; real_T c2_k_y; real_T c2_n_a; real_T c2_l_b; real_T c2_l_y; real_T c2_o_a; real_T c2_m_b; real_T c2_m_y; real_T c2_p_a; real_T c2_n_b; real_T c2_n_y; real_T *c2_b_u2; real_T *c2_b_u; real_T *c2_b_b2; real_T *c2_b_r; real_T (*c2_h_x)[4]; c2_b_u2 = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2); c2_b_b2 = (real_T *)ssGetInputPortSignal(chartInstance->S, 2); c2_h_x = (real_T (*)[4])ssGetInputPortSignal(chartInstance->S, 1); c2_b_r = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); c2_b_u = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); _sfTime_ = (real_T)ssGetT(chartInstance->S); _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 0U, chartInstance->c2_sfEvent); _SFD_DATA_RANGE_CHECK(*c2_b_u, 0U); _SFD_DATA_RANGE_CHECK(*c2_b_r, 1U); for (c2_i1 = 0; c2_i1 < 4; c2_i1++) { _SFD_DATA_RANGE_CHECK((*c2_h_x)[c2_i1], 2U); } _SFD_DATA_RANGE_CHECK(chartInstance->c2_F, 3U); for (c2_i2 = 0; c2_i2 < 4; c2_i2++) { _SFD_DATA_RANGE_CHECK(chartInstance->c2_K[c2_i2], 4U); } _SFD_DATA_RANGE_CHECK(chartInstance->c2_KK, 5U); _SFD_DATA_RANGE_CHECK(chartInstance->c2_th, 6U); _SFD_DATA_RANGE_CHECK(chartInstance->c2_J, 7U); _SFD_DATA_RANGE_CHECK(chartInstance->c2_m, 8U); _SFD_DATA_RANGE_CHECK(chartInstance->c2_g, 9U); _SFD_DATA_RANGE_CHECK(chartInstance->c2_l, 10U); _SFD_DATA_RANGE_CHECK(chartInstance->c2_b1, 11U); _SFD_DATA_RANGE_CHECK(*c2_b_b2, 12U); _SFD_DATA_RANGE_CHECK(chartInstance->c2_T, 13U); _SFD_DATA_RANGE_CHECK(*c2_b_u2, 14U); chartInstance->c2_sfEvent = CALL_EVENT; _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 0U, chartInstance->c2_sfEvent); c2_hoistedGlobal = *c2_b_r; c2_b_hoistedGlobal = chartInstance->c2_F; c2_c_hoistedGlobal = chartInstance->c2_KK; c2_d_hoistedGlobal = chartInstance->c2_th; c2_e_hoistedGlobal = chartInstance->c2_J; c2_f_hoistedGlobal = chartInstance->c2_m; c2_g_hoistedGlobal = chartInstance->c2_g; c2_h_hoistedGlobal = chartInstance->c2_l; c2_i_hoistedGlobal = chartInstance->c2_b1; c2_j_hoistedGlobal = *c2_b_b2; c2_k_hoistedGlobal = chartInstance->c2_T; c2_r = c2_hoistedGlobal; for (c2_i3 = 0; c2_i3 < 4; c2_i3++) { c2_x[c2_i3] = (*c2_h_x)[c2_i3]; } c2_b_F = c2_b_hoistedGlobal; for (c2_i4 = 0; c2_i4 < 4; c2_i4++) { c2_b_K[c2_i4] = chartInstance->c2_K[c2_i4]; } c2_b_KK = c2_c_hoistedGlobal; c2_b_th = c2_d_hoistedGlobal; c2_b_J = c2_e_hoistedGlobal; c2_b_m = c2_f_hoistedGlobal; c2_b_g = c2_g_hoistedGlobal; c2_b_l = c2_h_hoistedGlobal; c2_b_b1 = c2_i_hoistedGlobal; c2_b2 = c2_j_hoistedGlobal; c2_b_T = c2_k_hoistedGlobal; sf_debug_symbol_scope_push_eml(0U, 17U, 17U, c2_debug_family_names, c2_debug_family_var_map); sf_debug_symbol_scope_add_eml_importable(&c2_nargin, 0U, c2_sf_marshallOut, c2_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c2_nargout, 1U, c2_sf_marshallOut, c2_sf_marshallIn); sf_debug_symbol_scope_add_eml(&c2_r, 2U, c2_sf_marshallOut); sf_debug_symbol_scope_add_eml(c2_x, 3U, c2_c_sf_marshallOut); sf_debug_symbol_scope_add_eml_importable(&c2_b_F, 4U, c2_sf_marshallOut, c2_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(c2_b_K, 5U, c2_b_sf_marshallOut, c2_b_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c2_b_KK, 6U, c2_sf_marshallOut, c2_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c2_b_th, 7U, c2_sf_marshallOut, c2_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c2_b_J, 8U, c2_sf_marshallOut, c2_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c2_b_m, 9U, c2_sf_marshallOut, c2_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c2_b_g, 10U, c2_sf_marshallOut, c2_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c2_b_l, 11U, c2_sf_marshallOut, c2_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c2_b_b1, 12U, c2_sf_marshallOut, c2_sf_marshallIn); sf_debug_symbol_scope_add_eml(&c2_b2, 13U, c2_sf_marshallOut); sf_debug_symbol_scope_add_eml_importable(&c2_b_T, 14U, c2_sf_marshallOut, c2_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c2_u, 15U, c2_sf_marshallOut, c2_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c2_u2, 16U, c2_sf_marshallOut, c2_sf_marshallIn); CV_EML_FCN(0, 0); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 4); c2_u2 = 0.0; _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 5); c2_a = c2_x[3]; c2_b_a = c2_a; c2_ak = c2_b_a; c2_c = muDoubleScalarPower(c2_ak, 2.0); c2_c_a = c2_b_J; c2_b = c2_c; c2_y = c2_c_a * c2_b; c2_A = c2_y; c2_b_x = c2_A; c2_c_x = c2_b_x; c2_b_y = c2_c_x / 2.0; c2_d_a = c2_b_m; c2_b_b = c2_b_g; c2_c_y = c2_d_a * c2_b_b; c2_e_a = c2_c_y; c2_c_b = c2_b_l; c2_d_y = c2_e_a * c2_c_b; c2_d_x = c2_x[2]; c2_e_x = c2_d_x; c2_e_x = muDoubleScalarCos(c2_e_x); c2_f_a = c2_d_y; c2_d_b = 1.0 + c2_e_x; c2_e_y = c2_f_a * c2_d_b; c2_g_a = c2_b_KK; c2_e_b = c2_b_y - c2_e_y; c2_f_y = c2_g_a * c2_e_b; c2_h_a = c2_x[3]; c2_f_b = c2_b_m; c2_g_y = c2_h_a * c2_f_b; c2_i_a = c2_g_y; c2_g_b = c2_b_l; c2_h_y = c2_i_a * c2_g_b; c2_f_x = c2_x[2]; c2_g_x = c2_f_x; c2_g_x = muDoubleScalarCos(c2_g_x); c2_j_a = c2_h_y; c2_h_b = c2_g_x; c2_i_y = c2_j_a * c2_h_b; c2_k_a = c2_f_y; c2_i_b = c2_i_y; c2_u = c2_k_a * c2_i_b; _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 7); if (CV_EML_IF(0, 1, 0, c2_x[2] >= c2_b_th)) { _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 8); c2_l_a = c2_b_F; c2_j_b = c2_r; c2_j_y = c2_l_a * c2_j_b; c2_m_a = c2_b_K[0]; c2_k_b = c2_x[0]; c2_k_y = c2_m_a * c2_k_b; c2_n_a = c2_b_K[1]; c2_l_b = c2_x[1]; c2_l_y = c2_n_a * c2_l_b; c2_o_a = c2_b_K[2]; c2_m_b = c2_x[2] - 3.1415926535897931; c2_m_y = c2_o_a * c2_m_b; c2_p_a = c2_b_K[3]; c2_n_b = c2_x[3]; c2_n_y = c2_p_a * c2_n_b; c2_u = (((c2_j_y - c2_k_y) - c2_l_y) - c2_m_y) - c2_n_y; _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 9); c2_u2 = 1.0; } _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, -9); sf_debug_symbol_scope_pop(); *c2_b_u = c2_u; *c2_b_u2 = c2_u2; _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 0U, chartInstance->c2_sfEvent); sf_debug_check_for_state_inconsistency(_SysPenduloInvZeroMachineNumber_, chartInstance->chartNumber, chartInstance->instanceNumber); } static void initSimStructsc2_SysPenduloInvZero (SFc2_SysPenduloInvZeroInstanceStruct *chartInstance) { } static void init_script_number_translation(uint32_T c2_machineNumber, uint32_T c2_chartNumber) { } static const mxArray *c2_sf_marshallOut(void *chartInstanceVoid, void *c2_inData) { const mxArray *c2_mxArrayOutData = NULL; real_T c2_u; const mxArray *c2_y = NULL; SFc2_SysPenduloInvZeroInstanceStruct *chartInstance; chartInstance = (SFc2_SysPenduloInvZeroInstanceStruct *)chartInstanceVoid; c2_mxArrayOutData = NULL; c2_u = *(real_T *)c2_inData; c2_y = NULL; sf_mex_assign(&c2_y, sf_mex_create("y", &c2_u, 0, 0U, 0U, 0U, 0), FALSE); sf_mex_assign(&c2_mxArrayOutData, c2_y, FALSE); return c2_mxArrayOutData; } static real_T c2_emlrt_marshallIn(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance, const mxArray *c2_u2, const char_T *c2_identifier) { real_T c2_y; emlrtMsgIdentifier c2_thisId; c2_thisId.fIdentifier = c2_identifier; c2_thisId.fParent = NULL; c2_y = c2_b_emlrt_marshallIn(chartInstance, sf_mex_dup(c2_u2), &c2_thisId); sf_mex_destroy(&c2_u2); return c2_y; } static real_T c2_b_emlrt_marshallIn(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance, const mxArray *c2_u, const emlrtMsgIdentifier *c2_parentId) { real_T c2_y; real_T c2_d9; sf_mex_import(c2_parentId, sf_mex_dup(c2_u), &c2_d9, 1, 0, 0U, 0, 0U, 0); c2_y = c2_d9; sf_mex_destroy(&c2_u); return c2_y; } static void c2_sf_marshallIn(void *chartInstanceVoid, const mxArray *c2_mxArrayInData, const char_T *c2_varName, void *c2_outData) { const mxArray *c2_u2; const char_T *c2_identifier; emlrtMsgIdentifier c2_thisId; real_T c2_y; SFc2_SysPenduloInvZeroInstanceStruct *chartInstance; chartInstance = (SFc2_SysPenduloInvZeroInstanceStruct *)chartInstanceVoid; c2_u2 = sf_mex_dup(c2_mxArrayInData); c2_identifier = c2_varName; c2_thisId.fIdentifier = c2_identifier; c2_thisId.fParent = NULL; c2_y = c2_b_emlrt_marshallIn(chartInstance, sf_mex_dup(c2_u2), &c2_thisId); sf_mex_destroy(&c2_u2); *(real_T *)c2_outData = c2_y; sf_mex_destroy(&c2_mxArrayInData); } static const mxArray *c2_b_sf_marshallOut(void *chartInstanceVoid, void *c2_inData) { const mxArray *c2_mxArrayOutData = NULL; int32_T c2_i5; real_T c2_b_inData[4]; int32_T c2_i6; real_T c2_u[4]; const mxArray *c2_y = NULL; SFc2_SysPenduloInvZeroInstanceStruct *chartInstance; chartInstance = (SFc2_SysPenduloInvZeroInstanceStruct *)chartInstanceVoid; c2_mxArrayOutData = NULL; for (c2_i5 = 0; c2_i5 < 4; c2_i5++) { c2_b_inData[c2_i5] = (*(real_T (*)[4])c2_inData)[c2_i5]; } for (c2_i6 = 0; c2_i6 < 4; c2_i6++) { c2_u[c2_i6] = c2_b_inData[c2_i6]; } c2_y = NULL; sf_mex_assign(&c2_y, sf_mex_create("y", c2_u, 0, 0U, 1U, 0U, 2, 1, 4), FALSE); sf_mex_assign(&c2_mxArrayOutData, c2_y, FALSE); return c2_mxArrayOutData; } static void c2_c_emlrt_marshallIn(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance, const mxArray *c2_u, const emlrtMsgIdentifier *c2_parentId, real_T c2_y[4]) { real_T c2_dv1[4]; int32_T c2_i7; sf_mex_import(c2_parentId, sf_mex_dup(c2_u), c2_dv1, 1, 0, 0U, 1, 0U, 2, 1, 4); for (c2_i7 = 0; c2_i7 < 4; c2_i7++) { c2_y[c2_i7] = c2_dv1[c2_i7]; } sf_mex_destroy(&c2_u); } static void c2_b_sf_marshallIn(void *chartInstanceVoid, const mxArray *c2_mxArrayInData, const char_T *c2_varName, void *c2_outData) { const mxArray *c2_b_K; const char_T *c2_identifier; emlrtMsgIdentifier c2_thisId; real_T c2_y[4]; int32_T c2_i8; SFc2_SysPenduloInvZeroInstanceStruct *chartInstance; chartInstance = (SFc2_SysPenduloInvZeroInstanceStruct *)chartInstanceVoid; c2_b_K = sf_mex_dup(c2_mxArrayInData); c2_identifier = c2_varName; c2_thisId.fIdentifier = c2_identifier; c2_thisId.fParent = NULL; c2_c_emlrt_marshallIn(chartInstance, sf_mex_dup(c2_b_K), &c2_thisId, c2_y); sf_mex_destroy(&c2_b_K); for (c2_i8 = 0; c2_i8 < 4; c2_i8++) { (*(real_T (*)[4])c2_outData)[c2_i8] = c2_y[c2_i8]; } sf_mex_destroy(&c2_mxArrayInData); } static const mxArray *c2_c_sf_marshallOut(void *chartInstanceVoid, void *c2_inData) { const mxArray *c2_mxArrayOutData = NULL; int32_T c2_i9; real_T c2_b_inData[4]; int32_T c2_i10; real_T c2_u[4]; const mxArray *c2_y = NULL; SFc2_SysPenduloInvZeroInstanceStruct *chartInstance; chartInstance = (SFc2_SysPenduloInvZeroInstanceStruct *)chartInstanceVoid; c2_mxArrayOutData = NULL; for (c2_i9 = 0; c2_i9 < 4; c2_i9++) { c2_b_inData[c2_i9] = (*(real_T (*)[4])c2_inData)[c2_i9]; } for (c2_i10 = 0; c2_i10 < 4; c2_i10++) { c2_u[c2_i10] = c2_b_inData[c2_i10]; } c2_y = NULL; sf_mex_assign(&c2_y, sf_mex_create("y", c2_u, 0, 0U, 1U, 0U, 1, 4), FALSE); sf_mex_assign(&c2_mxArrayOutData, c2_y, FALSE); return c2_mxArrayOutData; } const mxArray *sf_c2_SysPenduloInvZero_get_eml_resolved_functions_info(void) { const mxArray *c2_nameCaptureInfo; c2_ResolvedFunctionInfo c2_info[11]; c2_ResolvedFunctionInfo (*c2_b_info)[11]; const mxArray *c2_m0 = NULL; int32_T c2_i11; c2_ResolvedFunctionInfo *c2_r0; c2_nameCaptureInfo = NULL; c2_nameCaptureInfo = NULL; c2_b_info = (c2_ResolvedFunctionInfo (*)[11])c2_info; (*c2_b_info)[0].context = ""; (*c2_b_info)[0].name = "mpower"; (*c2_b_info)[0].dominantType = "double"; (*c2_b_info)[0].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m"; (*c2_b_info)[0].fileTimeLo = 1286836842U; (*c2_b_info)[0].fileTimeHi = 0U; (*c2_b_info)[0].mFileTimeLo = 0U; (*c2_b_info)[0].mFileTimeHi = 0U; (*c2_b_info)[1].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m"; (*c2_b_info)[1].name = "power"; (*c2_b_info)[1].dominantType = "double"; (*c2_b_info)[1].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m"; (*c2_b_info)[1].fileTimeLo = 1294078744U; (*c2_b_info)[1].fileTimeHi = 0U; (*c2_b_info)[1].mFileTimeLo = 0U; (*c2_b_info)[1].mFileTimeHi = 0U; (*c2_b_info)[2].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m"; (*c2_b_info)[2].name = "eml_scalar_eg"; (*c2_b_info)[2].dominantType = "double"; (*c2_b_info)[2].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; (*c2_b_info)[2].fileTimeLo = 1286836796U; (*c2_b_info)[2].fileTimeHi = 0U; (*c2_b_info)[2].mFileTimeLo = 0U; (*c2_b_info)[2].mFileTimeHi = 0U; (*c2_b_info)[3].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m"; (*c2_b_info)[3].name = "eml_scalexp_alloc"; (*c2_b_info)[3].dominantType = "double"; (*c2_b_info)[3].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_alloc.m"; (*c2_b_info)[3].fileTimeLo = 1286836796U; (*c2_b_info)[3].fileTimeHi = 0U; (*c2_b_info)[3].mFileTimeLo = 0U; (*c2_b_info)[3].mFileTimeHi = 0U; (*c2_b_info)[4].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m"; (*c2_b_info)[4].name = "eml_scalar_floor"; (*c2_b_info)[4].dominantType = "double"; (*c2_b_info)[4].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_floor.m"; (*c2_b_info)[4].fileTimeLo = 1286836726U; (*c2_b_info)[4].fileTimeHi = 0U; (*c2_b_info)[4].mFileTimeLo = 0U; (*c2_b_info)[4].mFileTimeHi = 0U; (*c2_b_info)[5].context = ""; (*c2_b_info)[5].name = "mtimes"; (*c2_b_info)[5].dominantType = "double"; (*c2_b_info)[5].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; (*c2_b_info)[5].fileTimeLo = 1289530492U; (*c2_b_info)[5].fileTimeHi = 0U; (*c2_b_info)[5].mFileTimeLo = 0U; (*c2_b_info)[5].mFileTimeHi = 0U; (*c2_b_info)[6].context = ""; (*c2_b_info)[6].name = "mrdivide"; (*c2_b_info)[6].dominantType = "double"; (*c2_b_info)[6].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p"; (*c2_b_info)[6].fileTimeLo = 1310155456U; (*c2_b_info)[6].fileTimeHi = 0U; (*c2_b_info)[6].mFileTimeLo = 1289530492U; (*c2_b_info)[6].mFileTimeHi = 0U; (*c2_b_info)[7].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p"; (*c2_b_info)[7].name = "rdivide"; (*c2_b_info)[7].dominantType = "double"; (*c2_b_info)[7].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m"; (*c2_b_info)[7].fileTimeLo = 1286836844U; (*c2_b_info)[7].fileTimeHi = 0U; (*c2_b_info)[7].mFileTimeLo = 0U; (*c2_b_info)[7].mFileTimeHi = 0U; (*c2_b_info)[8].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m"; (*c2_b_info)[8].name = "eml_div"; (*c2_b_info)[8].dominantType = "double"; (*c2_b_info)[8].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_div.m"; (*c2_b_info)[8].fileTimeLo = 1305336000U; (*c2_b_info)[8].fileTimeHi = 0U; (*c2_b_info)[8].mFileTimeLo = 0U; (*c2_b_info)[8].mFileTimeHi = 0U; (*c2_b_info)[9].context = ""; (*c2_b_info)[9].name = "cos"; (*c2_b_info)[9].dominantType = "double"; (*c2_b_info)[9].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/cos.m"; (*c2_b_info)[9].fileTimeLo = 1286836706U; (*c2_b_info)[9].fileTimeHi = 0U; (*c2_b_info)[9].mFileTimeLo = 0U; (*c2_b_info)[9].mFileTimeHi = 0U; (*c2_b_info)[10].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/cos.m"; (*c2_b_info)[10].name = "eml_scalar_cos"; (*c2_b_info)[10].dominantType = "double"; (*c2_b_info)[10].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_cos.m"; (*c2_b_info)[10].fileTimeLo = 1286836722U; (*c2_b_info)[10].fileTimeHi = 0U; (*c2_b_info)[10].mFileTimeLo = 0U; (*c2_b_info)[10].mFileTimeHi = 0U; sf_mex_assign(&c2_m0, sf_mex_createstruct("nameCaptureInfo", 1, 11), FALSE); for (c2_i11 = 0; c2_i11 < 11; c2_i11++) { c2_r0 = &c2_info[c2_i11]; sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", c2_r0->context, 15, 0U, 0U, 0U, 2, 1, strlen(c2_r0->context)), "context", "nameCaptureInfo", c2_i11); sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", c2_r0->name, 15, 0U, 0U, 0U, 2, 1, strlen(c2_r0->name)), "name", "nameCaptureInfo", c2_i11); sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", c2_r0->dominantType, 15, 0U, 0U, 0U, 2, 1, strlen(c2_r0->dominantType)), "dominantType", "nameCaptureInfo", c2_i11); sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", c2_r0->resolved, 15, 0U, 0U, 0U, 2, 1, strlen(c2_r0->resolved)), "resolved", "nameCaptureInfo", c2_i11); sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", &c2_r0->fileTimeLo, 7, 0U, 0U, 0U, 0), "fileTimeLo", "nameCaptureInfo", c2_i11); sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", &c2_r0->fileTimeHi, 7, 0U, 0U, 0U, 0), "fileTimeHi", "nameCaptureInfo", c2_i11); sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", &c2_r0->mFileTimeLo, 7, 0U, 0U, 0U, 0), "mFileTimeLo", "nameCaptureInfo", c2_i11); sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", &c2_r0->mFileTimeHi, 7, 0U, 0U, 0U, 0), "mFileTimeHi", "nameCaptureInfo", c2_i11); } sf_mex_assign(&c2_nameCaptureInfo, c2_m0, FALSE); return c2_nameCaptureInfo; } static const mxArray *c2_d_sf_marshallOut(void *chartInstanceVoid, void *c2_inData) { const mxArray *c2_mxArrayOutData = NULL; int32_T c2_u; const mxArray *c2_y = NULL; SFc2_SysPenduloInvZeroInstanceStruct *chartInstance; chartInstance = (SFc2_SysPenduloInvZeroInstanceStruct *)chartInstanceVoid; c2_mxArrayOutData = NULL; c2_u = *(int32_T *)c2_inData; c2_y = NULL; sf_mex_assign(&c2_y, sf_mex_create("y", &c2_u, 6, 0U, 0U, 0U, 0), FALSE); sf_mex_assign(&c2_mxArrayOutData, c2_y, FALSE); return c2_mxArrayOutData; } static int32_T c2_d_emlrt_marshallIn(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance, const mxArray *c2_u, const emlrtMsgIdentifier *c2_parentId) { int32_T c2_y; int32_T c2_i12; sf_mex_import(c2_parentId, sf_mex_dup(c2_u), &c2_i12, 1, 6, 0U, 0, 0U, 0); c2_y = c2_i12; sf_mex_destroy(&c2_u); return c2_y; } static void c2_c_sf_marshallIn(void *chartInstanceVoid, const mxArray *c2_mxArrayInData, const char_T *c2_varName, void *c2_outData) { const mxArray *c2_b_sfEvent; const char_T *c2_identifier; emlrtMsgIdentifier c2_thisId; int32_T c2_y; SFc2_SysPenduloInvZeroInstanceStruct *chartInstance; chartInstance = (SFc2_SysPenduloInvZeroInstanceStruct *)chartInstanceVoid; c2_b_sfEvent = sf_mex_dup(c2_mxArrayInData); c2_identifier = c2_varName; c2_thisId.fIdentifier = c2_identifier; c2_thisId.fParent = NULL; c2_y = c2_d_emlrt_marshallIn(chartInstance, sf_mex_dup(c2_b_sfEvent), &c2_thisId); sf_mex_destroy(&c2_b_sfEvent); *(int32_T *)c2_outData = c2_y; sf_mex_destroy(&c2_mxArrayInData); } static uint8_T c2_e_emlrt_marshallIn(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance, const mxArray *c2_b_is_active_c2_SysPenduloInvZero, const char_T *c2_identifier) { uint8_T c2_y; emlrtMsgIdentifier c2_thisId; c2_thisId.fIdentifier = c2_identifier; c2_thisId.fParent = NULL; c2_y = c2_f_emlrt_marshallIn(chartInstance, sf_mex_dup (c2_b_is_active_c2_SysPenduloInvZero), &c2_thisId); sf_mex_destroy(&c2_b_is_active_c2_SysPenduloInvZero); return c2_y; } static uint8_T c2_f_emlrt_marshallIn(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance, const mxArray *c2_u, const emlrtMsgIdentifier *c2_parentId) { uint8_T c2_y; uint8_T c2_u0; sf_mex_import(c2_parentId, sf_mex_dup(c2_u), &c2_u0, 1, 3, 0U, 0, 0U, 0); c2_y = c2_u0; sf_mex_destroy(&c2_u); return c2_y; } static void init_dsm_address_info(SFc2_SysPenduloInvZeroInstanceStruct *chartInstance) { } /* SFunction Glue Code */ void sf_c2_SysPenduloInvZero_get_check_sum(mxArray *plhs[]) { ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(4171968214U); ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(375742619U); ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(649569432U); ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(2706307423U); } mxArray *sf_c2_SysPenduloInvZero_get_autoinheritance_info(void) { const char *autoinheritanceFields[] = { "checksum", "inputs", "parameters", "outputs", "locals" }; mxArray *mxAutoinheritanceInfo = mxCreateStructMatrix(1,1,5, autoinheritanceFields); { mxArray *mxChecksum = mxCreateString("pKR3YAYjZgvk9TBpwI7WCE"); mxSetField(mxAutoinheritanceInfo,0,"checksum",mxChecksum); } { const char *dataFields[] = { "size", "type", "complexity" }; mxArray *mxData = mxCreateStructMatrix(1,3,3,dataFields); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,0,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,0,"type",mxType); } mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0)); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(4); pr[1] = (double)(1); mxSetField(mxData,1,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,1,"type",mxType); } mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0)); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,2,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,2,"type",mxType); } mxSetField(mxData,2,"complexity",mxCreateDoubleScalar(0)); mxSetField(mxAutoinheritanceInfo,0,"inputs",mxData); } { const char *dataFields[] = { "size", "type", "complexity" }; mxArray *mxData = mxCreateStructMatrix(1,10,3,dataFields); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,0,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,0,"type",mxType); } mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0)); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,1,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,1,"type",mxType); } mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0)); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(4); mxSetField(mxData,2,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,2,"type",mxType); } mxSetField(mxData,2,"complexity",mxCreateDoubleScalar(0)); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,3,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,3,"type",mxType); } mxSetField(mxData,3,"complexity",mxCreateDoubleScalar(0)); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,4,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,4,"type",mxType); } mxSetField(mxData,4,"complexity",mxCreateDoubleScalar(0)); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,5,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,5,"type",mxType); } mxSetField(mxData,5,"complexity",mxCreateDoubleScalar(0)); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,6,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,6,"type",mxType); } mxSetField(mxData,6,"complexity",mxCreateDoubleScalar(0)); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,7,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,7,"type",mxType); } mxSetField(mxData,7,"complexity",mxCreateDoubleScalar(0)); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,8,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,8,"type",mxType); } mxSetField(mxData,8,"complexity",mxCreateDoubleScalar(0)); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,9,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,9,"type",mxType); } mxSetField(mxData,9,"complexity",mxCreateDoubleScalar(0)); mxSetField(mxAutoinheritanceInfo,0,"parameters",mxData); } { const char *dataFields[] = { "size", "type", "complexity" }; mxArray *mxData = mxCreateStructMatrix(1,2,3,dataFields); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,0,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,0,"type",mxType); } mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0)); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(1); pr[1] = (double)(1); mxSetField(mxData,1,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,1,"type",mxType); } mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0)); mxSetField(mxAutoinheritanceInfo,0,"outputs",mxData); } { mxSetField(mxAutoinheritanceInfo,0,"locals",mxCreateDoubleMatrix(0,0,mxREAL)); } return(mxAutoinheritanceInfo); } static const mxArray *sf_get_sim_state_info_c2_SysPenduloInvZero(void) { const char *infoFields[] = { "chartChecksum", "varInfo" }; mxArray *mxInfo = mxCreateStructMatrix(1, 1, 2, infoFields); const char *infoEncStr[] = { "100 S1x3'type','srcId','name','auxInfo'{{M[1],M[4],T\"u\",},{M[1],M[20],T\"u2\",},{M[8],M[0],T\"is_active_c2_SysPenduloInvZero\",}}" }; mxArray *mxVarInfo = sf_mex_decode_encoded_mx_struct_array(infoEncStr, 3, 10); mxArray *mxChecksum = mxCreateDoubleMatrix(1, 4, mxREAL); sf_c2_SysPenduloInvZero_get_check_sum(&mxChecksum); mxSetField(mxInfo, 0, infoFields[0], mxChecksum); mxSetField(mxInfo, 0, infoFields[1], mxVarInfo); return mxInfo; } static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc2_SysPenduloInvZeroInstanceStruct *chartInstance; chartInstance = (SFc2_SysPenduloInvZeroInstanceStruct *) ((ChartInfoStruct *) (ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (_SysPenduloInvZeroMachineNumber_, 2, 1, 1, 15, 0, 0, 0, 0, 0, &(chartInstance->chartNumber), &(chartInstance->instanceNumber), ssGetPath(S), (void *)S); if (chartAlreadyPresent==0) { /* this is the first instance */ init_script_number_translation(_SysPenduloInvZeroMachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting (_SysPenduloInvZeroMachineNumber_,chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(_SysPenduloInvZeroMachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,2,0,1,"u"); _SFD_SET_DATA_PROPS(1,1,1,0,"r"); _SFD_SET_DATA_PROPS(2,1,1,0,"x"); _SFD_SET_DATA_PROPS(3,10,0,0,"F"); _SFD_SET_DATA_PROPS(4,10,0,0,"K"); _SFD_SET_DATA_PROPS(5,10,0,0,"KK"); _SFD_SET_DATA_PROPS(6,10,0,0,"th"); _SFD_SET_DATA_PROPS(7,10,0,0,"J"); _SFD_SET_DATA_PROPS(8,10,0,0,"m"); _SFD_SET_DATA_PROPS(9,10,0,0,"g"); _SFD_SET_DATA_PROPS(10,10,0,0,"l"); _SFD_SET_DATA_PROPS(11,10,0,0,"b1"); _SFD_SET_DATA_PROPS(12,1,1,0,"b2"); _SFD_SET_DATA_PROPS(13,10,0,0,"T"); _SFD_SET_DATA_PROPS(14,2,0,1,"u2"); _SFD_STATE_INFO(0,0,2); _SFD_CH_SUBSTATE_COUNT(0); _SFD_CH_SUBSTATE_DECOMP(0); } _SFD_CV_INIT_CHART(0,0,0,0); { _SFD_CV_INIT_STATE(0,0,0,0,0,0,NULL,NULL); } _SFD_CV_INIT_TRANS(0,0,NULL,NULL,0,NULL); /* Initialization of MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,1,1,0,0,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,231); _SFD_CV_INIT_EML_IF(0,1,0,140,151,-1,231); _SFD_TRANS_COV_WTS(0,0,0,1,0); if (chartAlreadyPresent==0) { _SFD_TRANS_COV_MAPS(0, 0,NULL,NULL, 0,NULL,NULL, 1,NULL,NULL, 0,NULL,NULL); } _SFD_SET_DATA_COMPILED_PROPS(0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c2_sf_marshallOut,(MexInFcnForType)c2_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c2_sf_marshallOut,(MexInFcnForType)NULL); { unsigned int dimVector[1]; dimVector[0]= 4; _SFD_SET_DATA_COMPILED_PROPS(2,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c2_c_sf_marshallOut,(MexInFcnForType)NULL); } _SFD_SET_DATA_COMPILED_PROPS(3,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c2_sf_marshallOut,(MexInFcnForType)c2_sf_marshallIn); { unsigned int dimVector[2]; dimVector[0]= 1; dimVector[1]= 4; _SFD_SET_DATA_COMPILED_PROPS(4,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c2_b_sf_marshallOut,(MexInFcnForType) c2_b_sf_marshallIn); } _SFD_SET_DATA_COMPILED_PROPS(5,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c2_sf_marshallOut,(MexInFcnForType)c2_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(6,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c2_sf_marshallOut,(MexInFcnForType)c2_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(7,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c2_sf_marshallOut,(MexInFcnForType)c2_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(8,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c2_sf_marshallOut,(MexInFcnForType)c2_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(9,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c2_sf_marshallOut,(MexInFcnForType)c2_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(10,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c2_sf_marshallOut,(MexInFcnForType)c2_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(11,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c2_sf_marshallOut,(MexInFcnForType)c2_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(12,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c2_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(13,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c2_sf_marshallOut,(MexInFcnForType)c2_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(14,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c2_sf_marshallOut,(MexInFcnForType)c2_sf_marshallIn); { real_T *c2_u; real_T *c2_r; real_T *c2_b2; real_T *c2_u2; real_T (*c2_x)[4]; c2_u2 = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2); c2_b2 = (real_T *)ssGetInputPortSignal(chartInstance->S, 2); c2_x = (real_T (*)[4])ssGetInputPortSignal(chartInstance->S, 1); c2_r = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); c2_u = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); _SFD_SET_DATA_VALUE_PTR(0U, c2_u); _SFD_SET_DATA_VALUE_PTR(1U, c2_r); _SFD_SET_DATA_VALUE_PTR(2U, *c2_x); _SFD_SET_DATA_VALUE_PTR(3U, &chartInstance->c2_F); _SFD_SET_DATA_VALUE_PTR(4U, chartInstance->c2_K); _SFD_SET_DATA_VALUE_PTR(5U, &chartInstance->c2_KK); _SFD_SET_DATA_VALUE_PTR(6U, &chartInstance->c2_th); _SFD_SET_DATA_VALUE_PTR(7U, &chartInstance->c2_J); _SFD_SET_DATA_VALUE_PTR(8U, &chartInstance->c2_m); _SFD_SET_DATA_VALUE_PTR(9U, &chartInstance->c2_g); _SFD_SET_DATA_VALUE_PTR(10U, &chartInstance->c2_l); _SFD_SET_DATA_VALUE_PTR(11U, &chartInstance->c2_b1); _SFD_SET_DATA_VALUE_PTR(12U, c2_b2); _SFD_SET_DATA_VALUE_PTR(13U, &chartInstance->c2_T); _SFD_SET_DATA_VALUE_PTR(14U, c2_u2); } } } else { sf_debug_reset_current_state_configuration (_SysPenduloInvZeroMachineNumber_,chartInstance->chartNumber, chartInstance->instanceNumber); } } } static void sf_opaque_initialize_c2_SysPenduloInvZero(void *chartInstanceVar) { chart_debug_initialization(((SFc2_SysPenduloInvZeroInstanceStruct*) chartInstanceVar)->S,0); initialize_params_c2_SysPenduloInvZero((SFc2_SysPenduloInvZeroInstanceStruct*) chartInstanceVar); initialize_c2_SysPenduloInvZero((SFc2_SysPenduloInvZeroInstanceStruct*) chartInstanceVar); } static void sf_opaque_enable_c2_SysPenduloInvZero(void *chartInstanceVar) { enable_c2_SysPenduloInvZero((SFc2_SysPenduloInvZeroInstanceStruct*) chartInstanceVar); } static void sf_opaque_disable_c2_SysPenduloInvZero(void *chartInstanceVar) { disable_c2_SysPenduloInvZero((SFc2_SysPenduloInvZeroInstanceStruct*) chartInstanceVar); } static void sf_opaque_gateway_c2_SysPenduloInvZero(void *chartInstanceVar) { sf_c2_SysPenduloInvZero((SFc2_SysPenduloInvZeroInstanceStruct*) chartInstanceVar); } extern const mxArray* sf_internal_get_sim_state_c2_SysPenduloInvZero(SimStruct* S) { ChartInfoStruct *chartInfo = (ChartInfoStruct*) ssGetUserData(S); mxArray *plhs[1] = { NULL }; mxArray *prhs[4]; int mxError = 0; prhs[0] = mxCreateString("chart_simctx_raw2high"); prhs[1] = mxCreateDoubleScalar(ssGetSFuncBlockHandle(S)); prhs[2] = (mxArray*) get_sim_state_c2_SysPenduloInvZero ((SFc2_SysPenduloInvZeroInstanceStruct*)chartInfo->chartInstance);/* raw sim ctx */ prhs[3] = (mxArray*) sf_get_sim_state_info_c2_SysPenduloInvZero();/* state var info */ mxError = sf_mex_call_matlab(1, plhs, 4, prhs, "sfprivate"); mxDestroyArray(prhs[0]); mxDestroyArray(prhs[1]); mxDestroyArray(prhs[2]); mxDestroyArray(prhs[3]); if (mxError || plhs[0] == NULL) { sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_raw2high'.\n"); } return plhs[0]; } extern void sf_internal_set_sim_state_c2_SysPenduloInvZero(SimStruct* S, const mxArray *st) { ChartInfoStruct *chartInfo = (ChartInfoStruct*) ssGetUserData(S); mxArray *plhs[1] = { NULL }; mxArray *prhs[4]; int mxError = 0; prhs[0] = mxCreateString("chart_simctx_high2raw"); prhs[1] = mxCreateDoubleScalar(ssGetSFuncBlockHandle(S)); prhs[2] = mxDuplicateArray(st); /* high level simctx */ prhs[3] = (mxArray*) sf_get_sim_state_info_c2_SysPenduloInvZero();/* state var info */ mxError = sf_mex_call_matlab(1, plhs, 4, prhs, "sfprivate"); mxDestroyArray(prhs[0]); mxDestroyArray(prhs[1]); mxDestroyArray(prhs[2]); mxDestroyArray(prhs[3]); if (mxError || plhs[0] == NULL) { sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_high2raw'.\n"); } set_sim_state_c2_SysPenduloInvZero((SFc2_SysPenduloInvZeroInstanceStruct*) chartInfo->chartInstance, mxDuplicateArray(plhs[0])); mxDestroyArray(plhs[0]); } static const mxArray* sf_opaque_get_sim_state_c2_SysPenduloInvZero(SimStruct* S) { return sf_internal_get_sim_state_c2_SysPenduloInvZero(S); } static void sf_opaque_set_sim_state_c2_SysPenduloInvZero(SimStruct* S, const mxArray *st) { sf_internal_set_sim_state_c2_SysPenduloInvZero(S, st); } static void sf_opaque_terminate_c2_SysPenduloInvZero(void *chartInstanceVar) { if (chartInstanceVar!=NULL) { SimStruct *S = ((SFc2_SysPenduloInvZeroInstanceStruct*) chartInstanceVar)->S; if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) { sf_clear_rtw_identifier(S); } finalize_c2_SysPenduloInvZero((SFc2_SysPenduloInvZeroInstanceStruct*) chartInstanceVar); free((void *)chartInstanceVar); ssSetUserData(S,NULL); } unload_SysPenduloInvZero_optimization_info(); } static void sf_opaque_init_subchart_simstructs(void *chartInstanceVar) { initSimStructsc2_SysPenduloInvZero((SFc2_SysPenduloInvZeroInstanceStruct*) chartInstanceVar); } extern unsigned int sf_machine_global_initializer_called(void); static void mdlProcessParameters_c2_SysPenduloInvZero(SimStruct *S) { int i; for (i=0;i<ssGetNumRunTimeParams(S);i++) { if (ssGetSFcnParamTunable(S,i)) { ssUpdateDlgParamAsRunTimeParam(S,i); } } if (sf_machine_global_initializer_called()) { initialize_params_c2_SysPenduloInvZero((SFc2_SysPenduloInvZeroInstanceStruct*) (((ChartInfoStruct *)ssGetUserData(S))->chartInstance)); } } static void mdlSetWorkWidths_c2_SysPenduloInvZero(SimStruct *S) { /* Actual parameters from chart: F J K KK T b1 g l m th */ const char_T *rtParamNames[] = { "p1", "p2", "p3", "p4", "p5", "p6", "p7", "p8", "p9", "p10" }; ssSetNumRunTimeParams(S,ssGetSFcnParamsCount(S)); /* registration for F*/ ssRegDlgParamAsRunTimeParam(S, 0, 0, rtParamNames[0], SS_DOUBLE); /* registration for J*/ ssRegDlgParamAsRunTimeParam(S, 1, 1, rtParamNames[1], SS_DOUBLE); /* registration for K*/ ssRegDlgParamAsRunTimeParam(S, 2, 2, rtParamNames[2], SS_DOUBLE); /* registration for KK*/ ssRegDlgParamAsRunTimeParam(S, 3, 3, rtParamNames[3], SS_DOUBLE); /* registration for T*/ ssRegDlgParamAsRunTimeParam(S, 4, 4, rtParamNames[4], SS_DOUBLE); /* registration for b1*/ ssRegDlgParamAsRunTimeParam(S, 5, 5, rtParamNames[5], SS_DOUBLE); /* registration for g*/ ssRegDlgParamAsRunTimeParam(S, 6, 6, rtParamNames[6], SS_DOUBLE); /* registration for l*/ ssRegDlgParamAsRunTimeParam(S, 7, 7, rtParamNames[7], SS_DOUBLE); /* registration for m*/ ssRegDlgParamAsRunTimeParam(S, 8, 8, rtParamNames[8], SS_DOUBLE); /* registration for th*/ ssRegDlgParamAsRunTimeParam(S, 9, 9, rtParamNames[9], SS_DOUBLE); if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) { mxArray *infoStruct = load_SysPenduloInvZero_optimization_info(); int_T chartIsInlinable = (int_T)sf_is_chart_inlinable(S,infoStruct,2); ssSetStateflowIsInlinable(S,chartIsInlinable); ssSetRTWCG(S,sf_rtw_info_uint_prop(S,infoStruct,2,"RTWCG")); ssSetEnableFcnIsTrivial(S,1); ssSetDisableFcnIsTrivial(S,1); ssSetNotMultipleInlinable(S,sf_rtw_info_uint_prop(S,infoStruct,2, "gatewayCannotBeInlinedMultipleTimes")); if (chartIsInlinable) { ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL); ssSetInputPortOptimOpts(S, 1, SS_REUSABLE_AND_LOCAL); ssSetInputPortOptimOpts(S, 2, SS_REUSABLE_AND_LOCAL); sf_mark_chart_expressionable_inputs(S,infoStruct,2,3); sf_mark_chart_reusable_outputs(S,infoStruct,2,2); } sf_set_rtw_dwork_info(S,infoStruct,2); ssSetHasSubFunctions(S,!(chartIsInlinable)); } else { } ssSetOptions(S,ssGetOptions(S)|SS_OPTION_WORKS_WITH_CODE_REUSE); ssSetChecksum0(S,(3297604104U)); ssSetChecksum1(S,(1424046542U)); ssSetChecksum2(S,(926056702U)); ssSetChecksum3(S,(2002571367U)); ssSetmdlDerivatives(S, NULL); ssSetExplicitFCSSCtrl(S,1); } static void mdlRTW_c2_SysPenduloInvZero(SimStruct *S) { if (sim_mode_is_rtw_gen(S)) { ssWriteRTWStrParam(S, "StateflowChartType", "Embedded MATLAB"); } } static void mdlStart_c2_SysPenduloInvZero(SimStruct *S) { SFc2_SysPenduloInvZeroInstanceStruct *chartInstance; chartInstance = (SFc2_SysPenduloInvZeroInstanceStruct *)malloc(sizeof (SFc2_SysPenduloInvZeroInstanceStruct)); memset(chartInstance, 0, sizeof(SFc2_SysPenduloInvZeroInstanceStruct)); if (chartInstance==NULL) { sf_mex_error_message("Could not allocate memory for chart instance."); } chartInstance->chartInfo.chartInstance = chartInstance; chartInstance->chartInfo.isEMLChart = 1; chartInstance->chartInfo.chartInitialized = 0; chartInstance->chartInfo.sFunctionGateway = sf_opaque_gateway_c2_SysPenduloInvZero; chartInstance->chartInfo.initializeChart = sf_opaque_initialize_c2_SysPenduloInvZero; chartInstance->chartInfo.terminateChart = sf_opaque_terminate_c2_SysPenduloInvZero; chartInstance->chartInfo.enableChart = sf_opaque_enable_c2_SysPenduloInvZero; chartInstance->chartInfo.disableChart = sf_opaque_disable_c2_SysPenduloInvZero; chartInstance->chartInfo.getSimState = sf_opaque_get_sim_state_c2_SysPenduloInvZero; chartInstance->chartInfo.setSimState = sf_opaque_set_sim_state_c2_SysPenduloInvZero; chartInstance->chartInfo.getSimStateInfo = sf_get_sim_state_info_c2_SysPenduloInvZero; chartInstance->chartInfo.zeroCrossings = NULL; chartInstance->chartInfo.outputs = NULL; chartInstance->chartInfo.derivatives = NULL; chartInstance->chartInfo.mdlRTW = mdlRTW_c2_SysPenduloInvZero; chartInstance->chartInfo.mdlStart = mdlStart_c2_SysPenduloInvZero; chartInstance->chartInfo.mdlSetWorkWidths = mdlSetWorkWidths_c2_SysPenduloInvZero; chartInstance->chartInfo.extModeExec = NULL; chartInstance->chartInfo.restoreLastMajorStepConfiguration = NULL; chartInstance->chartInfo.restoreBeforeLastMajorStepConfiguration = NULL; chartInstance->chartInfo.storeCurrentConfiguration = NULL; chartInstance->S = S; ssSetUserData(S,(void *)(&(chartInstance->chartInfo)));/* register the chart instance with simstruct */ init_dsm_address_info(chartInstance); if (!sim_mode_is_rtw_gen(S)) { } sf_opaque_init_subchart_simstructs(chartInstance->chartInfo.chartInstance); chart_debug_initialization(S,1); } void c2_SysPenduloInvZero_method_dispatcher(SimStruct *S, int_T method, void *data) { switch (method) { case SS_CALL_MDL_START: mdlStart_c2_SysPenduloInvZero(S); break; case SS_CALL_MDL_SET_WORK_WIDTHS: mdlSetWorkWidths_c2_SysPenduloInvZero(S); break; case SS_CALL_MDL_PROCESS_PARAMETERS: mdlProcessParameters_c2_SysPenduloInvZero(S); break; default: /* Unhandled method */ sf_mex_error_message("Stateflow Internal Error:\n" "Error calling c2_SysPenduloInvZero_method_dispatcher.\n" "Can't handle method %d.\n", method); break; } } 5 - Lyapunov e Energia/Parte 1/slprj/_sfprj/SysPenduloInvZero/_self/sfun/src/c2_SysPenduloInvZero.h #ifndef __c2_SysPenduloInvZero_h__ #define __c2_SysPenduloInvZero_h__ /* Include files */ #include "sfc_sf.h" #include "sfc_mex.h" #include "rtwtypes.h" /* Type Definitions */ typedef struct { const char * context; const char * name; const char * dominantType; const char * resolved; uint32_T fileTimeLo; uint32_T fileTimeHi; uint32_T mFileTimeLo; uint32_T mFileTimeHi; } c2_ResolvedFunctionInfo; typedef struct { real_T c2_F; real_T c2_J; real_T c2_K[4]; real_T c2_KK; real_T c2_T; real_T c2_b1; real_T c2_g; real_T c2_l; real_T c2_m; real_T c2_th; SimStruct *S; int32_T c2_sfEvent; uint32_T chartNumber; uint32_T instanceNumber; boolean_T c2_doneDoubleBufferReInit; boolean_T c2_isStable; uint8_T c2_is_active_c2_SysPenduloInvZero; ChartInfoStruct chartInfo; } SFc2_SysPenduloInvZeroInstanceStruct; /* Named Constants */ /* Variable Declarations */ /* Variable Definitions */ /* Function Declarations */ extern const mxArray *sf_c2_SysPenduloInvZero_get_eml_resolved_functions_info (void); /* Function Definitions */ extern void sf_c2_SysPenduloInvZero_get_check_sum(mxArray *plhs[]); extern void c2_SysPenduloInvZero_method_dispatcher(SimStruct *S, int_T method, void *data); #endif 5 - Lyapunov e Energia/Parte 1/slprj/_sfprj/SysPenduloInvZero/_self/sfun/src/c2_SysPenduloInvZero.obj 5 - Lyapunov e Energia/Parte 1/slprj/_sfprj/SysPenduloInvZero/_self/sfun/src/lccstub.obj 5 - Lyapunov e Energia/Parte 1/slprj/_sfprj/SysPenduloInvZero/_self/sfun/src/rtwtypes.h #ifndef __RTWTYPES_H__ #define __RTWTYPES_H__ #include "tmwtypes.h" /* This ID is used to detect inclusion of an incompatible rtwtypes.h */ #define RTWTYPES_ID_C08S16I32L32N32F1 #include "simstruc_types.h" #ifndef POINTER_T # define POINTER_T typedef void * pointer_T; #endif #ifndef TRUE # define TRUE (1U) #endif #ifndef FALSE # define FALSE (0U) #endif #ifndef MAT_FILE # define MAT_FILE 0 #endif /* * MultiWord supporting definitions */ typedef long int long_T; /* * MultiWord types */ typedef struct { uint32_T chunks[2]; } int64m_T; typedef struct { int64m_T re; int64m_T im; } cint64m_T; typedef struct { uint32_T chunks[2]; } uint64m_T; typedef struct { uint64m_T re; uint64m_T im; } cuint64m_T; typedef struct { uint32_T chunks[3]; } int96m_T; typedef struct { int96m_T re; int96m_T im; } cint96m_T; typedef struct { uint32_T chunks[3]; } uint96m_T; typedef struct { uint96m_T re; uint96m_T im; } cuint96m_T; typedef struct { uint32_T chunks[4]; } int128m_T; typedef struct { int128m_T re; int128m_T im; } cint128m_T; typedef struct { uint32_T chunks[4]; } uint128m_T; typedef struct { uint128m_T re; uint128m_T im; } cuint128m_T; typedef struct { uint32_T chunks[5]; } int160m_T; typedef struct { int160m_T re; int160m_T im; } cint160m_T; typedef struct { uint32_T chunks[5]; } uint160m_T; typedef struct { uint160m_T re; uint160m_T im; } cuint160m_T; typedef struct { uint32_T chunks[6]; } int192m_T; typedef struct { int192m_T re; int192m_T im; } cint192m_T; typedef struct { uint32_T chunks[6]; } uint192m_T; typedef struct { uint192m_T re; uint192m_T im; } cuint192m_T; typedef struct { uint32_T chunks[7]; } int224m_T; typedef struct { int224m_T re; int224m_T im; } cint224m_T; typedef struct { uint32_T chunks[7]; } uint224m_T; typedef struct { uint224m_T re; uint224m_T im; } cuint224m_T; typedef struct { uint32_T chunks[8]; } int256m_T; typedef struct { int256m_T re; int256m_T im; } cint256m_T; typedef struct { uint32_T chunks[8]; } uint256m_T; typedef struct { uint256m_T re; uint256m_T im; } cuint256m_T; typedef struct { uint32_T chunks[9]; } int288m_T; typedef struct { int288m_T re; int288m_T im; } cint288m_T; typedef struct { uint32_T chunks[9]; } uint288m_T; typedef struct { uint288m_T re; uint288m_T im; } cuint288m_T; typedef struct { uint32_T chunks[10]; } int320m_T; typedef struct { int320m_T re; int320m_T im; } cint320m_T; typedef struct { uint32_T chunks[10]; } uint320m_T; typedef struct { uint320m_T re; uint320m_T im; } cuint320m_T; typedef struct { uint32_T chunks[11]; } int352m_T; typedef struct { int352m_T re; int352m_T im; } cint352m_T; typedef struct { uint32_T chunks[11]; } uint352m_T; typedef struct { uint352m_T re; uint352m_T im; } cuint352m_T; typedef struct { uint32_T chunks[12]; } int384m_T; typedef struct { int384m_T re; int384m_T im; } cint384m_T; typedef struct { uint32_T chunks[12]; } uint384m_T; typedef struct { uint384m_T re; uint384m_T im; } cuint384m_T; typedef struct { uint32_T chunks[13]; } int416m_T; typedef struct { int416m_T re; int416m_T im; } cint416m_T; typedef struct { uint32_T chunks[13]; } uint416m_T; typedef struct { uint416m_T re; uint416m_T im; } cuint416m_T; typedef struct { uint32_T chunks[14]; } int448m_T; typedef struct { int448m_T re; int448m_T im; } cint448m_T; typedef struct { uint32_T chunks[14]; } uint448m_T; typedef struct { uint448m_T re; uint448m_T im; } cuint448m_T; typedef struct { uint32_T chunks[15]; } int480m_T; typedef struct { int480m_T re; int480m_T im; } cint480m_T; typedef struct { uint32_T chunks[15]; } uint480m_T; typedef struct { uint480m_T re; uint480m_T im; } cuint480m_T; typedef struct { uint32_T chunks[16]; } int512m_T; typedef struct { int512m_T re; int512m_T im; } cint512m_T; typedef struct { uint32_T chunks[16]; } uint512m_T; typedef struct { uint512m_T re; uint512m_T im; } cuint512m_T; typedef struct { uint32_T chunks[17]; } int544m_T; typedef struct { int544m_T re; int544m_T im; } cint544m_T; typedef struct { uint32_T chunks[17]; } uint544m_T; typedef struct { uint544m_T re; uint544m_T im; } cuint544m_T; typedef struct { uint32_T chunks[18]; } int576m_T; typedef struct { int576m_T re; int576m_T im; } cint576m_T; typedef struct { uint32_T chunks[18]; } uint576m_T; typedef struct { uint576m_T re; uint576m_T im; } cuint576m_T; typedef struct { uint32_T chunks[19]; } int608m_T; typedef struct { int608m_T re; int608m_T im; } cint608m_T; typedef struct { uint32_T chunks[19]; } uint608m_T; typedef struct { uint608m_T re; uint608m_T im; } cuint608m_T; typedef struct { uint32_T chunks[20]; } int640m_T; typedef struct { int640m_T re; int640m_T im; } cint640m_T; typedef struct { uint32_T chunks[20]; } uint640m_T; typedef struct { uint640m_T re; uint640m_T im; } cuint640m_T; typedef struct { uint32_T chunks[21]; } int672m_T; typedef struct { int672m_T re; int672m_T im; } cint672m_T; typedef struct { uint32_T chunks[21]; } uint672m_T; typedef struct { uint672m_T re; uint672m_T im; } cuint672m_T; typedef struct { uint32_T chunks[22]; } int704m_T; typedef struct { int704m_T re; int704m_T im; } cint704m_T; typedef struct { uint32_T chunks[22]; } uint704m_T; typedef struct { uint704m_T re; uint704m_T im; } cuint704m_T; typedef struct { uint32_T chunks[23]; } int736m_T; typedef struct { int736m_T re; int736m_T im; } cint736m_T; typedef struct { uint32_T chunks[23]; } uint736m_T; typedef struct { uint736m_T re; uint736m_T im; } cuint736m_T; typedef struct { uint32_T chunks[24]; } int768m_T; typedef struct { int768m_T re; int768m_T im; } cint768m_T; typedef struct { uint32_T chunks[24]; } uint768m_T; typedef struct { uint768m_T re; uint768m_T im; } cuint768m_T; typedef struct { uint32_T chunks[25]; } int800m_T; typedef struct { int800m_T re; int800m_T im; } cint800m_T; typedef struct { uint32_T chunks[25]; } uint800m_T; typedef struct { uint800m_T re; uint800m_T im; } cuint800m_T; typedef struct { uint32_T chunks[26]; } int832m_T; typedef struct { int832m_T re; int832m_T im; } cint832m_T; typedef struct { uint32_T chunks[26]; } uint832m_T; typedef struct { uint832m_T re; uint832m_T im; } cuint832m_T; typedef struct { uint32_T chunks[27]; } int864m_T; typedef struct { int864m_T re; int864m_T im; } cint864m_T; typedef struct { uint32_T chunks[27]; } uint864m_T; typedef struct { uint864m_T re; uint864m_T im; } cuint864m_T; typedef struct { uint32_T chunks[28]; } int896m_T; typedef struct { int896m_T re; int896m_T im; } cint896m_T; typedef struct { uint32_T chunks[28]; } uint896m_T; typedef struct { uint896m_T re; uint896m_T im; } cuint896m_T; typedef struct { uint32_T chunks[29]; } int928m_T; typedef struct { int928m_T re; int928m_T im; } cint928m_T; typedef struct { uint32_T chunks[29]; } uint928m_T; typedef struct { uint928m_T re; uint928m_T im; } cuint928m_T; typedef struct { uint32_T chunks[30]; } int960m_T; typedef struct { int960m_T re; int960m_T im; } cint960m_T; typedef struct { uint32_T chunks[30]; } uint960m_T; typedef struct { uint960m_T re; uint960m_T im; } cuint960m_T; typedef struct { uint32_T chunks[31]; } int992m_T; typedef struct { int992m_T re; int992m_T im; } cint992m_T; typedef struct { uint32_T chunks[31]; } uint992m_T; typedef struct { uint992m_T re; uint992m_T im; } cuint992m_T; typedef struct { uint32_T chunks[32]; } int1024m_T; typedef struct { int1024m_T re; int1024m_T im; } cint1024m_T; typedef struct { uint32_T chunks[32]; } uint1024m_T; typedef struct { uint1024m_T re; uint1024m_T im; } cuint1024m_T; #endif /* __RTWTYPES_H__ */ 5 - Lyapunov e Energia/Parte 1/slprj/_sfprj/SysPenduloInvZero/_self/sfun/src/rtwtypeschksum.mat 5 - Lyapunov e Energia/Parte 1/slprj/_sfprj/SysPenduloInvZero/_self/sfun/src/SysPenduloInvZero_sfun.bat "C:\Program Files\MATLAB\R2011b\sys\lcc\bin\lccmake" -f SysPenduloInvZero_sfun.lmk 5 - Lyapunov e Energia/Parte 1/slprj/_sfprj/SysPenduloInvZero/_self/sfun/src/SysPenduloInvZero_sfun.c /* Include files */ #include "SysPenduloInvZero_sfun.h" #include "c2_SysPenduloInvZero.h" /* Type Definitions */ /* Named Constants */ /* Variable Declarations */ /* Variable Definitions */ uint32_T _SysPenduloInvZeroMachineNumber_; real_T _sfTime_; /* Function Declarations */ /* Function Definitions */ void SysPenduloInvZero_initializer(void) { } void SysPenduloInvZero_terminator(void) { }
Compartilhar