sim12ex9.mdl
上传用户:eighthdate
上传日期:2014-05-24
资源大小:270k
文件大小:17k
源码类别:

其他行业

开发平台:

Matlab

  1. Model {
  2.   Name   "sim12ex9"
  3.   Version   2.09
  4.   SimParamPage   Solver
  5.   SampleTimeColors   off
  6.   InvariantConstants   off
  7.   WideVectorLines   off
  8.   ShowLineWidths   off
  9.   PaperOrientation   landscape
  10.   PaperType   usletter
  11.   PaperUnits   inches
  12.   StartTime   "0.0"
  13.   StopTime   "15"
  14.   Solver   ode23
  15.   RelTol   "1e-3"
  16.   AbsTol   "1e-3"
  17.   Refine   "1"
  18.   MaxStep   ".05"
  19.   InitialStep   "auto"
  20.   FixedStep   "auto"
  21.   MaxOrder   5
  22.   OutputOption   RefineOutputTimes
  23.   OutputTimes   "[]"
  24.   LoadExternalInput   off
  25.   ExternalInput   "[t, u]"
  26.   SaveTime   off
  27.   TimeSaveName   "tout"
  28.   SaveState   off
  29.   StateSaveName   "xout"
  30.   SaveOutput   off
  31.   OutputSaveName   "yout"
  32.   LoadInitialState   off
  33.   InitialState   "xInitial"
  34.   SaveFinalState   off
  35.   FinalStateName   "xFinal"
  36.   LimitMaxRows   off
  37.   MaxRows   "1000"
  38.   Decimation   "1"
  39.   AlgebraicLoopMsg   warning
  40.   MinStepSizeMsg   warning
  41.   UnconnectedInputMsg   warning
  42.   UnconnectedOutputMsg   warning
  43.   UnconnectedLineMsg   warning
  44.   ConsistencyChecking   off
  45.   ZeroCross   on
  46.   SimulationMode   normal
  47.   RTWSystemTargetFile   "grt.tlc"
  48.   RTWInlineParameters   off
  49.   RTWRetainRTWFile   off
  50.   RTWTemplateMakefile   "grt_vc.tmf"
  51.   RTWMakeCommand   "make_rtw"
  52.   RTWGenerateCodeOnly   off
  53.   ExtModeMexFile   "ext_comm"
  54.   ExtModeBatchMode   off
  55.   BlockDefaults {
  56.     Orientation     right
  57.     ForegroundColor     black
  58.     BackgroundColor     white
  59.     DropShadow     off
  60.     NamePlacement     normal
  61.     FontName     "Helvetica"
  62.     FontSize     10
  63.     FontWeight     normal
  64.     FontAngle     normal
  65.     ShowName     on
  66.   }
  67.   AnnotationDefaults {
  68.     HorizontalAlignment     center
  69.     VerticalAlignment     middle
  70.     ForegroundColor     black
  71.     BackgroundColor     white
  72.     DropShadow     off
  73.     FontName     "Helvetica"
  74.     FontSize     10
  75.     FontWeight     normal
  76.     FontAngle     normal
  77.   }
  78.   LineDefaults {
  79.     FontName     "Helvetica"
  80.     FontSize     9
  81.     FontWeight     normal
  82.     FontAngle     normal
  83.   }
  84.   System {
  85.     Name     "sim12ex9"
  86.     Location     [102, 58, 960, 751]
  87.     Open     on
  88.     ScreenColor     white
  89.     Block {
  90.       BlockType       Gain
  91.       Name       "1/R"
  92.       Position       [230, 113, 285, 167]
  93.       Orientation       left
  94.       Gain       "20"
  95.     }
  96.     Block {
  97.       BlockType       TransferFcn
  98.       Name       "Amplifier"
  99.       Position       [240, 409, 310, 461]
  100.       Numerator       "10"
  101.       Denominator       "[0.1  1]"
  102.     }
  103.     Block {
  104.       BlockType       TransferFcn
  105.       Name       "Exciter"
  106.       Position       [335, 411, 405, 459]
  107.       Numerator       "1"
  108.       Denominator       "[0.4  1]"
  109.     }
  110.     Block {
  111.       BlockType       TransferFcn
  112.       Name       "Generator"
  113.       Position       [505, 399, 575, 451]
  114.       Numerator       "[0.8]"
  115.       Denominator       "[ 1.4 1]"
  116.     }
  117.     Block {
  118.       BlockType       TransferFcn
  119.       Name       "Governor"
  120.       Position       [110, 182, 175, 228]
  121.       Numerator       "[1]"
  122.       Denominator       "[0.2   1]"
  123.     }
  124.     Block {
  125.       BlockType       TransferFcn
  126.       Name       "Inertia & load"
  127.       Position       [415, 182, 495, 228]
  128.       Numerator       "[1]"
  129.       Denominator       "[10  0.8]"
  130.     }
  131.     Block {
  132.       BlockType       Integrator
  133.       Name       "Integrator"
  134.       Ports       [1, 1, 0, 0, 0]
  135.       Position       [155, 68, 185, 112]
  136.       Orientation       left
  137.       ExternalReset       none
  138.       InitialConditionSource      internal
  139.       InitialCondition       "0"
  140.       LimitOutput       off
  141.       UpperSaturationLimit      "inf"
  142.       LowerSaturationLimit      "-inf"
  143.       ShowSaturationPort      off
  144.       ShowStatePort       off
  145.       AbsoluteTolerance       "auto"
  146.     }
  147.     Block {
  148.       BlockType       Integrator
  149.       Name       "Integrator1"
  150.       Ports       [1, 1, 0, 0, 0]
  151.       Position       [590, 187, 620, 223]
  152.       ExternalReset       none
  153.       InitialConditionSource      internal
  154.       InitialCondition       "0"
  155.       LimitOutput       off
  156.       UpperSaturationLimit      "inf"
  157.       LowerSaturationLimit      "-inf"
  158.       ShowSaturationPort      off
  159.       ShowStatePort       off
  160.       AbsoluteTolerance       "auto"
  161.     }
  162.     Block {
  163.       BlockType       Gain
  164.       Name       "K1=Ps"
  165.       Position       [355, 253, 405, 307]
  166.       Orientation       left
  167.       Gain       "1.5"
  168.     }
  169.     Block {
  170.       BlockType       Gain
  171.       Name       "K2"
  172.       Position       [480, 305, 535, 365]
  173.       Orientation       left
  174.       Gain       ".2"
  175.     }
  176.     Block {
  177.       BlockType       Gain
  178.       Name       "K4"
  179.       Position       [405, 360, 465, 410]
  180.       Orientation       down
  181.       Gain       "1.4"
  182.     }
  183.     Block {
  184.       BlockType       Gain
  185.       Name       "K5"
  186.       Position       [635, 325, 695, 375]
  187.       Orientation       down
  188.       Gain       "-0.1"
  189.     }
  190.     Block {
  191.       BlockType       Gain
  192.       Name       "K6"
  193.       Position       [615, 400, 675, 450]
  194.       Gain       ".5"
  195.     }
  196.     Block {
  197.       BlockType       Gain
  198.       Name       "KI"
  199.       Position       [65, 67, 115, 113]
  200.       Orientation       left
  201.       Gain       "6"
  202.     }
  203.     Block {
  204.       BlockType       SubSystem
  205.       Name       "PID Controller"
  206.       Ports       [1, 1, 0, 0, 0]
  207.       Position       [170, 419, 210, 451]
  208.       ShowPortLabels       off
  209.       MaskType       "PID Controller"
  210.       MaskDescription       "Enter expressions for proportional, integral, "
  211.       "and derivative terms.nP+I/s+Ds"
  212.       MaskHelp       "This block implements a PID controller where "
  213.       "parameters are entered for the Proportional, "
  214.       "Integral and Derivative terms. Unmask this "
  215.       "block to see how it works. The derivative "
  216.       "term is implemented using a true derivative "
  217.       "block."
  218.       MaskPromptString       "Proportional:|Integral|Derivative:"
  219.       MaskStyleString       "edit,edit,edit"
  220.       MaskInitialization      "P=@1; I=@2; D=@3;"
  221.       MaskDisplay       "disp('PID')"
  222.       MaskIconFrame       on
  223.       MaskIconOpaque       on
  224.       MaskIconRotate       none
  225.       MaskIconUnits       autoscale
  226.       MaskValueString       "1|0.25|0.3"
  227.       System {
  228. Name "PID Controller"
  229. Location [0, 0, 362, 244]
  230. Open off
  231. ScreenColor white
  232. Block {
  233.   BlockType   Inport
  234.   Name   "In_1"
  235.   Position   [25, 65, 45, 85]
  236.   Port   "1"
  237.   PortWidth   "-1"
  238.   SampleTime   "-1"
  239. }
  240. Block {
  241.   BlockType   Gain
  242.   Name   "D"
  243.   Position   [95, 129, 115, 151]
  244.   Gain   "D"
  245. }
  246. Block {
  247.   BlockType   Derivative
  248.   Name   "Derivative"
  249.   Position   [150, 128, 190, 152]
  250. }
  251. Block {
  252.   BlockType   TransferFcn
  253.   Name   "Integral"
  254.   Position   [110, 57, 145, 93]
  255.   Numerator   "[I]"
  256.   Denominator   "[1 0]"
  257. }
  258. Block {
  259.   BlockType   Gain
  260.   Name   "Proportional"
  261.   Position   [120, 13, 140, 37]
  262.   Gain   "P"
  263. }
  264. Block {
  265.   BlockType   Sum
  266.   Name   "Sum"
  267.   Ports   [3, 1, 0, 0, 0]
  268.   Position   [245, 57, 265, 93]
  269.   Inputs   "+++"
  270. }
  271. Block {
  272.   BlockType   Outport
  273.   Name   "Out_1"
  274.   Position   [290, 65, 310, 85]
  275.   Port   "1"
  276.   OutputWhenDisabled   held
  277.   InitialOutput   "0"
  278. }
  279. Line {
  280.   SrcBlock   "Proportional"
  281.   SrcPort   1
  282.   Points   [65, 0; 0, 40]
  283.   DstBlock   "Sum"
  284.   DstPort   1
  285. }
  286. Line {
  287.   SrcBlock   "Integral"
  288.   SrcPort   1
  289.   DstBlock   "Sum"
  290.   DstPort   2
  291. }
  292. Line {
  293.   SrcBlock   "Derivative"
  294.   SrcPort   1
  295.   Points   [20, 0; 0, -55]
  296.   DstBlock   "Sum"
  297.   DstPort   3
  298. }
  299. Line {
  300.   SrcBlock   "In_1"
  301.   SrcPort   1
  302.   Points   [15, 0]
  303.   Branch {
  304.     Points     [15, 0]
  305.     Branch {
  306.       Points       [0, -50]
  307.       DstBlock       "Proportional"
  308.       DstPort       1
  309.     }
  310.     Branch {
  311.       DstBlock       "Integral"
  312.       DstPort       1
  313.     }
  314.   }
  315.   Branch {
  316.     Points     [0, 65]
  317.     DstBlock     "D"
  318.     DstPort     1
  319.   }
  320. }
  321. Line {
  322.   SrcBlock   "Sum"
  323.   SrcPort   1
  324.   DstBlock   "Out_1"
  325.   DstPort   1
  326. }
  327. Line {
  328.   SrcBlock   "D"
  329.   SrcPort   1
  330.   DstBlock   "Derivative"
  331.   DstPort   1
  332. }
  333.       }
  334.     }
  335.     Block {
  336.       BlockType       Scope
  337.       Name       "Scope 2"
  338.       Ports       [1, 0, 0, 0, 0]
  339.       Position       [770, 392, 815, 438]
  340.       Floating       off
  341.       Location       [188, 365, 512, 604]
  342.       Open       off
  343.       Grid       on
  344.       TickLabels       on
  345.       ZoomMode       on
  346.       TimeRange       "auto"
  347.       YMin       "-5"
  348.       YMax       "5"
  349.       SaveToWorkspace       off
  350.       SaveName       "ScopeData"
  351.       LimitMaxRows       on
  352.       MaxRows       "5000"
  353.       Decimation       "1"
  354.       SampleInput       off
  355.       SampleTime       "0"
  356.     }
  357.     Block {
  358.       BlockType       Scope
  359.       Name       "Scope1"
  360.       Ports       [1, 0, 0, 0, 0]
  361.       Position       [575, 106, 615, 144]
  362.       Floating       off
  363.       Location       [188, 365, 512, 604]
  364.       Open       off
  365.       Grid       on
  366.       TickLabels       on
  367.       ZoomMode       on
  368.       TimeRange       "auto"
  369.       YMin       "-5"
  370.       YMax       "5"
  371.       SaveToWorkspace       off
  372.       SaveName       "ScopeData"
  373.       LimitMaxRows       on
  374.       MaxRows       "5000"
  375.       Decimation       "1"
  376.       SampleInput       off
  377.       SampleTime       "0"
  378.     }
  379.     Block {
  380.       BlockType       TransferFcn
  381.       Name       "Sensor"
  382.       Position       [330, 484, 425, 536]
  383.       Orientation       left
  384.       Numerator       "[1]"
  385.       Denominator       "[0.05  1]"
  386.     }
  387.     Block {
  388.       BlockType       Step
  389.       Name       "Step Input"
  390.       Position       [320, 150, 340, 170]
  391.       Orientation       down
  392.       Time       "2"
  393.       Before       "0.2"
  394.       After       ".2"
  395.     }
  396.     Block {
  397.       BlockType       Step
  398.       Name       "Step Input1"
  399.       Position       [20, 407, 60, 443]
  400.       Time       "12"
  401.       Before       "1"
  402.       After       "1"
  403.     }
  404.     Block {
  405.       BlockType       Sum
  406.       Name       "Sum"
  407.       Ports       [3, 1, 0, 0, 0]
  408.       Position       [365, 181, 390, 229]
  409.       Inputs       "-+-"
  410.     }
  411.     Block {
  412.       BlockType       Sum
  413.       Name       "Sum1"
  414.       Ports       [2, 1, 0, 0, 0]
  415.       Position       [55, 187, 75, 223]
  416.       Inputs       "--"
  417.     }
  418.     Block {
  419.       BlockType       Sum
  420.       Name       "Sum2"
  421.       Ports       [2, 1, 0, 0, 0]
  422.       Position       [100, 415, 135, 455]
  423.       Inputs       "+-"
  424.     }
  425.     Block {
  426.       BlockType       Sum
  427.       Name       "Sum3"
  428.       Ports       [2, 1, 0, 0, 0]
  429.       Position       [290, 270, 310, 310]
  430.       Orientation       left
  431.       Inputs       "++"
  432.     }
  433.     Block {
  434.       BlockType       Sum
  435.       Name       "Sum4"
  436.       Ports       [2, 1, 0, 0, 0]
  437.       Position       [455, 407, 475, 443]
  438.       Inputs       "-+"
  439.     }
  440.     Block {
  441.       BlockType       Sum
  442.       Name       "Sum5"
  443.       Ports       [2, 1, 0, 0, 0]
  444.       Position       [705, 397, 725, 433]
  445.       Inputs       "++"
  446.     }
  447.     Block {
  448.       BlockType       TransferFcn
  449.       Name       "Turbine"
  450.       Position       [205, 183, 275, 227]
  451.       Numerator       "[1]"
  452.       Denominator       "[0.5  1]"
  453.     }
  454.     Line {
  455.       SrcBlock       "Inertia & load"
  456.       SrcPort       1
  457.       Points       [20, 0]
  458.       Branch {
  459. Points [0, -65]
  460. Branch {
  461.   DstBlock   "1/R"
  462.   DstPort   1
  463. }
  464. Branch {
  465.   Points   [0, -50]
  466.   DstBlock   "Integrator"
  467.   DstPort   1
  468. }
  469.       }
  470.       Branch {
  471. Points [30, 0]
  472. Branch {
  473.   Points   [0, -80]
  474.   DstBlock   "Scope1"
  475.   DstPort   1
  476. }
  477. Branch {
  478.   DstBlock   "Integrator1"
  479.   DstPort   1
  480. }
  481.       }
  482.     }
  483.     Line {
  484.       SrcBlock       "Integrator1"
  485.       SrcPort       1
  486.       Points       [40, 0; 0, 75]
  487.       Branch {
  488. Points [-230, 0]
  489. Branch {
  490.   DstBlock   "K4"
  491.   DstPort   1
  492. }
  493. Branch {
  494.   DstBlock   "K1=Ps"
  495.   DstPort   1
  496. }
  497.       }
  498.       Branch {
  499. DstBlock "K5"
  500. DstPort 1
  501.       }
  502.     }
  503.     Line {
  504.       SrcBlock       "KI"
  505.       SrcPort       1
  506.       Points       [-35, 0; 0, 125]
  507.       DstBlock       "Sum1"
  508.       DstPort       2
  509.     }
  510.     Line {
  511.       SrcBlock       "Integrator"
  512.       SrcPort       1
  513.       DstBlock       "KI"
  514.       DstPort       1
  515.     }
  516.     Line {
  517.       SrcBlock       "1/R"
  518.       SrcPort       1
  519.       Points       [-185, 0]
  520.       DstBlock       "Sum1"
  521.       DstPort       1
  522.     }
  523.     Line {
  524.       SrcBlock       "K2"
  525.       SrcPort       1
  526.       Points       [-140, 0; 0, -35]
  527.       DstBlock       "Sum3"
  528.       DstPort       2
  529.     }
  530.     Line {
  531.       SrcBlock       "K4"
  532.       SrcPort       1
  533.       DstBlock       "Sum4"
  534.       DstPort       1
  535.     }
  536.     Line {
  537.       SrcBlock       "Generator"
  538.       SrcPort       1
  539.       Points       [10, 0]
  540.       Branch {
  541. Points [0, -90]
  542. DstBlock "K2"
  543. DstPort 1
  544.       }
  545.       Branch {
  546. DstBlock "K6"
  547. DstPort 1
  548.       }
  549.     }
  550.     Line {
  551.       SrcBlock       "Sum5"
  552.       SrcPort       1
  553.       Points       [10, 0]
  554.       Branch {
  555. Points [0, 95]
  556. DstBlock "Sensor"
  557. DstPort 1
  558.       }
  559.       Branch {
  560. DstBlock "Scope 2"
  561. DstPort 1
  562.       }
  563.     }
  564.     Line {
  565.       SrcBlock       "K5"
  566.       SrcPort       1
  567.       Points       [0, 25]
  568.       DstBlock       "Sum5"
  569.       DstPort       1
  570.     }
  571.     Line {
  572.       SrcBlock       "K1=Ps"
  573.       SrcPort       1
  574.       DstBlock       "Sum3"
  575.       DstPort       1
  576.     }
  577.     Line {
  578.       SrcBlock       "K6"
  579.       SrcPort       1
  580.       DstBlock       "Sum5"
  581.       DstPort       2
  582.     }
  583.     Line {
  584.       SrcBlock       "Sum4"
  585.       SrcPort       1
  586.       DstBlock       "Generator"
  587.       DstPort       1
  588.     }
  589.     Line {
  590.       SrcBlock       "Exciter"
  591.       SrcPort       1
  592.       DstBlock       "Sum4"
  593.       DstPort       2
  594.     }
  595.     Line {
  596.       SrcBlock       "Sum3"
  597.       SrcPort       1
  598.       Points       [0, -70]
  599.       DstBlock       "Sum"
  600.       DstPort       3
  601.     }
  602.     Line {
  603.       SrcBlock       "PID Controller"
  604.       SrcPort       1
  605.       DstBlock       "Amplifier"
  606.       DstPort       1
  607.     }
  608.     Line {
  609.       SrcBlock       "Sum2"
  610.       SrcPort       1
  611.       DstBlock       "PID Controller"
  612.       DstPort       1
  613.     }
  614.     Line {
  615.       SrcBlock       "Amplifier"
  616.       SrcPort       1
  617.       DstBlock       "Exciter"
  618.       DstPort       1
  619.     }
  620.     Line {
  621.       SrcBlock       "Sensor"
  622.       SrcPort       1
  623.       Points       [-240, 0]
  624.       DstBlock       "Sum2"
  625.       DstPort       2
  626.     }
  627.     Line {
  628.       SrcBlock       "Step Input1"
  629.       SrcPort       1
  630.       DstBlock       "Sum2"
  631.       DstPort       1
  632.     }
  633.     Line {
  634.       SrcBlock       "Step Input"
  635.       SrcPort       1
  636.       Points       [0, 15]
  637.       DstBlock       "Sum"
  638.       DstPort       1
  639.     }
  640.     Line {
  641.       SrcBlock       "Sum1"
  642.       SrcPort       1
  643.       DstBlock       "Governor"
  644.       DstPort       1
  645.     }
  646.     Line {
  647.       SrcBlock       "Sum"
  648.       SrcPort       1
  649.       DstBlock       "Inertia & load"
  650.       DstPort       1
  651.     }
  652.     Line {
  653.       SrcBlock       "Turbine"
  654.       SrcPort       1
  655.       DstBlock       "Sum"
  656.       DstPort       2
  657.     }
  658.     Line {
  659.       SrcBlock       "Governor"
  660.       SrcPort       1
  661.       DstBlock       "Turbine"
  662.       DstPort       1
  663.     }
  664.     Annotation {
  665.       Position       [383, 578]
  666.       FontSize       12
  667.       Text       "Simulation block diagram for Example 12.9"
  668.     }
  669.     Annotation {
  670.       Position       [537, 217]
  671.       VerticalAlignment       top
  672.       Text       "Dw"
  673.     }
  674.     Annotation {
  675.       Position       [647, 182]
  676.       VerticalAlignment       top
  677.       Text       "Dd"
  678.     }
  679.     Annotation {
  680.       Position       [417, 412]
  681.       VerticalAlignment       top
  682.       Text       "Vf"
  683.     }
  684.     Annotation {
  685.       Position       [320, 388]
  686.       VerticalAlignment       top
  687.       Text       "VR"
  688.     }
  689.     Annotation {
  690.       Position       [587, 427]
  691.       VerticalAlignment       top
  692.       Text       "E'"
  693.     }
  694.     Annotation {
  695.       Position       [732, 382]
  696.       VerticalAlignment       top
  697.       Text       "Vt"
  698.     }
  699.     Annotation {
  700.       Position       [132, 393]
  701.       VerticalAlignment       top
  702.       Text       "Ve"
  703.     }
  704.     Annotation {
  705.       Position       [37, 372]
  706.       VerticalAlignment       top
  707.       Text       "Vref"
  708.     }
  709.     Annotation {
  710.       Position       [302, 182]
  711.       VerticalAlignment       top
  712.       Text       "DPm"
  713.     }
  714.   }
  715. }