/*
 * VFControl.h
 *
 * Academic License - for use in teaching, academic research, and meeting
 * course requirements at degree granting institutions only.  Not for
 * government, commercial, or other organizational use.
 *
 * Code generation for model "VFControl".
 *
 * Model version              : 1.1
 * Simulink Coder version : 24.1 (R2024a) 19-Nov-2023
 * C++ source code generated on : Wed Oct 16 11:33:22 2024
 *
 * Target selection: speedgoat.tlc
 * Note: GRT includes extra infrastructure and instrumentation for prototyping
 * Embedded hardware selection: Intel->x86-64 (Linux 64)
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#ifndef VFControl_h_
#define VFControl_h_
#include "rtwtypes.h"
#include "simstruc.h"
#include "fixedpoint.h"
#include "sg_fpga_io30x_setup_util.h"
#include "sg_fpga_io31x_io32x_setup_util.h"
#include "sg_fpga_io33x_setup_util.h"
#include "sg_fpga_io36x_setup_util.h"
#include "sg_fpga_io39x_setup_util.h"
#include "sg_fpga_io3xx_scatter_gather_dma.h"
#include "sg_common.h"
#include "sg_printf.h"
#include "VFControl_types.h"
#include "PWMGenerator.h"
#include <stddef.h>
#include "rtGetNaN.h"
#include <cstring>
#include "VFControl_cal.h"

extern "C"
{

#include "rt_nonfinite.h"

}

/* Macros for accessing real-time model data structure */
#ifndef rtmGetContTimeOutputInconsistentWithStateAtMajorStepFlag
#define rtmGetContTimeOutputInconsistentWithStateAtMajorStepFlag(rtm) ((rtm)->CTOutputIncnstWithState)
#endif

#ifndef rtmSetContTimeOutputInconsistentWithStateAtMajorStepFlag
#define rtmSetContTimeOutputInconsistentWithStateAtMajorStepFlag(rtm, val) ((rtm)->CTOutputIncnstWithState = (val))
#endif

#ifndef rtmGetDerivCacheNeedsReset
#define rtmGetDerivCacheNeedsReset(rtm) ((rtm)->derivCacheNeedsReset)
#endif

#ifndef rtmSetDerivCacheNeedsReset
#define rtmSetDerivCacheNeedsReset(rtm, val) ((rtm)->derivCacheNeedsReset = (val))
#endif

#ifndef rtmGetFinalTime
#define rtmGetFinalTime(rtm)           ((rtm)->Timing.tFinal)
#endif

#ifndef rtmGetSampleHitArray
#define rtmGetSampleHitArray(rtm)      ((rtm)->Timing.sampleHitArray)
#endif

#ifndef rtmGetStepSize
#define rtmGetStepSize(rtm)            ((rtm)->Timing.stepSize)
#endif

#ifndef rtmGetZCCacheNeedsReset
#define rtmGetZCCacheNeedsReset(rtm)   ((rtm)->zCCacheNeedsReset)
#endif

#ifndef rtmSetZCCacheNeedsReset
#define rtmSetZCCacheNeedsReset(rtm, val) ((rtm)->zCCacheNeedsReset = (val))
#endif

#ifndef rtmGet_TimeOfLastOutput
#define rtmGet_TimeOfLastOutput(rtm)   ((rtm)->Timing.timeOfLastOutput)
#endif

#ifndef rtmCounterLimit
#define rtmCounterLimit(rtm, idx)      ((rtm)->Timing.TaskCounters.cLimit[(idx)])
#endif

#ifndef rtmGetErrorStatus
#define rtmGetErrorStatus(rtm)         ((rtm)->errorStatus)
#endif

#ifndef rtmSetErrorStatus
#define rtmSetErrorStatus(rtm, val)    ((rtm)->errorStatus = (val))
#endif

#ifndef rtmGetErrorStatusPointer
#define rtmGetErrorStatusPointer(rtm)  ((const char_T **)(&((rtm)->errorStatus)))
#endif

#ifndef rtmStepTask
#define rtmStepTask(rtm, idx)          ((rtm)->Timing.TaskCounters.TID[(idx)] == 0)
#endif

#ifndef rtmGetStopRequested
#define rtmGetStopRequested(rtm)       ((rtm)->Timing.stopRequestedFlag)
#endif

#ifndef rtmSetStopRequested
#define rtmSetStopRequested(rtm, val)  ((rtm)->Timing.stopRequestedFlag = (val))
#endif

#ifndef rtmGetStopRequestedPtr
#define rtmGetStopRequestedPtr(rtm)    (&((rtm)->Timing.stopRequestedFlag))
#endif

#ifndef rtmGetT
#define rtmGetT(rtm)                   (rtmGetTPtr((rtm))[0])
#endif

#ifndef rtmGetTFinal
#define rtmGetTFinal(rtm)              ((rtm)->Timing.tFinal)
#endif

#ifndef rtmGetTPtr
#define rtmGetTPtr(rtm)                ((rtm)->Timing.t)
#endif

#ifndef rtmGetTStart
#define rtmGetTStart(rtm)              ((rtm)->Timing.tStart)
#endif

#ifndef rtmTaskCounter
#define rtmTaskCounter(rtm, idx)       ((rtm)->Timing.TaskCounters.TID[(idx)])
#endif

#ifndef rtmGetTimeOfLastOutput
#define rtmGetTimeOfLastOutput(rtm)    ((rtm)->Timing.timeOfLastOutput)
#endif

/* Block signals (default storage) */
struct B_VFControl_T {
  real_T xk1[4];                       /* '<S23>/fluxes' */
  real_T Gain[4];                      /* '<S21>/Gain' */
  real_T fluxes[4];                    /* '<S21>/fluxes' */
  real_T Sum2[4];                      /* '<S21>/Sum2' */
  real_T Linv[16];                     /* '<S16>/Switch' */
  real_T Product3[4];                  /* '<S16>/Product3' */
  real_T Rotoranglethetam;             /* '<S15>/Rotor angle thetam' */
  real_T wm_delay;                     /* '<S38>/wm_delay' */
  real_T F2;                           /* '<S38>/F2' */
  real_T wm_predict;                   /* '<S38>/wm_predict' */
  real_T Sum1;                         /* '<S38>/Sum1' */
  real_T MultiportSwitch[4];           /* '<S19>/Multiport Switch' */
  real_T MultiportSwitch_p[2];         /* '<S18>/Multiport Switch' */
  real_T MultiportSwitch1[2];          /* '<S18>/Multiport Switch1' */
  real_T ib[4];                        /* '<S18>/ib' */
  real_T GainVr_Vs1[2];                /* '<S13>/Gain Vr_Vs1' */
  real_T StateSpace_o1[14];            /* '<S96>/State-Space' */
  real_T StateSpace_o2[6];             /* '<S96>/State-Space' */
  real_T iqsids[2];                    /* '<S20>/1-1' */
  real_T Mult1[2];                     /* '<S20>/Mult1' */
  real_T Sum2_k;                       /* '<S20>/Sum2' */
  real_T Switch2;                      /* '<S16>/Switch2' */
  real_T GainVr_Vs[2];                 /* '<S13>/Gain Vr_Vs' */
  real_T u_Vb[4];                      /* '<S17>/1_Vb' */
  real_T MultiportSwitch1_f[2];        /* '<S17>/Multiport Switch1' */
  real_T MultiportSwitch_p2[2];        /* '<S17>/Multiport Switch' */
  real_T voltages[4];                  /* '<S23>/voltages' */
  real_T DigitalClock;                 /* '<S23>/Digital Clock' */
  real_T IC[4];                        /* '<S23>/IC' */
  real_T Sum2_l;                       /* '<S18>/Sum2' */
  real_T Sum3;                         /* '<S18>/Sum3' */
  real_T unitconversion[19];           /* '<S13>/unit conversion' */
  real_T up;                           /* '<S15>/1\p' */
  real_T wTethr[3];                    /* '<S15>/1\p1' */
  real_T Unitconversion;               /* '<S15>/Unit conversion' */
  real_T F;                            /* '<S15>/F' */
  real_T Sum;                          /* '<S15>/Sum' */
  real_T u_2H;                         /* '<S15>/1_2H' */
  real_T Rotorspeedwm;                 /* '<S15>/Rotor speed(wm)' */
  real_T web_psb;                      /* '<S15>/web_psb' */
  real_T DigitalClock_k;               /* '<S57>/Digital Clock' */
  real_T LookUpTable;                  /* '<S57>/Look-Up Table' */
  real_T Toff;                         /* '<S56>/Step1' */
  real_T Ton;                          /* '<S56>/Step' */
  real_T DiscreteTimeIntegrator1;      /* '<S47>/Discrete-Time Integrator1' */
  real_T UnitDelay1;                   /* '<S47>/Unit Delay1' */
  real_T Switch2_d;                    /* '<S56>/Switch2' */
  real_T Switch3;                      /* '<S56>/Switch3' */
  real_T Switch2_a;                    /* '<S41>/Switch2' */
  real_T Sum3_e;                       /* '<S41>/Sum3' */
  real_T Switch1;                      /* '<S49>/Switch1' */
  real_T Switch5[3];                   /* '<S50>/Switch5' */
  real_T t;                            /* '<S42>/t' */
  real_T Gain_p;                       /* '<S42>/Gain' */
  real_T Product;                      /* '<S42>/Product' */
  real_T DiscreteTimeIntegrator;       /* '<S42>/Discrete-Time Integrator' */
  real_T Sum_n;                        /* '<S42>/Sum' */
  real_T Gain3;                        /* '<S45>/Gain3' */
  real_T Switch3_o;                    /* '<S45>/Switch3' */
  real_T Sum2_j[3];                    /* '<S45>/Sum2' */
  real_T Switch1_a[3];                 /* '<S54>/Switch1' */
  real_T Switch5_b[3];                 /* '<S55>/Switch5' */
  real_T Sum7[3];                      /* '<S40>/Sum7' */
  real_T TrigonometricFunction1[3];    /* '<S40>/Trigonometric Function1' */
  real_T Product2[3];                  /* '<S40>/Product2' */
  real_T Ton_e;                        /* '<S51>/Step' */
  real_T Toff_e;                       /* '<S51>/Step1' */
  real_T Sum4;                         /* '<S51>/Sum4' */
  real_T DataTypeConversion;           /* '<S51>/Data Type  Conversion' */
  real_T Gain1;                        /* '<S52>/Gain1' */
  real_T Gain3_f;                      /* '<S52>/Gain3' */
  real_T Sum1_m;                       /* '<S52>/Sum1' */
  real_T MultiportSwitch_h[3];         /* '<S52>/Multiport Switch' */
  real_T Sum_j[3];                     /* '<S52>/Sum' */
  real_T TrigonometricFunction1_d[3];  /* '<S52>/Trigonometric Function1' */
  real_T Product1[3];                  /* '<S52>/Product1' */
  real_T Gain1_m;                      /* '<S53>/Gain1' */
  real_T Gain3_a;                      /* '<S53>/Gain3' */
  real_T Sum1_m3;                      /* '<S53>/Sum1' */
  real_T MultiportSwitch_n[3];         /* '<S53>/Multiport Switch' */
  real_T Sum_i[3];                     /* '<S53>/Sum' */
  real_T TrigonometricFunction1_c[3];  /* '<S53>/Trigonometric Function1' */
  real_T Product1_i[3];                /* '<S53>/Product1' */
  real_T Sum4_o[3];                    /* '<S43>/Sum4' */
  real_T Sum8[3];                      /* '<S40>/Sum8' */
  real_T Clock;                        /* '<S73>/Clock' */
  real_T Add1;                         /* '<S73>/Add1' */
  real_T MathFunction;                 /* '<S73>/Math Function' */
  real_T uib1;                         /* '<S73>/1\ib1' */
  real_T uDLookupTable;                /* '<S73>/1-D Lookup Table' */
  real_T Add3;                         /* '<S73>/Add3' */
  real_T Model_o1;                     /* '<Root>/Model' */
  real_T Model_o2;                     /* '<Root>/Model' */
  real_T Model_o3;                     /* '<Root>/Model' */
  real_T DigitalClock_m;               /* '<S74>/Digital Clock' */
  real_T Add1_e;                       /* '<S74>/Add1' */
  real_T MathFunction_l;               /* '<S74>/Math Function' */
  real_T uib1_h;                       /* '<S74>/1\ib1' */
  real_T uDLookupTable_b;              /* '<S74>/1-D Lookup Table' */
  real_T Add3_h;                       /* '<S74>/Add3' */
  real_T Model1_o1;                    /* '<Root>/Model1' */
  real_T Model1_o2;                    /* '<Root>/Model1' */
  real_T Model1_o3;                    /* '<Root>/Model1' */
  real_T DigitalClock_ms;              /* '<S75>/Digital Clock' */
  real_T Add1_l;                       /* '<S75>/Add1' */
  real_T MathFunction_o;               /* '<S75>/Math Function' */
  real_T uib1_e;                       /* '<S75>/1\ib1' */
  real_T uDLookupTable_bk;             /* '<S75>/1-D Lookup Table' */
  real_T Add3_n;                       /* '<S75>/Add3' */
  real_T Model2_o1;                    /* '<Root>/Model2' */
  real_T Model2_o2;                    /* '<Root>/Model2' */
  real_T Model2_o3;                    /* '<Root>/Model2' */
  real_T TransportDelay;               /* '<S3>/Transport Delay' */
  real_T TransportDelay_i;             /* '<S4>/Transport Delay' */
  real_T TransportDelay_n;             /* '<S5>/Transport Delay' */
  real_T Switch;                       /* '<S84>/Switch' */
  real_T Saturation[6];                /* '<S76>/Saturation' */
  real_T DataTypeConversion_p[6];      /* '<S76>/Data Type Conversion' */
  real_T DataTypeConversion1;          /* '<S76>/Data Type Conversion1' */
  real_T Product4[6];                  /* '<S76>/Product4' */
  real_T DataTypeConversion_f;         /* '<S84>/Data Type Conversion' */
  real_T Switch_e;                     /* '<S86>/Switch' */
  real_T DataTypeConversion_l;         /* '<S86>/Data Type Conversion' */
  real_T Switch_k;                     /* '<S88>/Switch' */
  real_T DataTypeConversion_h;         /* '<S88>/Data Type Conversion' */
  real_T Switch_i;                     /* '<S90>/Switch' */
  real_T DataTypeConversion_k;         /* '<S90>/Data Type Conversion' */
  real_T Switch_a;                     /* '<S92>/Switch' */
  real_T DataTypeConversion_i;         /* '<S92>/Data Type Conversion' */
  real_T Switch_a4;                    /* '<S94>/Switch' */
  real_T DataTypeConversion_c;         /* '<S94>/Data Type Conversion' */
  real_T Product_n;                    /* '<S3>/Product' */
  real_T Product_b;                    /* '<S4>/Product' */
  real_T Product_l;                    /* '<S5>/Product' */
  real_T Switch4;                      /* '<S42>/Switch4' */
  real_T Gain2;                        /* '<S42>/Gain2' */
  real_T Sum1_o;                       /* '<S42>/Sum1' */
  real_T Gain3_m[3];                   /* '<S40>/Gain3' */
  real_T wtrad;                        /* '<S44>/Math Function' */
  real_T Switch_c;                     /* '<S56>/Switch' */
  real_T donotdeletethisgain;          /* '<S64>/do not delete this gain' */
  real_T donotdeletethisgain_k;        /* '<S65>/do not delete this gain' */
  real_T donotdeletethisgain_o;        /* '<S66>/do not delete this gain' */
  real_T Kv1[3];                       /* '<S7>/Kv1' */
  real_T donotdeletethisgain_kv;       /* '<S61>/do not delete this gain' */
  real_T donotdeletethisgain_b;        /* '<S62>/do not delete this gain' */
  real_T donotdeletethisgain_h;        /* '<S63>/do not delete this gain' */
  real_T Kv[3];                        /* '<S7>/Kv' */
  real_T UnitDelay;                    /* '<S73>/Unit Delay' */
  real_T uRsw;                         /* '<S94>/1//Rsw' */
  real_T uRsw_n;                       /* '<S92>/1//Rsw' */
  real_T uRsw_i;                       /* '<S90>/1//Rsw' */
  real_T uRsw_g;                       /* '<S88>/1//Rsw' */
  real_T uRsw_c;                       /* '<S86>/1//Rsw' */
  real_T uRsw_k;                       /* '<S84>/1//Rsw' */
  real_T Switch1_j;                    /* '<S56>/Switch1' */
  real_T MultiportSwitch1_b;           /* '<S56>/Multiport Switch1' */
  real_T Gain1_f;                      /* '<S56>/Gain1' */
  real_T Product1_f;                   /* '<S56>/Product1' */
  real_T TrigonometricFunction1_l;     /* '<S56>/Trigonometric Function1' */
  real_T Mod;                          /* '<S56>/Product' */
  real_T Step;                         /* '<S56>/Product2' */
  real_T Gain4;                        /* '<S45>/Gain4' */
  real_T Gain3_n;                      /* '<S54>/Gain3' */
  real_T Sum2_lw[3];                   /* '<S54>/Sum2' */
  real_T Constant[2];                  /* '<S37>/Constant' */
  real_T Gain3_e;                      /* '<S37>/Gain3' */
  real_T TrigonometricFunction_o1;     /* '<S37>/Trigonometric Function' */
  real_T TrigonometricFunction_o2;     /* '<S37>/Trigonometric Function' */
  real_T W34wr[16];                    /* '<S37>/W(3,4)=-wr' */
  real_T W43wr[16];                    /* '<S37>/W(4,3)=wr' */
  real_T Constant_e[2];                /* '<S36>/Constant' */
  real_T Gain1_e;                      /* '<S36>/Gain1' */
  real_T TrigonometricFunction_o1_d;   /* '<S36>/Trigonometric Function' */
  real_T TrigonometricFunction_o2_j;   /* '<S36>/Trigonometric Function' */
  real_T W12wr[16];                    /* '<S36>/W(1,2)=wr' */
  real_T W21wr[16];                    /* '<S36>/W(2,1)=-wr' */
  real_T DigitalClock_kx;              /* '<S35>/Digital Clock' */
  real_T wewr;                         /* '<S35>/Sum' */
  real_T Gain2_k;                      /* '<S35>/Gain2' */
  real_T th;                           /* '<S35>/web_psb' */
  real_T beta;                         /* '<S35>/Sum1' */
  real_T TrigonometricFunction_o1_dn;  /* '<S35>/Trigonometric Function' */
  real_T TrigonometricFunction_o2_k;   /* '<S35>/Trigonometric Function' */
  real_T TrigonometricFunction1_o1;    /* '<S35>/Trigonometric Function1' */
  real_T TrigonometricFunction1_o2;    /* '<S35>/Trigonometric Function1' */
  real_T W341wr[16];                   /* '<S35>/W(3,4)=1-wr' */
  real_T W43wr1[16];                   /* '<S35>/W(4,3)=wr-1' */
  real_T ira;                          /* '<S34>/ira' */
  real_T irb;                          /* '<S34>/irb' */
  real_T isa;                          /* '<S34>/isa' */
  real_T isb;                          /* '<S34>/isb' */
  real_T ira_g;                        /* '<S33>/ira' */
  real_T irb_g;                        /* '<S33>/irb' */
  real_T isa_a;                        /* '<S33>/isa' */
  real_T isb_f;                        /* '<S33>/isb' */
  real_T ira_p;                        /* '<S32>/ira' */
  real_T irb_n;                        /* '<S32>/irb' */
  real_T isa_m;                        /* '<S32>/isa' */
  real_T isb_p;                        /* '<S32>/isb' */
  real_T vdr;                          /* '<S30>/vdr' */
  real_T vds;                          /* '<S30>/vds' */
  real_T vqr;                          /* '<S30>/vqr' */
  real_T vqs;                          /* '<S30>/vqs' */
  real_T vdr_p;                        /* '<S29>/vdr' */
  real_T vds_i;                        /* '<S29>/vds' */
  real_T vqr_l;                        /* '<S29>/vqr' */
  real_T vqs_i;                        /* '<S29>/vqs' */
  real_T vdr_l;                        /* '<S28>/vdr' */
  real_T vds_f;                        /* '<S28>/vds' */
  real_T vqr_j;                        /* '<S28>/vqr' */
  real_T vqs_l;                        /* '<S28>/vqs' */
  real_T ukuk1[4];                     /* '<S23>/sum' */
  real_T RLinv[16];                    /* '<S16>/Switch1' */
  real_T MultiportSwitch1_l[16];       /* '<S19>/Multiport Switch1' */
  real_T A[16];                        /* '<S16>/Sum1' */
  real_T wbaseTs2[16];                 /* '<S27>/wbase*Ts//2' */
  real_T Sum1_k[16];                   /* '<S27>/Sum1' */
  real_T inversion[16];                /* '<S27>/inversion' */
  real_T wbaseTs2_c[16];               /* '<S27>/wbase*Ts//2 ' */
  real_T Product1_d[4];                /* '<S23>/Product1' */
  real_T Sum5[16];                     /* '<S27>/Sum5' */
  real_T Product4_k[16];               /* '<S27>/Product4' */
  real_T Product2_o[4];                /* '<S23>/Product2' */
  real_T xk[4];                    /* '<S23>/Ad*x(k-1) + Bd*( u(k-1) + u(k))' */
  real_T Delay;                        /* '<S22>/Delay' */
  real_T TmpSignalConversionAtMathFuncti[3];
  real_T MathFunction_p[3];            /* '<S24>/Math Function' */
  real_T Sum2_i;                       /* '<S24>/Sum2' */
  real_T MathFunction1;                /* '<S24>/Math Function1' */
  real_T Product2_m[2];                /* '<S26>/Product2' */
  real_T Product_c[2];                 /* '<S26>/Product' */
  real_T phimq;                        /* '<S26>/Sum2' */
  real_T Product1_j[2];                /* '<S26>/Product1' */
  real_T phimd;                        /* '<S26>/Sum1' */
  real_T Phisat;                       /* '<S22>/Math Function' */
  real_T Isat;                         /* '<S22>/1-D Lookup Table' */
  real_T Switch_g;                     /* '<S22>/Switch' */
  real_T Lminrows13col13[16];          /* '<S25>/Lm in rows[1,3] & col[1,3]' */
  real_T Lminrows24col24[16];          /* '<S25>/Lm in rows[2,4] & col[2,4]' */
  real_T Sum2_e[16];                   /* '<S25>/Sum2' */
  real_T Linv_h[16];                   /* '<S22>/inversion' */
  real_T RLinv_m[16];                  /* '<S22>/Product1' */
  real_T Lm;                           /* '<S22>/Product' */
  boolean_T RelationalOperator3;       /* '<S49>/Relational Operator3' */
  boolean_T Amplitude;                 /* '<S46>/Relational Operator' */
  boolean_T LogicalOperator1;          /* '<S49>/Logical Operator1' */
  boolean_T DataTypeConversion2;       /* '<S56>/Data Type  Conversion2' */
  boolean_T LogicalOperator1_l;        /* '<S56>/Logical Operator1' */
  boolean_T RelationalOperator1;       /* '<S56>/Relational Operator1' */
  boolean_T DataTypeConversion1_f;     /* '<S56>/Data Type  Conversion1' */
  boolean_T LogicalOperator;           /* '<S56>/Logical Operator' */
  boolean_T RelationalOperator3_f;     /* '<S54>/Relational Operator3' */
  boolean_T Phase;                     /* '<S46>/Relational Operator1' */
  boolean_T LogicalOperator1_b;        /* '<S54>/Logical Operator1' */
  boolean_T DataTypeConversion1_j;     /* '<S51>/Data Type  Conversion1' */
  boolean_T DataTypeConversion2_m;     /* '<S51>/Data Type  Conversion2' */
  boolean_T LogicalOperator_l;         /* '<S51>/Logical Operator' */
  boolean_T Compare;                   /* '<S77>/Compare' */
  boolean_T Frequency;                 /* '<S46>/Relational Operator2' */
  boolean_T RelationalOperator;        /* '<S56>/Relational Operator' */
};

/* Block states (default storage) for system '<Root>' */
struct DW_VFControl_T {
  real_T fluxes_DSTATE[4];             /* '<S23>/fluxes' */
  real_T fluxes_DSTATE_l[4];           /* '<S21>/fluxes' */
  real_T Rotoranglethetam_DSTATE;      /* '<S15>/Rotor angle thetam' */
  real_T wm_delay_DSTATE;              /* '<S38>/wm_delay' */
  real_T wm_predict_DSTATE;            /* '<S38>/wm_predict' */
  real_T voltages_DSTATE[4];           /* '<S23>/voltages' */
  real_T Rotorspeedwm_DSTATE;          /* '<S15>/Rotor speed(wm)' */
  real_T DiscreteTimeIntegrator1_DSTATE;/* '<S47>/Discrete-Time Integrator1' */
  real_T UnitDelay1_DSTATE;            /* '<S47>/Unit Delay1' */
  real_T DiscreteTimeIntegrator_DSTATE;/* '<S42>/Discrete-Time Integrator' */
  real_T UnitDelay_DSTATE;             /* '<S73>/Unit Delay' */
  real_T Delay_DSTATE;                 /* '<S22>/Delay' */
  real_T inversion_DWORK1[16];         /* '<S27>/inversion' */
  real_T inversion_DWORK3[16];         /* '<S27>/inversion' */
  real_T inversion_DWORK4[16];         /* '<S27>/inversion' */
  real_T inversion_DWORK4_k[16];       /* '<S22>/inversion' */
  struct {
    real_T modelTStart;
    real_T TUbufferArea[2048];
  } TransportDelay_RWORK;              /* '<S3>/Transport Delay' */

  struct {
    real_T modelTStart;
    real_T TUbufferArea[2048];
  } TransportDelay_RWORK_d;            /* '<S4>/Transport Delay' */

  struct {
    real_T modelTStart;
    real_T TUbufferArea[2048];
  } TransportDelay_RWORK_m;            /* '<S5>/Transport Delay' */

  struct {
    void *AS;
    void *BS;
    void *CS;
    void *DS;
    void *DX_COL;
    void *BD_COL;
    void *TMP1;
    void *TMP2;
    void *XTMP;
    void *SWITCH_STATUS;
    void *SWITCH_STATUS_INIT;
    void *SW_CHG;
    void *G_STATE;
    void *USWLAST;
    void *XKM12;
    void *XKP12;
    void *XLAST;
    void *ULAST;
    void *IDX_SW_CHG;
    void *Y_SWITCH;
    void *SWITCH_TYPES;
    void *IDX_OUT_SW;
    void *SWITCH_TOPO_SAVED_IDX;
    void *SWITCH_MAP;
  } StateSpace_PWORK;                  /* '<S96>/State-Space' */

  struct {
    void *LoggedData[3];
  } DebugPWM_PWORK;                    /* '<Root>/Debug PWM' */

  struct {
    void *LoggedData[4];
  } DebugfaseA_PWORK;                  /* '<Root>/Debug fase A' */

  struct {
    void *LoggedData[4];
  } DebugfaseB_PWORK;                  /* '<Root>/Debug fase B' */

  struct {
    void *LoggedData[4];
  } DebugfaseC_PWORK;                  /* '<Root>/Debug fase C' */

  struct {
    void *TUbufferPtrs[2];
  } TransportDelay_PWORK;              /* '<S3>/Transport Delay' */

  struct {
    void *TUbufferPtrs[2];
  } TransportDelay_PWORK_m;            /* '<S4>/Transport Delay' */

  struct {
    void *TUbufferPtrs[2];
  } TransportDelay_PWORK_f;            /* '<S5>/Transport Delay' */

  void *Digitaloutput1_PWORK[2];       /* '<Root>/Digital output1' */
  void *Digitaloutput2_PWORK[2];       /* '<Root>/Digital output2' */
  struct {
    void *LoggedData[2];
  } Corrientetensinmotorideal_PWORK;
                                   /* '<Root>/Corriente//tensión motor ideal' */

  struct {
    void *USERIO_P_IND;
    void *PROG_SPACE_P_IND;
    void *CONFIG_REGISTER_P_IND;
    void *CONDITIONING_MODULE_IO3xx_2x_P_IND;
    void *DEVICENAME_P_IND;
    void *DMA_CONTROLLER_P_IND;
  } Setup_PWORK;                       /* '<Root>/Setup' */

  int32_T inversion_DWORK2[4];         /* '<S27>/inversion' */
  uint32_T m_bpIndex;                  /* '<S73>/1-D Lookup Table' */
  uint32_T m_bpIndex_e;                /* '<S74>/1-D Lookup Table' */
  uint32_T m_bpIndex_p;                /* '<S75>/1-D Lookup Table' */
  uint32_T m_bpIndex_b;                /* '<S22>/1-D Lookup Table' */
  int_T StateSpace_IWORK[11];          /* '<S96>/State-Space' */
  struct {
    int_T Tail;
    int_T Head;
    int_T Last;
    int_T CircularBufSize;
  } TransportDelay_IWORK;              /* '<S3>/Transport Delay' */

  struct {
    int_T Tail;
    int_T Head;
    int_T Last;
    int_T CircularBufSize;
  } TransportDelay_IWORK_g;            /* '<S4>/Transport Delay' */

  struct {
    int_T Tail;
    int_T Head;
    int_T Last;
    int_T CircularBufSize;
  } TransportDelay_IWORK_m;            /* '<S5>/Transport Delay' */

  struct {
    int_T MODULEARCHITECTURE_I_IND;
  } Setup_IWORK;                       /* '<Root>/Setup' */

  int8_T sinthrcosthr1_SubsysRanBC;    /* '<S19>/sin(thr),cos(thr)1' */
  int8_T sinthrcosthr_SubsysRanBC;     /* '<S19>/sin(thr),cos(thr)' */
  int8_T sinbetacosbetasinthcosth_Subsys;
                               /* '<S19>/sin(beta),cos(beta),sin(th),cos(th)' */
  int8_T Synchronousreferenceframe_Subsy;/* '<S18>/Synchronous reference frame' */
  int8_T Stationaryreferenceframe_Subsys;/* '<S18>/Stationary reference frame' */
  int8_T Rotorreferenceframe_SubsysRanBC;/* '<S18>/Rotor reference frame' */
  int8_T Synchronousreferenceframe_Sub_k;/* '<S17>/Synchronous reference frame' */
  int8_T Stationaryreferenceframe_Subs_n;/* '<S17>/Stationary reference frame' */
  int8_T Rotorreferenceframe_SubsysRan_i;/* '<S17>/Rotor reference frame' */
  int8_T Saturation_SubsysRanBC;       /* '<S16>/Saturation' */
  uint8_T Rotorspeedwm_SYSTEM_ENABLE;  /* '<S15>/Rotor speed(wm)' */
  boolean_T sinthrcosthr1_MODE;        /* '<S19>/sin(thr),cos(thr)1' */
  boolean_T sinthrcosthr_MODE;         /* '<S19>/sin(thr),cos(thr)' */
  boolean_T Synchronousreferenceframe_MODE;/* '<S18>/Synchronous reference frame' */
  boolean_T Stationaryreferenceframe_MODE;/* '<S18>/Stationary reference frame' */
  boolean_T Rotorreferenceframe_MODE;  /* '<S18>/Rotor reference frame' */
  boolean_T Synchronousreferenceframe_MOD_l;/* '<S17>/Synchronous reference frame' */
  boolean_T Stationaryreferenceframe_MODE_p;/* '<S17>/Stationary reference frame' */
  boolean_T Rotorreferenceframe_MODE_m;/* '<S17>/Rotor reference frame' */
  MdlrefDW_PWMGenerator_T Model_InstanceData;/* '<Root>/Model' */
  MdlrefDW_PWMGenerator_T Model1_InstanceData;/* '<Root>/Model1' */
  MdlrefDW_PWMGenerator_T Model2_InstanceData;/* '<Root>/Model2' */
};

/* Real-time Model Data Structure */
struct tag_RTM_VFControl_T {
  struct SimStruct_tag * *childSfunctions;
  const char_T *errorStatus;
  SS_SimMode simMode;
  RTWSolverInfo solverInfo;
  RTWSolverInfo *solverInfoPtr;
  void *sfcnInfo;

  /*
   * NonInlinedSFcns:
   * The following substructure contains information regarding
   * non-inlined s-functions used in the model.
   */
  struct {
    RTWSfcnInfo sfcnInfo;
    time_T *taskTimePtrs[3];
    SimStruct childSFunctions[2];
    SimStruct *childSFunctionPtrs[2];
    struct _ssBlkInfo2 blkInfo2[2];
    struct _ssSFcnModelMethods2 methods2[2];
    struct _ssSFcnModelMethods3 methods3[2];
    struct _ssSFcnModelMethods4 methods4[2];
    struct _ssStatesInfo2 statesInfo2[2];
    ssPeriodicStatesInfo periodicStatesInfo[2];
    struct _ssPortInfo2 inputOutputPortInfo2[2];
    struct {
      time_T sfcnPeriod[1];
      time_T sfcnOffset[1];
      int_T sfcnTsMap[1];
      struct _ssPortInputs inputPortInfo[3];
      struct _ssInPortUnit inputPortUnits[3];
      struct _ssInPortCoSimAttribute inputPortCoSimAttribute[3];
      uint_T attribs[6];
      mxArray *params[6];
      struct _ssDWorkRecord dWork[1];
      struct _ssDWorkAuxRecord dWorkAux[1];
    } Sfcn0;

    struct {
      time_T sfcnPeriod[1];
      time_T sfcnOffset[1];
      int_T sfcnTsMap[1];
      struct _ssPortInputs inputPortInfo[3];
      struct _ssInPortUnit inputPortUnits[3];
      struct _ssInPortCoSimAttribute inputPortCoSimAttribute[3];
      uint_T attribs[6];
      mxArray *params[6];
      struct _ssDWorkRecord dWork[1];
      struct _ssDWorkAuxRecord dWorkAux[1];
    } Sfcn1;
  } NonInlinedSFcns;

  boolean_T zCCacheNeedsReset;
  boolean_T derivCacheNeedsReset;
  boolean_T CTOutputIncnstWithState;

  /*
   * Sizes:
   * The following substructure contains sizes information
   * for many of the model attributes such as inputs, outputs,
   * dwork, sample times, etc.
   */
  struct {
    uint32_T options;
    int_T numContStates;
    int_T numU;
    int_T numY;
    int_T numSampTimes;
    int_T numBlocks;
    int_T numBlockIO;
    int_T numBlockPrms;
    int_T numDwork;
    int_T numSFcnPrms;
    int_T numSFcns;
    int_T numIports;
    int_T numOports;
    int_T numNonSampZCs;
    int_T sysDirFeedThru;
    int_T rtwGenSfcn;
  } Sizes;

  /*
   * Timing:
   * The following substructure contains information regarding
   * the timing information for the model.
   */
  struct {
    time_T stepSize;
    uint32_T clockTick0;
    uint32_T clockTickH0;
    time_T stepSize0;
    uint32_T clockTick1;
    uint32_T clockTickH1;
    time_T stepSize1;
    uint32_T clockTick2;
    uint32_T clockTickH2;
    struct {
      uint32_T TID[3];
      uint32_T cLimit[3];
    } TaskCounters;

    time_T tStart;
    time_T tFinal;
    time_T timeOfLastOutput;
    SimTimeStep simTimeStep;
    boolean_T stopRequestedFlag;
    time_T *sampleTimes;
    time_T *offsetTimes;
    int_T *sampleTimeTaskIDPtr;
    int_T *sampleHits;
    int_T *perTaskSampleHits;
    time_T *t;
    time_T sampleTimesArray[3];
    time_T offsetTimesArray[3];
    int_T sampleTimeTaskIDArray[3];
    int_T sampleHitArray[3];
    int_T perTaskSampleHitsArray[9];
    time_T tArray[3];
  } Timing;
};

/* Block signals (default storage) */
#ifdef __cplusplus

extern "C"
{

#endif

  extern struct B_VFControl_T VFControl_B;

#ifdef __cplusplus

}

#endif

/* Block states (default storage) */
extern struct DW_VFControl_T VFControl_DW;

#ifdef __cplusplus

extern "C"
{

#endif

  /* Model entry point functions */
  extern void VFControl_initialize(void);
  extern void VFControl_step0(void);
  extern void VFControl_step2(void);
  extern void VFControl_terminate(void);

#ifdef __cplusplus

}

#endif

/* Real-time Model object */
#ifdef __cplusplus

extern "C"
{

#endif

  extern RT_MODEL_VFControl_T *const VFControl_M;

#ifdef __cplusplus

}

#endif

/*-
 * The generated code includes comments that allow you to trace directly
 * back to the appropriate location in the model.  The basic format
 * is <system>/block_name, where system is the system number (uniquely
 * assigned by Simulink) and block_name is the name of the block.
 *
 * Use the MATLAB hilite_system command to trace the generated code back
 * to the model.  For example,
 *
 * hilite_system('<S3>')    - opens system 3
 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
 *
 * Here is the system hierarchy for this model
 *
 * '<Root>' : 'VFControl'
 * '<S1>'   : 'VFControl/Asynchronous Machine SI Units'
 * '<S2>'   : 'VFControl/DC Voltage Source'
 * '<S3>'   : 'VFControl/Inversión A'
 * '<S4>'   : 'VFControl/Inversión B'
 * '<S5>'   : 'VFControl/Inversión C'
 * '<S6>'   : 'VFControl/Three-Phase Programmable Generator'
 * '<S7>'   : 'VFControl/Three-Phase V-I Measurement'
 * '<S8>'   : 'VFControl/Triangle Generator'
 * '<S9>'   : 'VFControl/Triangle Generator1'
 * '<S10>'  : 'VFControl/Triangle Generator2'
 * '<S11>'  : 'VFControl/Two-Level Converter1'
 * '<S12>'  : 'VFControl/powergui'
 * '<S13>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model'
 * '<S14>'  : 'VFControl/Asynchronous Machine SI Units/Measurements'
 * '<S15>'  : 'VFControl/Asynchronous Machine SI Units/Mechanical model'
 * '<S16>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/Asynchronous Machine State-space model'
 * '<S17>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/abc to dq  transformation'
 * '<S18>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/dq to abc transformation'
 * '<S19>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/sin,cos'
 * '<S20>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/Asynchronous Machine State-space model/Electromagnetic Torque'
 * '<S21>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/Asynchronous Machine State-space model/Flux Prediction'
 * '<S22>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/Asynchronous Machine State-space model/Saturation'
 * '<S23>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/Asynchronous Machine State-space model/phiqd_SR'
 * '<S24>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/Asynchronous Machine State-space model/Saturation/Laq=Lad'
 * '<S25>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/Asynchronous Machine State-space model/Saturation/Matrix L'
 * '<S26>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/Asynchronous Machine State-space model/Saturation/phimqd'
 * '<S27>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/Asynchronous Machine State-space model/phiqd_SR/Subsystem'
 * '<S28>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/abc to dq  transformation/Rotor reference frame'
 * '<S29>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/abc to dq  transformation/Stationary reference frame'
 * '<S30>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/abc to dq  transformation/Synchronous reference frame'
 * '<S31>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/abc to dq  transformation/transit'
 * '<S32>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/dq to abc transformation/Rotor reference frame'
 * '<S33>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/dq to abc transformation/Stationary reference frame'
 * '<S34>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/dq to abc transformation/Synchronous reference frame'
 * '<S35>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/sin,cos/sin(beta),cos(beta),sin(th),cos(th)'
 * '<S36>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/sin,cos/sin(thr),cos(thr)'
 * '<S37>'  : 'VFControl/Asynchronous Machine SI Units/Electrical model/sin,cos/sin(thr),cos(thr)1'
 * '<S38>'  : 'VFControl/Asynchronous Machine SI Units/Mechanical model/Delay Prediction'
 * '<S39>'  : 'VFControl/DC Voltage Source/Model'
 * '<S40>'  : 'VFControl/Three-Phase Programmable Generator/Model'
 * '<S41>'  : 'VFControl/Three-Phase Programmable Generator/Model/Amplitude'
 * '<S42>'  : 'VFControl/Three-Phase Programmable Generator/Model/Frequency'
 * '<S43>'  : 'VFControl/Three-Phase Programmable Generator/Model/Harmonic Generation'
 * '<S44>'  : 'VFControl/Three-Phase Programmable Generator/Model/Measurements'
 * '<S45>'  : 'VFControl/Three-Phase Programmable Generator/Model/Phase'
 * '<S46>'  : 'VFControl/Three-Phase Programmable Generator/Model/Type of Variation  selector'
 * '<S47>'  : 'VFControl/Three-Phase Programmable Generator/Model/Variation value (step ramp mod)'
 * '<S48>'  : 'VFControl/Three-Phase Programmable Generator/Model/Variation value (time table)'
 * '<S49>'  : 'VFControl/Three-Phase Programmable Generator/Model/Amplitude/Time-Amplitude pairs'
 * '<S50>'  : 'VFControl/Three-Phase Programmable Generator/Model/Amplitude/Variation on phase A only'
 * '<S51>'  : 'VFControl/Three-Phase Programmable Generator/Model/Harmonic Generation/Enable Harmonics'
 * '<S52>'  : 'VFControl/Three-Phase Programmable Generator/Model/Harmonic Generation/Harmonic A generation'
 * '<S53>'  : 'VFControl/Three-Phase Programmable Generator/Model/Harmonic Generation/Harmonic B generation'
 * '<S54>'  : 'VFControl/Three-Phase Programmable Generator/Model/Phase/Time-Phase pairs'
 * '<S55>'  : 'VFControl/Three-Phase Programmable Generator/Model/Phase/Variation on phase A only'
 * '<S56>'  : 'VFControl/Three-Phase Programmable Generator/Model/Variation value (step ramp mod)/Subsystem1'
 * '<S57>'  : 'VFControl/Three-Phase Programmable Generator/Model/Variation value (time table)/Model'
 * '<S58>'  : 'VFControl/Three-Phase V-I Measurement/Mode I'
 * '<S59>'  : 'VFControl/Three-Phase V-I Measurement/Mode V'
 * '<S60>'  : 'VFControl/Three-Phase V-I Measurement/Model'
 * '<S61>'  : 'VFControl/Three-Phase V-I Measurement/Model/I A:'
 * '<S62>'  : 'VFControl/Three-Phase V-I Measurement/Model/I B:'
 * '<S63>'  : 'VFControl/Three-Phase V-I Measurement/Model/I C:'
 * '<S64>'  : 'VFControl/Three-Phase V-I Measurement/Model/U AB:'
 * '<S65>'  : 'VFControl/Three-Phase V-I Measurement/Model/U BC:'
 * '<S66>'  : 'VFControl/Three-Phase V-I Measurement/Model/U CA:'
 * '<S67>'  : 'VFControl/Three-Phase V-I Measurement/Model/I A:/Model'
 * '<S68>'  : 'VFControl/Three-Phase V-I Measurement/Model/I B:/Model'
 * '<S69>'  : 'VFControl/Three-Phase V-I Measurement/Model/I C:/Model'
 * '<S70>'  : 'VFControl/Three-Phase V-I Measurement/Model/U AB:/Model'
 * '<S71>'  : 'VFControl/Three-Phase V-I Measurement/Model/U BC:/Model'
 * '<S72>'  : 'VFControl/Three-Phase V-I Measurement/Model/U CA:/Model'
 * '<S73>'  : 'VFControl/Triangle Generator/Model'
 * '<S74>'  : 'VFControl/Triangle Generator1/Model'
 * '<S75>'  : 'VFControl/Triangle Generator2/Model'
 * '<S76>'  : 'VFControl/Two-Level Converter1/Model'
 * '<S77>'  : 'VFControl/Two-Level Converter1/Model/Compare To Constant'
 * '<S78>'  : 'VFControl/Two-Level Converter1/Model/Sw1'
 * '<S79>'  : 'VFControl/Two-Level Converter1/Model/Sw2'
 * '<S80>'  : 'VFControl/Two-Level Converter1/Model/Sw3'
 * '<S81>'  : 'VFControl/Two-Level Converter1/Model/Sw4'
 * '<S82>'  : 'VFControl/Two-Level Converter1/Model/Sw5'
 * '<S83>'  : 'VFControl/Two-Level Converter1/Model/Sw6'
 * '<S84>'  : 'VFControl/Two-Level Converter1/Model/Sw1/Model'
 * '<S85>'  : 'VFControl/Two-Level Converter1/Model/Sw1/Model/Measurement list'
 * '<S86>'  : 'VFControl/Two-Level Converter1/Model/Sw2/Model'
 * '<S87>'  : 'VFControl/Two-Level Converter1/Model/Sw2/Model/Measurement list'
 * '<S88>'  : 'VFControl/Two-Level Converter1/Model/Sw3/Model'
 * '<S89>'  : 'VFControl/Two-Level Converter1/Model/Sw3/Model/Measurement list'
 * '<S90>'  : 'VFControl/Two-Level Converter1/Model/Sw4/Model'
 * '<S91>'  : 'VFControl/Two-Level Converter1/Model/Sw4/Model/Measurement list'
 * '<S92>'  : 'VFControl/Two-Level Converter1/Model/Sw5/Model'
 * '<S93>'  : 'VFControl/Two-Level Converter1/Model/Sw5/Model/Measurement list'
 * '<S94>'  : 'VFControl/Two-Level Converter1/Model/Sw6/Model'
 * '<S95>'  : 'VFControl/Two-Level Converter1/Model/Sw6/Model/Measurement list'
 * '<S96>'  : 'VFControl/powergui/EquivalentModel1'
 * '<S97>'  : 'VFControl/powergui/EquivalentModel1/Gates'
 * '<S98>'  : 'VFControl/powergui/EquivalentModel1/Sources'
 * '<S99>'  : 'VFControl/powergui/EquivalentModel1/Status'
 * '<S100>' : 'VFControl/powergui/EquivalentModel1/Yout'
 */
#endif                                 /* VFControl_h_ */
