Simulink基础入门教程

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

SIMULINK(1)SIMULINK(1)SimulinkSimulinkSimulinkSimulinkSimulink1.11.1.11.2.1.1.21.2.1233.1.21.3Simulink1.3.1Simulink1.3.2SimulinkSimulinkMATLABMATLAB12463571.3.3SimulinkP6Matlabdblcart1DoubleMass-SpringSystem(Doubleclickonthe?formoreinfo)Tostartandstopthesimulation,usetheStart/StopselectionintheSimulationpull-downmenuIn1Out1Stateestimatorx'=Ax+Buy=Cx+DuPlantDoubleclickhereforSIMULINKHelp?Inputs&Sensors1In1In2Out1Inputs&SensorsKFeedbackgainusingLQRdesign.EstimatedPositionDemuxcrtanim2AnimationfunctionActualPositionF(t)LQR“”Inputs&SensorsStateestimator“”1Out1MuxInputs&Sensors2In21In11Out1x'=Ax+Buy=Cx+DuStateestimator1In1DoubleMass-SpringSystem(Doubleclickonthe?formoreinfo)Tostartandstopthesimulation,usetheStart/StopselectionintheSimulationpull-downmenuIn1Out1Stateestimatorx'=Ax+Buy=Cx+DuPlantDoubleclickhereforSIMULINKHelp?Inputs&Sensors1In1In2Out1Inputs&SensorsKFeedbackgainusingLQRdesign.EstimatedPositionDemuxcrtanim2AnimationfunctionActualPositionSimulationStartActuralPositionEstimatedPosition1.4Simulink100CPU16MBWindows9xWindowsNTMATLABSimulinkMATLABMATLABSimulinksimulink1.510)0()sin()(xttxCttx)cos()(1C1)cos()(ttxCSineWaveScope1sIntegrator01234567891000.20.40.60.811.21.41.61.82SineWaveScope1sIntegratorSourcesSineWaveContinuousIntegratorSinksScopeScopeSimulationStart0)0()sin()(xttx1)cos()(ttx)cos()(ttx1)0()sin()(xttx1)0(x0C11s012345678910-1-0.8-0.6-0.4-0.200.20.40.60.81SineWaveScope1sIntegratorSimulink20kxxcxm0)0(,1)0(00xxxx)sin()cos()(00000txxtxetxdddtSimulink1,1,1kcmmk0201dkmc20kxxcxm0)0(,1)0(00xxxx1,1,1kcm0xmkxmcx1s1s1k/m1c/mScope10xxx051015-0.6-0.4-0.200.20.40.60.810kxxm0)0(,1)0(00xxxx)sin()cos()(00000txtxtx1,1kmmk00kxxm0)0(,1)0(00xxxx1,1km0xmkx1s1sScope-1-k/m10xxx051015-1-0.8-0.6-0.4-0.200.20.40.60.811.6SimulinkSimulinkMATLABSimulinkMATLABSinksSIMULINK(2)SIMULINK(2)2.12.22.32.42.52.6Word2.11.2.1FileOpen2MATLAB2.2.12.22.2.22.2.31Ctrl23EditCopyEditPaste4CtrlCCtrlVFormatRotate902.2.41Delete2EditClear3EditCut2.2.51Shift2“”“”Shift2.2.62.2.7FormatFlipName2.2.8FormatHideNameHideNameShowName2.2.8FormatShowDropShadowShowDropShadowHideDropShadow2.32.3.12.3.22.3.32.3.42.3.52.3.62.42.4.12.4.22.3.1•1sIntegrator1Gain+1sIntegrator1Gain2.3.2•1sIntegrator1Gain1sIntegrator1Gain2.3.3•1sIntegrator1Gain1sIntegrator1Gain2.3.4•DeleteEdit/ClearEdit/Cut2.3.5•Shift1sIntegrator1Gain1sIntegrator1Gain2.3.6•1sIntegrator1Gain2.42.4.12.4.2MATLABSimulinkFormatFontOK2.51xbxratebirth_2_pxratedeath2pxbxxhb/1hp/5.01002pxbxxxx1sIntegratorxx2pxbxxSumScopeProduct1sIntegrator1Gain11GainSumMathMath2xSinkMathContinuousMath2pxbxxSumScopeProduct1sIntegrator1Gain11GainSum..2pxbxx1b5.0p100SumScopeProduct1sIntegrator1Gain10.5GainSum.100“”5.0p1b.010.0SimulinkParametersStoptime10.0FileSavebio_exampleSimulinkbio_example.mdlSimulinkStart0123456789100102030405060708090100Time2mmm2kkk2kx1x2x3P0sin(wt)00)sin(302030000000321321tPxxxkkkkkkkxxxmmm)(tPKXXMmmm000000M321xxxXkkkkkkk30203K00)sin()(0tPtPSimulink0~50)sin(22221.0)sin(30363.2)sin(121088.0)()()(000321twkPtwkPtwkPtxtxtx00)sin(302030000000321321tPxxxkkkkkkkxxxmmmm=1,k=1,P0=1,5.0P189P233SineWave0.5Scope1sIntegrator11sIntegratorK*uM1K*u[1;0;0]K*uM1K*uKm=1,k=1,P0=1,5.0)(tPKXXM00)sin(302030000000321321tPxxxkkkkkkkxxxmmm)(11tPMKXMX[0;0;0][0;0;0]05101520253035404550-0.8-0.6-0.4-0.200.20.40.62.6WordEditCopyModelWord2.6.1Word2.6.2WordSIMULINK(3)SIMULINK(3)Simulink3.13.2MATLAB3.11.3.4.5.6.2.Simulink1.SimulationParameters•Solver•I/OWorkspaceI/O•Diagnostics•Advanced•Real-TimeWorkshop•Solver•I/OWorkspaceI/O•Diagnostics•Advanced•Real-TimeWorkshopMATLAB1SimulationParametersSolverode45ode45ode23ode113ode15discreteode5ode4ode3ode2ode1discreteode4545RungeKuttaode23Adams103ode113Adams103106ode45ode45ode23tode15s2Rosenbrockode45ode23s2Rosenbrockode15sode23tbode15sode2I/OSimulinkMATLABMATLABMATLABMATLABI/OI/OMATLABLoadfromworkspaceMATLABSavetoworkspaceSaveoptionWorkspaceI/OMATLABLoadfromworkspaceSimulinkSimulinkLoadfromworkspaceMATLAB1Input[t,u]tutu[t,u1,u2]SimulinkInportIn12Out21Out1Scope1sIntegrator11sIntegrator2In21In1200655CAI11MATLABLoadfromworkspaceSimulinkSimulinkLoadfromworkspaceMATLAB1Input[t,u]tutu[t,u1,u2]SimulinkInportIn12InitialstatexInitialMATLABSavetoworkspaceWorkspaceI/OMATLAB1Time2States3OutputOutputOut14Finalstate2Out21Out1Scope1sIntegrator11sIntegrator2In21In1Saveoption1Limitdatapointstolast2FormatStructurewithTimeStructureArray:2Out21Out1Scope1sIntegrator11sIntegrator2In21In12Out21Out1Scope1sIntegrator11sIntegrator2In21In1sin(t)[01]Ctty)cos()sin(2)cos(21)cos(1tytyLoadfromworkspaceInput[t,u,u]SavetoworkspaceSaveoption10001ArrayMATLABt=0:0.1:10;t=t’;u=sin(t);xInitial=[0,1];2Out21Out1Scope1sIntegrator11sIntegrator2In21In12)cos(21)cos(1tyty01234567891000.511.522.53Time2Out21Out1Scope1sIntegrator11sIntegrator2In21In12)cos(21)cos(1tytywhosNameSizeBytesClasst101x1808doublearraytout51x1408doublearrayu101x1808doublearrayxFinal1x216doublearrayxInitial1x216doublearrayxout51x2816doublearrayyout51x2816doublearrayttoutSolver0.13.2MATLABMATLABsimMATLABMSimulinkSimulinkStartSimulinkfor121MATLAB010s2MAT

1 / 174
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功