{"id":117,"date":"2011-01-18T20:26:56","date_gmt":"2011-01-18T20:26:56","guid":{"rendered":"https:\/\/blogs.mathworks.com\/seth\/2011\/01\/18\/you-need-an-integrator-with-variable-limits-theres-a-solution-for-that\/"},"modified":"2017-03-13T09:57:00","modified_gmt":"2017-03-13T14:57:00","slug":"you-need-an-integrator-with-variable-limits-theres-a-solution-for-that","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/simulink\/2011\/01\/18\/you-need-an-integrator-with-variable-limits-theres-a-solution-for-that\/","title":{"rendered":"You need an integrator with variable limits&#8230; there&#8217;s a solution for that!"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/guy_rouleau_small.png\" alt=\"Blogger, Guy Rouleau\" style=\"float: left; margin-right: 1em;\">By <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/31651\">Guy Rouleau<\/a><br><br>\r\n\r\nToday I received a question where the user was looking for an Integrator block with variable upper and lower limits that could be specified from signals. I was happy to simply answer: <em>There's a solution for that!<\/em>\r\n\r\n<p>In order to help users finding the information they need, we have a bank of technical solutions published on our website. These solutions are created by technical support engineers when they answer a question. If they think that someone else in the world might have a similar questions, they publish it.<\/p>\r\n\r\n<p>So I went to the <a href=\"https:\/\/www.mathworks.com\/support\/\">support section<\/a> of our website and searched for <em>variable limits integrator<\/em>:<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2010Q4\/MathWorksSupport.png\" alt=\"Support section of MathWorks website\" \/><\/p>\r\n\r\n<p> The first result I found is the following solution:<\/p>\r\n\r\n<p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/answers\/102771-is-it-possible-to-specify-a-dynamic-value-for-the-integrator-block-s-upper-saturation-limit-parame\">How can I create an Integrator block with variable limits in Simulink?<\/a><\/p>\r\n\r\n<p>When looking at the details, I realized that I created this solution myself a few years ago, not long after I joined MathWorks. It uses the state port of the <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/slref\/integratorlimited.html#f7-1739821\">Integrator<\/a> block with a few <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/slref\/logicaloperator.html\">Logical Operator<\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/slref\/relationaloperator.html\">Relational Operator<\/a> blocks to make an integrator with variable limits:<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2010Q4\/VariableLimitsIntegrator.png\" alt=\"Technical solution: Variable limits integrator\" \/><\/p>\r\n\r\n\r\n<p><strong>Conclusion<\/strong><\/p>\r\n\r\n<p>If you are looking for an explanation or an example that you cannot find in the doc, try our technical solutions. You might find very interesting stuff and save a lot of time.<p\/>\r\n\r\n<p><strong>Now it's your turn<\/strong><\/p>\r\n\r\n<p>When you cannot find the info you are looking for in the doc, where do you look?  Post a <a href=\"https:\/\/blogs.mathworks.com\/seth\/?p=117&#comment\">comment here<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>By Guy Rouleau\r\n\r\nToday I received a question where the user was looking for an Integrator block with variable upper and lower limits that could be specified from signals. I was happy to simply... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/simulink\/2011\/01\/18\/you-need-an-integrator-with-variable-limits-theres-a-solution-for-that\/\">read more >><\/a><\/p>","protected":false},"author":41,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[34,67,11,33],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/117"}],"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\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/comments?post=117"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/117\/revisions"}],"predecessor-version":[{"id":6387,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/117\/revisions\/6387"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media?parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/categories?post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/tags?post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}