class bandStop50Hz
{ // Block signals and states (auto storage) for system ‘<Root>‘
public struct DW {
public double Delay11_DSTATE; /* ‘<S1>/Delay11‘ */
public double Delay21_DSTATE; /* ‘<S1>/Delay21‘ */
public double Delay12_DSTATE; /* ‘<S1>/Delay12‘ */
public double Delay22_DSTATE; /* ‘<S1>/Delay22‘ */
}
//External inputs (root inport signals with auto storage)
public struct ExtU
{ public double Input; /* ‘<Root>/Input‘ */
}
/* External outputs (root outports fed by signals with auto storage) */
public struct ExtY { public double Output; /* ‘<Root>/Output‘ */
}
/* Block signals and states (auto storage) */
public DW rtDW;
/* External inputs (root inport signals with auto storage) */
public ExtU rtU;
/* External outputs (root outports fed by signals with auto storage) */
public ExtY rtY;
public void bandstop50Hzat1k0_step()
{ double rtb_Delay11; double rtb_SumA31; double rtb_Delay12; double rtb_SumA32;
/* Delay: ‘<S1>/Delay11‘ */ rtb_Delay11 = rtDW.Delay11_DSTATE;
/* Sum: ‘<S1>/SumA31‘ incorporates: * Delay: ‘<S1>/Delay11‘ * Delay: ‘<S1>/Delay21‘ * Gain: ‘<S1>/a(2)(1)‘ * Gain: ‘<S1>/a(3)(1)‘ * Gain: ‘<S1>/s(1)‘ * Inport: ‘<Root>/Input‘ * Sum: ‘<S1>/SumA21‘ */
rtb_SumA31 = (0.995566971680792 * rtU.Input - -1.8908514634621669 * rtDW.Delay11_DSTATE) - 0.991033147905415 * rtDW.Delay21_DSTATE;
/* Delay: ‘<S1>/Delay12‘ */ rtb_Delay12 = rtDW.Delay12_DSTATE;
/* Sum: ‘<S1>/SumA32‘ incorporates: * Delay: ‘<S1>/Delay11‘ * Delay: ‘<S1>/Delay12‘ * Delay: ‘<S1>/Delay21‘ * Delay: ‘<S1>/Delay22‘ * Gain: ‘<S1>/a(2)(2)‘ * Gain: ‘<S1>/a(3)(2)‘ * Gain: ‘<S1>/b(2)(1)‘ * Gain: ‘<S1>/s(2)‘ * Sum: ‘<S1>/SumA22‘ * Sum: ‘<S1>/SumB21‘ * Sum: ‘<S1>/SumB31‘ */
rtb_SumA32 = (((-1.9021505794142433 * rtDW.Delay11_DSTATE + rtb_SumA31) + rtDW.Delay21_DSTATE) * 0.995566971680792 - -1.8965480696203423 * rtDW.Delay12_DSTATE) - 0.99127405848172945 * rtDW.Delay22_DSTATE;
/* Outport: ‘<Root>/Output‘ incorporates: * Delay: ‘<S1>/Delay12‘ * Delay: ‘<S1>/Delay22‘ * Gain: ‘<S1>/b(2)(2)‘ * Sum: ‘<S1>/SumB22‘ * Sum: ‘<S1>/SumB32‘ */
rtY.Output = (-1.9021505794142433 * rtDW.Delay12_DSTATE + rtb_SumA32) + rtDW.Delay22_DSTATE;
/* Update for Delay: ‘<S1>/Delay11‘ */
rtDW.Delay11_DSTATE = rtb_SumA31;
/* Update for Delay: ‘<S1>/Delay21‘ */
rtDW.Delay21_DSTATE = rtb_Delay11;
/* Update for Delay: ‘<S1>/Delay12‘ */
rtDW.Delay12_DSTATE = rtb_SumA32;
/* Update for Delay: ‘<S1>/Delay22‘ */
rtDW.Delay22_DSTATE = rtb_Delay12; }
public void initialize()
{ rtDW.Delay11_DSTATE = 0.0;
rtDW.Delay21_DSTATE = 0.0;
rtDW.Delay12_DSTATE = 0.0;
rtDW.Delay22_DSTATE = 0.0;
rtU.Input = 0.0;
rtY.Output = 0.0; //optional;
}
}