/*
 * rozbeh_motoru_linear.c
 *
 * Code generation for model "rozbeh_motoru_linear".
 *
 * Model version              : 1.58
 * Simulink Coder version : 8.3 (R2012b) 20-Jul-2012
 * C source code generated on : Thu May 21 15:34:19 2015
 *
 * Target selection: rtwin.tlc
 * Note: GRT includes extra infrastructure and instrumentation for prototyping
 * Embedded hardware selection: Generic->32-bit x86 compatible
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */
#include "rozbeh_motoru_linear.h"
#include "rozbeh_motoru_linear_private.h"
#include "rozbeh_motoru_linear_dt.h"

/* options for Real-Time Windows Target board 0 */
static double RTWinBoardOptions0[] = {
  1.0,
};

/* list of Real-Time Windows Target timers */
const int RTWinTimerCount = 1;
const double RTWinTimers[2] = {
  0.0001, 0.0,
};

/* list of Real-Time Windows Target boards */
const int RTWinBoardCount = 1;
RTWINBOARD RTWinBoards[1] = {
  { "Humusoft/MF624", 4294967295U, 1, RTWinBoardOptions0 },
};

/* Block signals (auto storage) */
BlockIO_rozbeh_motoru_linear rozbeh_motoru_linear_B;

/* Continuous states */
ContinuousStates_rozbeh_motoru_linear rozbeh_motoru_linear_X;

/* Block states (auto storage) */
D_Work_rozbeh_motoru_linear rozbeh_motoru_linear_DWork;

/* Real-time model */
RT_MODEL_rozbeh_motoru_linear rozbeh_motoru_linear_M_;
RT_MODEL_rozbeh_motoru_linear *const rozbeh_motoru_linear_M =
  &rozbeh_motoru_linear_M_;

/*
 * This function updates continuous states using the ODE3 fixed-step
 * solver algorithm
 */
static void rt_ertODEUpdateContinuousStates(RTWSolverInfo *si )
{
  /* Solver Matrices */
  static const real_T rt_ODE3_A[3] = {
    1.0/2.0, 3.0/4.0, 1.0
  };

  static const real_T rt_ODE3_B[3][3] = {
    { 1.0/2.0, 0.0, 0.0 },

    { 0.0, 3.0/4.0, 0.0 },

    { 2.0/9.0, 1.0/3.0, 4.0/9.0 }
  };

  time_T t = rtsiGetT(si);
  time_T tnew = rtsiGetSolverStopTime(si);
  time_T h = rtsiGetStepSize(si);
  real_T *x = rtsiGetContStates(si);
  ODE3_IntgData *id = (ODE3_IntgData *)rtsiGetSolverData(si);
  real_T *y = id->y;
  real_T *f0 = id->f[0];
  real_T *f1 = id->f[1];
  real_T *f2 = id->f[2];
  real_T hB[3];
  int_T i;
  int_T nXc = 1;
  rtsiSetSimTimeStep(si,MINOR_TIME_STEP);

  /* Save the state values at time t in y, we'll use x as ynew. */
  (void) memcpy(y, x,
                (uint_T)nXc*sizeof(real_T));

  /* Assumes that rtsiSetT and ModelOutputs are up-to-date */
  /* f0 = f(t,y) */
  rtsiSetdX(si, f0);
  rozbeh_motoru_linear_derivatives();

  /* f(:,2) = feval(odefile, t + hA(1), y + f*hB(:,1), args(:)(*)); */
  hB[0] = h * rt_ODE3_B[0][0];
  for (i = 0; i < nXc; i++) {
    x[i] = y[i] + (f0[i]*hB[0]);
  }

  rtsiSetT(si, t + h*rt_ODE3_A[0]);
  rtsiSetdX(si, f1);
  rozbeh_motoru_linear_output();
  rozbeh_motoru_linear_derivatives();

  /* f(:,3) = feval(odefile, t + hA(2), y + f*hB(:,2), args(:)(*)); */
  for (i = 0; i <= 1; i++) {
    hB[i] = h * rt_ODE3_B[1][i];
  }

  for (i = 0; i < nXc; i++) {
    x[i] = y[i] + (f0[i]*hB[0] + f1[i]*hB[1]);
  }

  rtsiSetT(si, t + h*rt_ODE3_A[1]);
  rtsiSetdX(si, f2);
  rozbeh_motoru_linear_output();
  rozbeh_motoru_linear_derivatives();

  /* tnew = t + hA(3);
     ynew = y + f*hB(:,3); */
  for (i = 0; i <= 2; i++) {
    hB[i] = h * rt_ODE3_B[2][i];
  }

  for (i = 0; i < nXc; i++) {
    x[i] = y[i] + (f0[i]*hB[0] + f1[i]*hB[1] + f2[i]*hB[2]);
  }

  rtsiSetT(si, tnew);
  rtsiSetSimTimeStep(si,MAJOR_TIME_STEP);
}

/* Model output function */
void rozbeh_motoru_linear_output(void)
{
  /* local block i/o variables */
  real_T rtb_TransferFcn;
  real_T rtb_ManualSwitch;
  real_T rtb_Clock;
  real_T rtb_Step;
  if (rtmIsMajorTimeStep(rozbeh_motoru_linear_M)) {
    /* set solver stop time */
    if (!(rozbeh_motoru_linear_M->Timing.clockTick0+1)) {
      rtsiSetSolverStopTime(&rozbeh_motoru_linear_M->solverInfo,
                            ((rozbeh_motoru_linear_M->Timing.clockTickH0 + 1) *
        rozbeh_motoru_linear_M->Timing.stepSize0 * 4294967296.0));
    } else {
      rtsiSetSolverStopTime(&rozbeh_motoru_linear_M->solverInfo,
                            ((rozbeh_motoru_linear_M->Timing.clockTick0 + 1) *
        rozbeh_motoru_linear_M->Timing.stepSize0 +
        rozbeh_motoru_linear_M->Timing.clockTickH0 *
        rozbeh_motoru_linear_M->Timing.stepSize0 * 4294967296.0));
    }
  }                                    /* end MajorTimeStep */

  /* Update absolute time of base rate at minor time step */
  if (rtmIsMinorTimeStep(rozbeh_motoru_linear_M)) {
    rozbeh_motoru_linear_M->Timing.t[0] = rtsiGetT
      (&rozbeh_motoru_linear_M->solverInfo);
  }

  if (rtmIsMajorTimeStep(rozbeh_motoru_linear_M)) {
    /* ManualSwitch: '<Root>/Manual Switch' incorporates:
     *  Constant: '<Root>/Constant1'
     *  Constant: '<Root>/Constant2'
     */
    if (rozbeh_motoru_linear_P.ManualSwitch_CurrentSetting == 1) {
      rtb_ManualSwitch = rozbeh_motoru_linear_P.Constant1_Value;
    } else {
      rtb_ManualSwitch = rozbeh_motoru_linear_P.Constant2_Value;
    }

    /* End of ManualSwitch: '<Root>/Manual Switch' */
  }

  /* Step: '<S1>/Step' */
  if (rozbeh_motoru_linear_M->Timing.t[0] < rozbeh_motoru_linear_P.Step_Time) {
    rtb_Step = rozbeh_motoru_linear_P.Step_Y0;
  } else {
    rtb_Step = rozbeh_motoru_linear_P.Step_YFinal;
  }

  /* End of Step: '<S1>/Step' */

  /* Clock: '<S1>/Clock' */
  rtb_Clock = rozbeh_motoru_linear_M->Timing.t[0];

  /* Sum: '<S1>/Output' incorporates:
   *  Constant: '<S1>/Constant'
   *  Constant: '<S1>/Constant1'
   *  Product: '<S1>/Product'
   *  Sum: '<S1>/Sum'
   */
  rozbeh_motoru_linear_B.Output = (rtb_Clock -
    rozbeh_motoru_linear_P.Constant_Value) * rtb_Step +
    rozbeh_motoru_linear_P.Constant1_Value_f;
  if (rtmIsMajorTimeStep(rozbeh_motoru_linear_M)) {
    /* Saturate: '<Root>/Saturation' */
    if (rozbeh_motoru_linear_B.Output >=
        rozbeh_motoru_linear_P.Saturation_UpperSat) {
      rozbeh_motoru_linear_B.Saturation =
        rozbeh_motoru_linear_P.Saturation_UpperSat;
    } else if (rozbeh_motoru_linear_B.Output <=
               rozbeh_motoru_linear_P.Saturation_LowerSat) {
      rozbeh_motoru_linear_B.Saturation =
        rozbeh_motoru_linear_P.Saturation_LowerSat;
    } else {
      rozbeh_motoru_linear_B.Saturation = rozbeh_motoru_linear_B.Output;
    }

    /* End of Saturate: '<Root>/Saturation' */
    /* S-Function Block: <Root>/DIR */
    {
      RTBIO_DriverIO(0, DIGITALOUTPUT, IOWRITE, 1,
                     &rozbeh_motoru_linear_P.DIR_Channels, &rtb_ManualSwitch,
                     &rozbeh_motoru_linear_P.DIR_BitMode);
    }

    /* S-Function Block: <Root>/Enable */
    {
      RTBIO_DriverIO(0, DIGITALOUTPUT, IOWRITE, 1,
                     &rozbeh_motoru_linear_P.Enable_Channels,
                     &rozbeh_motoru_linear_P.Constant4_Value,
                     &rozbeh_motoru_linear_P.Enable_BitMode);
    }

    /* S-Function Block: <Root>/Frequency Output */
    {
      {
        RTBIO_DriverIO(0, FREQUENCYOUTPUT, IOWRITE, 1,
                       &rozbeh_motoru_linear_P.FrequencyOutput_Channels,
                       &rozbeh_motoru_linear_B.Saturation,
                       &rozbeh_motoru_linear_P.Strida_Value);
      }
    }

    /* S-Function Block: <Root>/Encoder Input */
    {
      ENCODERINPARM parm;
      parm.quad = (QUADMODE) 0;
      parm.index = (INDEXPULSE) 2;
      parm.infilter = rozbeh_motoru_linear_P.EncoderInput_InputFilter;
      RTBIO_DriverIO(0, ENCODERINPUT, IOREAD, 1,
                     &rozbeh_motoru_linear_P.EncoderInput_Channels,
                     &rozbeh_motoru_linear_B.EncoderInput, &parm);
    }

    /* Gain: '<Root>/Gain' */
    rozbeh_motoru_linear_B.Gain = rozbeh_motoru_linear_P.Gain_Gain *
      rozbeh_motoru_linear_B.EncoderInput;
  }

  /* TransferFcn: '<Root>/Transfer Fcn' */
  rtb_TransferFcn = rozbeh_motoru_linear_P.TransferFcn_C*
    rozbeh_motoru_linear_X.TransferFcn_CSTATE;
}

/* Model update function */
void rozbeh_motoru_linear_update(void)
{
  if (rtmIsMajorTimeStep(rozbeh_motoru_linear_M)) {
    rt_ertODEUpdateContinuousStates(&rozbeh_motoru_linear_M->solverInfo);
  }

  /* Update absolute time for base rate */
  /* The "clockTick0" counts the number of times the code of this task has
   * been executed. The absolute time is the multiplication of "clockTick0"
   * and "Timing.stepSize0". Size of "clockTick0" ensures timer will not
   * overflow during the application lifespan selected.
   * Timer of this task consists of two 32 bit unsigned integers.
   * The two integers represent the low bits Timing.clockTick0 and the high bits
   * Timing.clockTickH0. When the low bit overflows to 0, the high bits increment.
   */
  if (!(++rozbeh_motoru_linear_M->Timing.clockTick0)) {
    ++rozbeh_motoru_linear_M->Timing.clockTickH0;
  }

  rozbeh_motoru_linear_M->Timing.t[0] = rtsiGetSolverStopTime
    (&rozbeh_motoru_linear_M->solverInfo);

  {
    /* Update absolute timer for sample time: [0.0001s, 0.0s] */
    /* The "clockTick1" counts the number of times the code of this task has
     * been executed. The absolute time is the multiplication of "clockTick1"
     * and "Timing.stepSize1". Size of "clockTick1" ensures timer will not
     * overflow during the application lifespan selected.
     * Timer of this task consists of two 32 bit unsigned integers.
     * The two integers represent the low bits Timing.clockTick1 and the high bits
     * Timing.clockTickH1. When the low bit overflows to 0, the high bits increment.
     */
    if (!(++rozbeh_motoru_linear_M->Timing.clockTick1)) {
      ++rozbeh_motoru_linear_M->Timing.clockTickH1;
    }

    rozbeh_motoru_linear_M->Timing.t[1] =
      rozbeh_motoru_linear_M->Timing.clockTick1 *
      rozbeh_motoru_linear_M->Timing.stepSize1 +
      rozbeh_motoru_linear_M->Timing.clockTickH1 *
      rozbeh_motoru_linear_M->Timing.stepSize1 * 4294967296.0;
  }
}

/* Derivatives for root system: '<Root>' */
void rozbeh_motoru_linear_derivatives(void)
{
  /* Derivatives for TransferFcn: '<Root>/Transfer Fcn' */
  {
    ((StateDerivatives_rozbeh_motoru_linear *)
      rozbeh_motoru_linear_M->ModelData.derivs)->TransferFcn_CSTATE = 0.0;
    ((StateDerivatives_rozbeh_motoru_linear *)
      rozbeh_motoru_linear_M->ModelData.derivs)->TransferFcn_CSTATE +=
      (rozbeh_motoru_linear_P.TransferFcn_A)*
      rozbeh_motoru_linear_X.TransferFcn_CSTATE;
  }
}

/* Model initialize function */
void rozbeh_motoru_linear_initialize(void)
{
  /* S-Function Block: <Root>/DIR */

  /* no initial value should be set */

  /* S-Function Block: <Root>/Enable */

  /* no initial value should be set */

  /* S-Function Block: <Root>/Frequency Output */
  {
    {
      RTBIO_DriverIO(0, FREQUENCYOUTPUT, IOWRITE, 1,
                     &rozbeh_motoru_linear_P.FrequencyOutput_Channels,
                     &rozbeh_motoru_linear_P.FrequencyOutput_Frequency,
                     &rozbeh_motoru_linear_P.FrequencyOutput_Duty);
    }
  }

  /* S-Function Block: <Root>/Encoder Input */
  {
    ENCODERINPARM parm;
    parm.quad = (QUADMODE) 0;
    parm.index = (INDEXPULSE) 2;
    parm.infilter = rozbeh_motoru_linear_P.EncoderInput_InputFilter;
    RTBIO_DriverIO(0, ENCODERINPUT, IORESET, 1,
                   &rozbeh_motoru_linear_P.EncoderInput_Channels, NULL, &parm);
  }

  /* InitializeConditions for TransferFcn: '<Root>/Transfer Fcn' */
  rozbeh_motoru_linear_X.TransferFcn_CSTATE = 0.0;
}

/* Model terminate function */
void rozbeh_motoru_linear_terminate(void)
{
  /* S-Function Block: <Root>/DIR */

  /* no final value should be set */

  /* S-Function Block: <Root>/Enable */
  {
    RTBIO_DriverIO(0, DIGITALOUTPUT, IOWRITE, 1,
                   &rozbeh_motoru_linear_P.Enable_Channels,
                   &rozbeh_motoru_linear_P.Enable_FinalValue,
                   &rozbeh_motoru_linear_P.Enable_BitMode);
  }

  /* S-Function Block: <Root>/Frequency Output */
  {
    {
      RTBIO_DriverIO(0, FREQUENCYOUTPUT, IOWRITE, 1,
                     &rozbeh_motoru_linear_P.FrequencyOutput_Channels,
                     &rozbeh_motoru_linear_P.FrequencyOutput_FrequencyFinalValue,
                     &rozbeh_motoru_linear_P.FrequencyOutput_DutyFinalValue);
    }
  }
}

/*========================================================================*
 * Start of Classic call interface                                        *
 *========================================================================*/

/* Solver interface called by GRT_Main */
#ifndef USE_GENERATED_SOLVER

void rt_ODECreateIntegrationData(RTWSolverInfo *si)
{
  UNUSED_PARAMETER(si);
  return;
}                                      /* do nothing */

void rt_ODEDestroyIntegrationData(RTWSolverInfo *si)
{
  UNUSED_PARAMETER(si);
  return;
}                                      /* do nothing */

void rt_ODEUpdateContinuousStates(RTWSolverInfo *si)
{
  UNUSED_PARAMETER(si);
  return;
}                                      /* do nothing */

#endif

void MdlOutputs(int_T tid)
{
  rozbeh_motoru_linear_output();

  /* tid is required for a uniform function interface.
   * Argument tid is not used in the function. */
  UNUSED_PARAMETER(tid);
}

void MdlUpdate(int_T tid)
{
  rozbeh_motoru_linear_update();

  /* tid is required for a uniform function interface.
   * Argument tid is not used in the function. */
  UNUSED_PARAMETER(tid);
}

void MdlInitializeSizes(void)
{
}

void MdlInitializeSampleTimes(void)
{
}

void MdlInitialize(void)
{
}

void MdlStart(void)
{
  rozbeh_motoru_linear_initialize();
}

void MdlTerminate(void)
{
  rozbeh_motoru_linear_terminate();
}

RT_MODEL_rozbeh_motoru_linear *rozbeh_motoru_linear(void)
{
  /* Registration code */

  /* initialize non-finites */
  rt_InitInfAndNaN(sizeof(real_T));

  /* non-finite (run-time) assignments */
  rozbeh_motoru_linear_P.EncoderInput_InputFilter = rtInf;

  /* initialize real-time model */
  (void) memset((void *)rozbeh_motoru_linear_M, 0,
                sizeof(RT_MODEL_rozbeh_motoru_linear));

  {
    /* Setup solver object */
    rtsiSetSimTimeStepPtr(&rozbeh_motoru_linear_M->solverInfo,
                          &rozbeh_motoru_linear_M->Timing.simTimeStep);
    rtsiSetTPtr(&rozbeh_motoru_linear_M->solverInfo, &rtmGetTPtr
                (rozbeh_motoru_linear_M));
    rtsiSetStepSizePtr(&rozbeh_motoru_linear_M->solverInfo,
                       &rozbeh_motoru_linear_M->Timing.stepSize0);
    rtsiSetdXPtr(&rozbeh_motoru_linear_M->solverInfo,
                 &rozbeh_motoru_linear_M->ModelData.derivs);
    rtsiSetContStatesPtr(&rozbeh_motoru_linear_M->solverInfo,
                         &rozbeh_motoru_linear_M->ModelData.contStates);
    rtsiSetNumContStatesPtr(&rozbeh_motoru_linear_M->solverInfo,
      &rozbeh_motoru_linear_M->Sizes.numContStates);
    rtsiSetErrorStatusPtr(&rozbeh_motoru_linear_M->solverInfo,
                          (&rtmGetErrorStatus(rozbeh_motoru_linear_M)));
    rtsiSetRTModelPtr(&rozbeh_motoru_linear_M->solverInfo,
                      rozbeh_motoru_linear_M);
  }

  rtsiSetSimTimeStep(&rozbeh_motoru_linear_M->solverInfo, MAJOR_TIME_STEP);
  rozbeh_motoru_linear_M->ModelData.intgData.y =
    rozbeh_motoru_linear_M->ModelData.odeY;
  rozbeh_motoru_linear_M->ModelData.intgData.f[0] =
    rozbeh_motoru_linear_M->ModelData.odeF[0];
  rozbeh_motoru_linear_M->ModelData.intgData.f[1] =
    rozbeh_motoru_linear_M->ModelData.odeF[1];
  rozbeh_motoru_linear_M->ModelData.intgData.f[2] =
    rozbeh_motoru_linear_M->ModelData.odeF[2];
  rozbeh_motoru_linear_M->ModelData.contStates = ((real_T *)
    &rozbeh_motoru_linear_X);
  rtsiSetSolverData(&rozbeh_motoru_linear_M->solverInfo, (void *)
                    &rozbeh_motoru_linear_M->ModelData.intgData);
  rtsiSetSolverName(&rozbeh_motoru_linear_M->solverInfo,"ode3");

  /* Initialize timing info */
  {
    int_T *mdlTsMap = rozbeh_motoru_linear_M->Timing.sampleTimeTaskIDArray;
    mdlTsMap[0] = 0;
    mdlTsMap[1] = 1;
    rozbeh_motoru_linear_M->Timing.sampleTimeTaskIDPtr = (&mdlTsMap[0]);
    rozbeh_motoru_linear_M->Timing.sampleTimes =
      (&rozbeh_motoru_linear_M->Timing.sampleTimesArray[0]);
    rozbeh_motoru_linear_M->Timing.offsetTimes =
      (&rozbeh_motoru_linear_M->Timing.offsetTimesArray[0]);

    /* task periods */
    rozbeh_motoru_linear_M->Timing.sampleTimes[0] = (0.0);
    rozbeh_motoru_linear_M->Timing.sampleTimes[1] = (0.0001);

    /* task offsets */
    rozbeh_motoru_linear_M->Timing.offsetTimes[0] = (0.0);
    rozbeh_motoru_linear_M->Timing.offsetTimes[1] = (0.0);
  }

  rtmSetTPtr(rozbeh_motoru_linear_M, &rozbeh_motoru_linear_M->Timing.tArray[0]);

  {
    int_T *mdlSampleHits = rozbeh_motoru_linear_M->Timing.sampleHitArray;
    mdlSampleHits[0] = 1;
    mdlSampleHits[1] = 1;
    rozbeh_motoru_linear_M->Timing.sampleHits = (&mdlSampleHits[0]);
  }

  rtmSetTFinal(rozbeh_motoru_linear_M, -1);
  rozbeh_motoru_linear_M->Timing.stepSize0 = 0.0001;
  rozbeh_motoru_linear_M->Timing.stepSize1 = 0.0001;

  /* External mode info */
  rozbeh_motoru_linear_M->Sizes.checksums[0] = (145764500U);
  rozbeh_motoru_linear_M->Sizes.checksums[1] = (4285770292U);
  rozbeh_motoru_linear_M->Sizes.checksums[2] = (3050103335U);
  rozbeh_motoru_linear_M->Sizes.checksums[3] = (4150506588U);

  {
    static const sysRanDType rtAlwaysEnabled = SUBSYS_RAN_BC_ENABLE;
    static RTWExtModeInfo rt_ExtModeInfo;
    static const sysRanDType *systemRan[1];
    rozbeh_motoru_linear_M->extModeInfo = (&rt_ExtModeInfo);
    rteiSetSubSystemActiveVectorAddresses(&rt_ExtModeInfo, systemRan);
    systemRan[0] = &rtAlwaysEnabled;
    rteiSetModelMappingInfoPtr(rozbeh_motoru_linear_M->extModeInfo,
      &rozbeh_motoru_linear_M->SpecialInfo.mappingInfo);
    rteiSetChecksumsPtr(rozbeh_motoru_linear_M->extModeInfo,
                        rozbeh_motoru_linear_M->Sizes.checksums);
    rteiSetTPtr(rozbeh_motoru_linear_M->extModeInfo, rtmGetTPtr
                (rozbeh_motoru_linear_M));
  }

  rozbeh_motoru_linear_M->solverInfoPtr = (&rozbeh_motoru_linear_M->solverInfo);
  rozbeh_motoru_linear_M->Timing.stepSize = (0.0001);
  rtsiSetFixedStepSize(&rozbeh_motoru_linear_M->solverInfo, 0.0001);
  rtsiSetSolverMode(&rozbeh_motoru_linear_M->solverInfo,
                    SOLVER_MODE_SINGLETASKING);

  /* block I/O */
  rozbeh_motoru_linear_M->ModelData.blockIO = ((void *) &rozbeh_motoru_linear_B);
  (void) memset(((void *) &rozbeh_motoru_linear_B), 0,
                sizeof(BlockIO_rozbeh_motoru_linear));

  /* parameters */
  rozbeh_motoru_linear_M->ModelData.defaultParam = ((real_T *)
    &rozbeh_motoru_linear_P);

  /* states (continuous) */
  {
    real_T *x = (real_T *) &rozbeh_motoru_linear_X;
    rozbeh_motoru_linear_M->ModelData.contStates = (x);
    (void) memset((void *)&rozbeh_motoru_linear_X, 0,
                  sizeof(ContinuousStates_rozbeh_motoru_linear));
  }

  /* states (dwork) */
  rozbeh_motoru_linear_M->Work.dwork = ((void *) &rozbeh_motoru_linear_DWork);
  (void) memset((void *)&rozbeh_motoru_linear_DWork, 0,
                sizeof(D_Work_rozbeh_motoru_linear));

  /* data type transition information */
  {
    static DataTypeTransInfo dtInfo;
    (void) memset((char_T *) &dtInfo, 0,
                  sizeof(dtInfo));
    rozbeh_motoru_linear_M->SpecialInfo.mappingInfo = (&dtInfo);
    dtInfo.numDataTypes = 14;
    dtInfo.dataTypeSizes = &rtDataTypeSizes[0];
    dtInfo.dataTypeNames = &rtDataTypeNames[0];

    /* Block I/O transition table */
    dtInfo.B = &rtBTransTable;

    /* Parameters transition table */
    dtInfo.P = &rtPTransTable;
  }

  /* Initialize Sizes */
  rozbeh_motoru_linear_M->Sizes.numContStates = (1);/* Number of continuous states */
  rozbeh_motoru_linear_M->Sizes.numY = (0);/* Number of model outputs */
  rozbeh_motoru_linear_M->Sizes.numU = (0);/* Number of model inputs */
  rozbeh_motoru_linear_M->Sizes.sysDirFeedThru = (0);/* The model is not direct feedthrough */
  rozbeh_motoru_linear_M->Sizes.numSampTimes = (2);/* Number of sample times */
  rozbeh_motoru_linear_M->Sizes.numBlocks = (25);/* Number of blocks */
  rozbeh_motoru_linear_M->Sizes.numBlockIO = (4);/* Number of block outputs */
  rozbeh_motoru_linear_M->Sizes.numBlockPrms = (35);/* Sum of parameter "widths" */
  return rozbeh_motoru_linear_M;
}

/*========================================================================*
 * End of Classic call interface                                          *
 *========================================================================*/
