Model { Name "ofbctrl_ex2" Version 2.20 SimParamPage Solver SampleTimeColors off InvariantConstants off WideVectorLines off ShowLineWidths off StartTime "0.0" StopTime "10" Solver ode23s RelTol "1e-8" AbsTol "1e-8" Refine "1" MaxStep "auto" InitialStep "auto" FixedStep "1e-4" MaxOrder 5 OutputOption RefineOutputTimes OutputTimes "[]" LoadExternalInput off ExternalInput "[t, u]" SaveTime on TimeSaveName "tout" SaveState off StateSaveName "xout" SaveOutput on OutputSaveName "yout" LoadInitialState off InitialState "xInitial" SaveFinalState off FinalStateName "xFinal" LimitMaxRows off MaxRows "1000" Decimation "1" AlgebraicLoopMsg warning MinStepSizeMsg warning UnconnectedInputMsg warning UnconnectedOutputMsg warning UnconnectedLineMsg warning ConsistencyChecking off ZeroCross on SimulationMode normal RTWSystemTargetFile "grt.tlc" RTWInlineParameters off RTWPlaceOutputsASAP off RTWRetainRTWFile off RTWTemplateMakefile "grt_default_tmf" RTWMakeCommand "make_rtw" RTWGenerateCodeOnly off ExtModeMexFile "ext_comm" ExtModeBatchMode off BlockDefaults { Orientation right ForegroundColor black BackgroundColor white DropShadow off NamePlacement normal FontName "Helvetica" FontSize 10 FontWeight normal FontAngle normal ShowName on } AnnotationDefaults { HorizontalAlignment center VerticalAlignment middle ForegroundColor black BackgroundColor white DropShadow off FontName "Helvetica" FontSize 10 FontWeight normal FontAngle normal } LineDefaults { FontName "Helvetica" FontSize 9 FontWeight normal FontAngle normal } System { Name "ofbctrl_ex2" Location [10, 483, 510, 743] Open on ToolBar on StatusBar on ScreenColor white PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType Constant Name "Constant" Position [15, 50, 35, 70] ShowName off Value "s" } Block { BlockType Fcn Name "Controller" Position [125, 45, 185, 75] Expr "-exp(u(2)^2)*(u(2)^2+u(1)+u(2))" } Block { BlockType Fcn Name "Fcn" Position [345, 54, 370, 76] ShowName off Expr "abs(u)>1e300" } Block { BlockType Mux Name "Mux" Ports [2, 1, 0, 0, 0] Position [285, 102, 320, 138] Inputs "2" } Block { BlockType Scope Name "Scope" Ports [1, 0, 0, 0, 0] Position [340, 105, 370, 135] Floating off Location [284, 83, 896, 471] Open on Grid on TickLabels on ZoomMode yonly TimeRange "auto" YMin "-12 " YMax "12 " SaveToWorkspace off SaveName "ScopeData" LimitMaxRows on MaxRows "5000" Decimation "1" SampleInput off SampleTime "0" } Block { BlockType Scope Name "Scope1" Ports [1, 0, 0, 0, 0] Position [290, 20, 320, 50] Floating off Location [557, 135, 881, 374] Open on Grid on TickLabels on ZoomMode on TimeRange "auto" YMin "-5" YMax "5" SaveToWorkspace off SaveName "ScopeData" LimitMaxRows on MaxRows "5000" Decimation "1" SampleInput off SampleTime "0" } Block { BlockType Stop Name "Stop Simulation" Position [425, 27, 460, 63] } Block { BlockType Switch Name "Switch" Position [65, 45, 95, 75] Threshold ".5" } Block { BlockType ToWorkspace Name "To Workspace" Position [360, 154, 390, 186] VariableName "x" Buffer "inf" Decimation "1" SampleTime "-1" } Block { BlockType SubSystem Name "observer" Ports [2, 1, 0, 0, 0] Position [215, 151, 245, 184] ShowPortLabels on System { Name "observer" Location [557, 499, 986, 721] Open on ToolBar off StatusBar off ScreenColor white PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType Inport Name "u" Position [35, 138, 65, 152] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Inport Name "y" Position [20, 33, 50, 47] Port "2" PortWidth "-1" SampleTime "-1" } Block { BlockType Fcn Name "Fcn" Position [60, 82, 90, 98] ShowName off Expr "u(2)^2" } Block { BlockType Fcn Name "Fcn1" Position [100, 166, 130, 184] ShowName off Expr "exp(-u^2)" } Block { BlockType Gain Name "Gain" Position [130, 23, 155, 37] Gain "1/rho" } Block { BlockType Gain Name "Gain1" Position [125, 108, 150, 122] ShowName off Gain "1/(rho)^2" } Block { BlockType Gain Name "Gain2" Position [130, 81, 150, 99] ShowName off Gain "1" } Block { BlockType Integrator Name "Integrator" Ports [1, 1, 0, 0, 0] Position [225, 25, 255, 55] ExternalReset none InitialConditionSource internal InitialCondition "0" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Integrator Name "Integrator1" Ports [1, 1, 0, 0, 0] Position [225, 90, 255, 120] ExternalReset none InitialConditionSource internal InitialCondition "0" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Mux Name "Mux" Ports [2, 1, 0, 0, 0] Position [310, 62, 345, 98] Inputs "2" } Block { BlockType Product Name "Product" Ports [2, 1, 0, 0, 0] Position [150, 125, 165, 145] ShowName off Inputs "2" } Block { BlockType Sum Name "Sum" Ports [3, 1, 0, 0, 0] Position [195, 80, 210, 130] Inputs "+++" } Block { BlockType Sum Name "Sum1" Ports [2, 1, 0, 0, 0] Position [185, 22, 200, 53] Inputs "++" } Block { BlockType Sum Name "Sum2" Ports [2, 1, 0, 0, 0] Position [75, 25, 90, 45] Inputs "-+" } Block { BlockType Outport Name "xhat" Position [365, 73, 395, 87] Port "1" OutputWhenDisabled held InitialOutput "[]" } Line { SrcBlock "Sum" SrcPort 1 DstBlock "Integrator1" DstPort 1 } Line { SrcBlock "Integrator1" SrcPort 1 Points [20, 0] Branch { Points [15, 0] DstBlock "Mux" DstPort 2 } Branch { Points [0, -30; -120, 0; 0, -30] DstBlock "Sum1" DstPort 2 } Branch { Points [0, 95; -195, 0] DstBlock "Fcn1" DstPort 1 } } Line { SrcBlock "Sum1" SrcPort 1 DstBlock "Integrator" DstPort 1 } Line { SrcBlock "y" SrcPort 1 DstBlock "Sum2" DstPort 2 } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Sum2" SrcPort 1 Points [5, 0] Branch { Points [15, 0] DstBlock "Gain" DstPort 1 } Branch { Points [0, 80] DstBlock "Gain1" DstPort 1 } } Line { SrcBlock "Gain1" SrcPort 1 Points [25, 0] DstBlock "Sum" DstPort 2 } Line { SrcBlock "Integrator" SrcPort 1 Points [35, 0] Branch { DstBlock "Mux" DstPort 1 } Branch { Points [0, -30; -240, 0; 0, 20] DstBlock "Sum2" DstPort 1 } } Line { SrcBlock "Gain2" SrcPort 1 DstBlock "Sum" DstPort 1 } Line { SrcBlock "Fcn" SrcPort 1 DstBlock "Gain2" DstPort 1 } Line { SrcBlock "Mux" SrcPort 1 Points [0, 0] Branch { DstBlock "xhat" DstPort 1 } Branch { Points [0, 85; -330, 0; 0, -75] DstBlock "Fcn" DstPort 1 } } Line { SrcBlock "Fcn1" SrcPort 1 DstBlock "Product" DstPort 2 } Line { SrcBlock "u" SrcPort 1 Points [55, 0; 0, -15] DstBlock "Product" DstPort 1 } Line { SrcBlock "Product" SrcPort 1 Points [10, 0] DstBlock "Sum" DstPort 3 } Annotation { Position [271, 29] Text "x1hat" } Annotation { Position [273, 94] Text "x2hat" } } } Block { BlockType SubSystem Name "plant" Ports [1, 2, 0, 0, 0] Position [205, 40, 235, 75] ShowPortLabels on System { Name "plant" Location [12, 175, 440, 392] Open on ToolBar off StatusBar off ScreenColor white PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType Inport Name "u" Position [45, 103, 75, 117] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Fcn Name "Fcn" Position [95, 87, 125, 103] ShowName off Expr "u(2)^2" } Block { BlockType Fcn Name "Fcn1" Position [105, 136, 135, 154] ShowName off Expr "exp(-u^2)" } Block { BlockType Gain Name "Gain" Position [150, 86, 170, 104] ShowName off Gain "1" } Block { BlockType Integrator Name "Integrator" Ports [1, 1, 0, 0, 0] Position [230, 25, 260, 55] ExternalReset none InitialConditionSource internal InitialCondition "x1_0" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Integrator Name "Integrator1" Ports [1, 1, 0, 0, 0] Position [230, 90, 260, 120] ExternalReset none InitialConditionSource internal InitialCondition "x2_0" LimitOutput off UpperSaturationLimit "inf" LowerSaturationLimit "-inf" ShowSaturationPort off ShowStatePort off AbsoluteTolerance "auto" } Block { BlockType Mux Name "Mux" Ports [2, 1, 0, 0, 0] Position [315, 62, 350, 98] Inputs "2" } Block { BlockType Product Name "Product" Ports [2, 1, 0, 0, 0] Position [165, 105, 180, 125] ShowName off Inputs "2" } Block { BlockType Sum Name "Sum" Ports [2, 1, 0, 0, 0] Position [195, 87, 210, 123] Inputs "++" } Block { BlockType Outport Name "x" Position [370, 73, 400, 87] Port "1" OutputWhenDisabled held InitialOutput "[]" } Block { BlockType Outport Name "y" Position [370, 18, 400, 32] Port "2" OutputWhenDisabled held InitialOutput "[]" } Line { SrcBlock "Integrator1" SrcPort 1 Points [15, 0] Branch { Points [20, 0] DstBlock "Mux" DstPort 2 } Branch { Points [0, -30; -75, 0; 0, -35] DstBlock "Integrator" DstPort 1 } Branch { Points [0, 80; -190, 0] DstBlock "Fcn1" DstPort 1 } } Line { SrcBlock "Sum" SrcPort 1 DstBlock "Integrator1" DstPort 1 } Line { SrcBlock "Integrator" SrcPort 1 Points [35, 0] Branch { DstBlock "Mux" DstPort 1 } Branch { Points [55, 0] DstBlock "y" DstPort 1 } } Line { SrcBlock "Fcn" SrcPort 1 DstBlock "Gain" DstPort 1 } Line { SrcBlock "Mux" SrcPort 1 Points [0, 0] Branch { DstBlock "x" DstPort 1 } Branch { Points [0, 80; -330, 0; 0, -65] DstBlock "Fcn" DstPort 1 } } Line { SrcBlock "Gain" SrcPort 1 DstBlock "Sum" DstPort 1 } Line { SrcBlock "Product" SrcPort 1 DstBlock "Sum" DstPort 2 } Line { SrcBlock "Fcn1" SrcPort 1 Points [10, 0] DstBlock "Product" DstPort 2 } Line { SrcBlock "u" SrcPort 1 DstBlock "Product" DstPort 1 } Annotation { Position [271, 29] Text "x1" } Annotation { Position [268, 94] Text "x2" } } } Line { SrcBlock "plant" SrcPort 2 Points [15, 0; 0, 70; -75, 0; 0, 40] DstBlock "observer" DstPort 2 } Line { SrcBlock "Controller" SrcPort 1 Points [0, 0] Branch { Labels [1, 0] DstBlock "plant" DstPort 1 } Branch { Points [0, 0] Branch { Points [0, -40; 85, 0] DstBlock "Scope1" DstPort 1 } Branch { Points [0, 35] Branch { Points [0, 65] DstBlock "observer" DstPort 1 } Branch { Points [105, 0; 0, -30] DstBlock "Fcn" DstPort 1 } } } } Line { SrcBlock "Switch" SrcPort 1 DstBlock "Controller" DstPort 1 } Line { SrcBlock "plant" SrcPort 1 Points [5, 0] Branch { Points [0, -20; -200, 0; 0, 20] DstBlock "Switch" DstPort 1 } Branch { Points [20, 0; 0, 60] DstBlock "Mux" DstPort 1 } } Line { SrcBlock "Mux" SrcPort 1 Points [0, 0] Branch { DstBlock "Scope" DstPort 1 } Branch { Points [0, 50] DstBlock "To Workspace" DstPort 1 } } Line { SrcBlock "Fcn" SrcPort 1 Points [20, 0; 0, -20] DstBlock "Stop Simulation" DstPort 1 } Line { SrcBlock "Constant" SrcPort 1 DstBlock "Switch" DstPort 2 } Line { SrcBlock "observer" SrcPort 1 Points [15, 0] Branch { Points [0, -40] DstBlock "Mux" DstPort 2 } Branch { Points [0, 15; -220, 0; 0, -115] DstBlock "Switch" DstPort 3 } } } }