{"id":36,"date":"2008-11-04T09:00:15","date_gmt":"2008-11-04T14:00:15","guid":{"rendered":"https:\/\/blogs.mathworks.com\/seth\/2008\/11\/04\/introduction-to-model-advisor\/"},"modified":"2016-12-20T19:03:52","modified_gmt":"2016-12-21T00:03:52","slug":"introduction-to-model-advisor","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/simulink\/2008\/11\/04\/introduction-to-model-advisor\/","title":{"rendered":"Introduction to Model Advisor"},"content":{"rendered":"<p>How do you check your model for common mistakes?\u00a0 Do you\r\nhave an easy way to verify that your model matches the <a\r\nhref=\"https:\/\/www.mathworks.com\/solutions\/automotive\/standards\/maab.html\">MAAB<\/a>\r\n(MathWorks Automotive Advisory Board) Control\r\nAlgorithm Modeling Guidelines?\u00a0 In this post, I will introduce model\r\nadvisor and show you how easy it is to use automated checking in your modeling\r\nprocess.<\/p>\r\n\r\n<p><strong>Model Advisor<\/strong><\/p>\r\n\r\n<p>The Model Advisor is a tool in core Simulink that\r\nautomatically checks your model for some common mistakes.\u00a0 From any model, you\r\ncan open the Model Advisor from the Tools menu.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/modelAdvisor_toolsMenu.png\" alt=\"Launch Simulink Model Advisor from the tools menu\"><\/p>\r\n\r\n<p>The Model Advisor can analyze the entire model, or a subset\r\nof the model.\u00a0 When you open it from the tools menu, you have to pick which\r\nsystem you want to work on.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/modelAdvisor_systemSelector.png\" alt=\"Select the system you are going to analyze with Model Advisor\"><\/p>\r\n\r\n<p>You can also launch the Model Advisor on a selected system\r\nfrom the right click menu.\u00a0 The Model Advisor shows the available checks on the\r\nleft side, grouped by product and by task.\u00a0 <\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/modelAdvisor_justSimulink.png\" alt=\"The Model Advisor Simulink checks\"><\/p>\r\n\r\n<p>The individual checks can run one at a time, or you can run\r\nall the selected checks for a given node of the tree.\u00a0 The immediate results display\r\nwhen you highlight the check in the tree.\u00a0 For example, I ran the Simulink\r\nchecks on this demo model:<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/sldemo_mdladv.png\" alt=\"The Simulink demo model sldemo_mdladv.mdl\"><\/p>\r\n\r\n<p>It turned up a warning in the check for unconnected objects.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/modelAdvisor_unconnectedLines.png\" alt=\"Model Advisor checks for unconnected lines in your model\"><\/p>\r\n\r\n<p>Often checks include links back into the model so you can\r\nlocate the offending blocks.\u00a0 Some checks show you obvious problems in the\r\nmodel, like these unconnected lines.\u00a0 This check identifies the offending\r\nblocks and provides a brief explanation on why this could be a problem.<\/p>\r\n\r\n<p>Another output from the Model Advisor is the report.\u00a0 An\r\nHTML report is stored in the SLPRJ directory after you have run the checks on\r\nthe model.\u00a0 When you select to run a group of checks, you can automatically\r\nlaunch the report and review the summary of results.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/modelAdvisor_report.png\" alt=\"Simulink Model Advisor generates a report for the system and checks run\"><\/p>\r\n\r\n<p><strong>Core Simulink Model Advisor capabilities<\/strong><\/p>\r\n\r\n<p>The core Simulink checks available in Model Advisor help you\r\nfind common mistakes, ensure model correctness and best practices.\u00a0 I think of\r\nthe core Simulink Model Advisor checks like advice you would get from an expert\r\nSimulink user if they were looking over your shoulder while you work.\u00a0 There\r\nare so many optimizations and diagnostic settings in Simulink.\u00a0 It is not\r\nuncommon to find that you have a setting that triggers a warning from Model\r\nAdvisor.\u00a0 Reviewing the information with the warning can help improve your\r\nmodel.<\/p>\r\n\r\n<p><strong>Modeling Standards Checks with Simulink V&amp;V<\/strong><\/p>\r\n\r\n<p>Simulink Verification and Validation adds modeling standards\r\nchecks commonly needed when developing embedded code for safety critical\r\napplications. In the R2008b release of Simulink V&amp;V, there are additional\r\nmodeling standards checks for DO-178B, IEC 61508, and MAAB 2.0.\u00a0 In the documentation,\r\nyou can review the available <a\r\nhref=\"https:\/\/www.mathworks.com\/help\/releases\/R2008b\/toolbox\/slvnv\/ug\/braj2hr-1.html#braj2hr-3\">modeling\r\nstandards checks<\/a>.<\/p>\r\n\r\n<p><strong>Checks with Actions<\/strong><\/p>\r\n\r\n<p>Some checks can automatically fix the condition reported.\u00a0\r\nFor example, here is a check that is part of the <a\r\nhref=\"https:\/\/www.mathworks.com\/help\/releases\/R2008b\/toolbox\/slvnv\/ug\/brlhdcb.html\">DO-178B\r\nChecks<\/a> from <a\r\nhref=\"https:\/\/www.mathworks.com\/products\/simverification\/index.html\">Simulink\r\nVerification and Validation<\/a>.\u00a0 <\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/do178bOptimizationsResults.png\" alt=\"The do178b optimization settings from Simulink Verification and Validation\"><\/p>\r\n\r\n<p>After reviewing the check, I may want to make the recommended\r\nchanges to the optimization settings to comply with this check.\u00a0 I can click on\r\nthe Modify Setting button, which makes the appropriate changes to my model.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/modifySettingsTorn.png\" alt=\"Model Advisor reports the results of modifying the model\"><\/p>\r\n\r\n<p>The results of the action display below the button for\r\nreview. When the check is re-run, it no longer produces warnings.<\/p>\r\n\r\n<p><strong>Restore Points, new in R2008b<\/strong><\/p>\r\n\r\n<p>New in R2008b is the ability to save a model and data\r\nrestore point.\u00a0 Restore points allow you to revert changes that you made in\r\nresponse to advice from the Model Advisor. A <em>restore point<\/em> is a snapshot\r\nin time of the model, base workspace, and Model Advisor.<\/p>\r\n\r\n<p>From the File menu you can select to save and load restore\r\npoints.\u00a0 When you select Save Restore Point As... you can name the restore point\r\nand provide a description.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/restorePoint1.png\" alt=\"Model Advisor Save Restore Point As dialog.\"><\/p>\r\n\r\n<p>After making changes to the model, you can revert to the\r\nprevious restore point by loading that point.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/loadRestorePoint.png\" alt=\"Model Advisor Load Restore Point dialog.\"><\/p>\r\n\r\n<p>The Model Advisor maintains restore points for the model or\r\nsubsystem of interest through multiple sessions of MATLAB.<\/p>\r\n\r\n<p><strong>How do you check your models?<\/strong><\/p>\r\n\r\n<p>Do you use Model Advisor in your model development process?\u00a0\r\nAre there any standard checks you would want to see?\u00a0 Leave a <a\r\nhref=\"https:\/\/blogs.mathworks.com\/seth\/?p=36&amp;#comment\">comment here<\/a> and\r\ntell us what you think. <\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>How do you check your model for common mistakes?\u00a0 Do you\r\nhave an easy way to verify that your model matches the MAAB\r\n(MathWorks Automotive Advisory Board) Control\r\nAlgorithm Modeling Guidelines?\u00a0... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/simulink\/2008\/11\/04\/introduction-to-model-advisor\/\">read more >><\/a><\/p>","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[63,16],"tags":[441],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/36"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/comments?post=36"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/36\/revisions"}],"predecessor-version":[{"id":6125,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/36\/revisions\/6125"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media?parent=36"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/categories?post=36"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/tags?post=36"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}