Seth on Simulink

May 13th, 2009

What does Model-Based Design mean to you?

I stumbled upon a blog post over at The Green Garage where they interviewed a couple of my colleagues, Paul Smith and Shaun Kalinowski.  They talked to them in front of the MathWorks booth at the SAE World Congress in Detroit.  I have embedded the video here in case you want to watch it now:

The focus of the interview is about answering the question “How do you make math cool again for students these days?”  MathWorks is an EcoCAR sponsor, and Shaun is one of the mentors for an EcoCAR team.  I really like Paul’s comparison of engineering simulation to playing video games while you are doing your work.

About thirty seconds into the video Paul describes Model-Based Design as “a technique used by engineers to design the next generation of systems that go into cars, airplanes and cell phones.”  I have had many conversations with people who say they are doing Model-Based Design.  Are they all using the same technique?  How do you define and document what that technique is?

I think this line of questioning leads to an interesting observation.  Model-Based Design means different things to different people, and there is no one right way to do it. The MathWorks website has some great user stories about applying Model-Based Design techniques.  These storied include companies like Boeing, Astrium, Bell Helicopter, BAE Systems, Toyota, and Xerox.  Each of these user stories tells of the specific benefits that group received from applying Model-Based Design.

Now I ask the following question:

What does Model-Based Design mean to you?

If you are using Model-Based Design, how are you doing it?  What is the most important benefit?

Please leave comments on this blog post, or if you want to be a guest blogger and write something a little longer, e-mail me directly.

15 Responses to “What does Model-Based Design mean to you?”

  1. James replied on :

    I take a somewhat broader view of model-based design (MBD) than described in the video. I consider MBD to be any design process that uses computer simulations or other models to aid in making design decisions.

    I’ve worked on design projects where the focus was on developing the physical system (the ‘plant’), and not the control system or the embedded code, and we used computer models to make predictions about how proposed designs would perform.

    One of the greatest benefits of MBD is the ability to automate tasks. The benefit of automatic code generation using MathWorks tools is well known (which in a way is now more of a manufacturing activity than a design activity), but engineers can also automate some design decisions using optimization. If you have a model that predicts system performance accurately, and is capable of modeling design changes, you can use optimization to find the best design alternative. Optimization algorithms can pick which design alternatives to test more efficiently than manual exploration, particularly when you are managing a large number of design variables.

  2. Amin replied on :

    MBD is a mathematical and visual method of addressing the problems associated with designing complex control systems; it provides an efficient approach for the modeling a plant (mathematical modeling or data based modeling), analyzing and synthesizing a controller for the plant, simulating the plant and controller, and deploying the controller.
    In my MSC thesis, I used Simulink and MATLAB optimization toolbox to simulate the fluid catalytic cracking unit and design a model based controller (proportional integral plus controller) for this unit.

  3. Jeff replied on :

    Before joining The MathWorks, I would have said “Simulation-Based Design”, rather than “Model-Based Design”, but the idea is the same: Computer simulation lets you analyze a model of a system or device at a lower cost in time, money, and risk than fabricating the design and testing it. You can use that capability to optimise the design, to get to market sooner or at a lower price, or to explore ideas that would otherwise be unaffordable or dangerous.

    James pointed out that Code Generation is a way to “manufacture” software from a model. A model also facilitates creating physical artifacts, using a 3D printer or CNC machine tool.

  4. Seth replied on :

    @James - Thanks for your perspective on Model-Based Design. We certainly find a lot of people use the broader definition to describe all the ways they work.

    @Amin - You hit on the major points that resonate with me. Model-Based Design is critical for designing complex systems and doing it efficiently.

  5. Amin replied on :

    Hi seth!
    Consider this model
    http://sites.google.com/site/matlabeducorp/Home/funny.bmp?attredirects=0
    Where MATLAB Fcn function is
    function y = myfunnyfunc(u)
    if any(u == 0)
    y = 1;
    else
    y = 3*u;
    end
    and number of outputs parameter in demux dialog box set to 2
    This model cannot be run, because during the initializing step, the input of MATLAB Fcn set to zero.
    I read the Simulink document several time, but I cannot find a way to run this model.

  6. Jim replied on :

    I also take a broad view on Model-Based Design. An Excel spreadsheet can be used in Model-Based Design - you won’t e able to generate code from it, but it is possible to learn a great deal about your requirements or your system with a minimal time investment.

    That being said, I often tell people that what you get from Model-Based Design depends in large part on what you put into Model-Based Design. If you put 10 minutes into an Excel spreadsheet, you may learn that your requirements are correct (or not). This is valuable and can save significant development time. However, if you put 10 days into detailed, closed-loop modeling and testing, you may end up with fully tested, fixed-point code that implements your true requirements on your production controller.

  7. Guy Rouleau replied on :

    @ Amin, The model can not run because in one case you set the output dimension to 1 and in the other case you set the output dimension to 3. It is not currently possible to change signal dimensions while a simulation is running. For example replace the function by:

    function y = myfunnyfunc(u)
    if any(u == 0)
    y = ones(size(u));
    else
    y = 3*u;
    end
    

    This will ensure input and output are always the same dimension. I suggest looking at Level 2 M-file S-Function for more complex things that are not supported by the MATLAB function block.

  8. Guy Rouleau replied on :

    To me, the main benefit of MBD is to save time and costs. This is done by creating a model (a simulation) of the entire system to design. This model can be given to many different teams that will be responsible to design separate modules of the main system.

    This brings me to what I see as the most important practice made possible by MBD, the “In-The-Loop” simulations. On one side, teams designing hardware subsystems can validate their work by placing their hardware part in a “Hardware-In-The-Loop” simulation. On another side, teams creating control software does not need to have access to the real hardware to be controlled. They can develop and test algorithm using “Software-In-The-Loop” and “Processor-In-The-Loop” simulations.

    This reduces the dependency constraints between subsystems and speedup development time.

  9. Seth replied on :

    @Jeff - Reducing time, risk and cost are all important parts of Model-Based Design.

    @Jim - I like how you put it. What are the most important tasks to do in Model-Based Design? You gave a great example about creating and tracking requirements for the design.

    @Guy Rouleau - X-In-The-Loop simulations move the results of our pure simulations closer to the real-world, either by testing the algorithm with the physical system, or verifying the actual controller with a model of the system.

  10. Zhi replied on :

    I believe any design method that is built on mathematical models should be called MBD. It does not have to do with simulations. For example, caculating frequency response is as much model-based as simulation.

    BTW, was math ever not cool?

  11. Walid F. replied on :

    I think a good definition to MBD can be found on this link:
    http://electronicdesign.com/Files/29/12086/12086_01.pdf

  12. Paul (I'm the bald guy in the video) replied on :

    Of course the video clip is too short to fully capture all the subtleties and richness of Model-Based Design but there is a central theme I find very revealing when talking about Model-Based Design and why it is so powerful.

    At a former job, I kept hearing that we must “design it right the first time” and we must reduce the number of prototypes. This was the path to increased profitability and productivity.

    Of course as any engineer knows, especially those involved in Software Engineering, the development of complex and highly interactive systems requires many design iterations to get it right. I used to tell my old boss that rather than getting it right the first time what we needed was a safe environment where we could get it wrong a thousand times. We needed to do more design iterations and do them more rapidly. That is what engineers are good at! They keep grinding away on problems making incremental changes (or sometime wholesale reworks) until they get it right. What was it one of the Japanese car companies says - “the relentless pursuit of perfection” - pursuit being the key word here. There really is not finish line - we just keep pursuing.

    Model-Based Design promises the engineer the ultimate playground to try every idea out rapidly, on their desktop or in a lab, safely, and thoroughly exploring their design space. Model-Based Design is the lubrication to “do it wrong” a thousand times so that, when real hardware and expensive prototypes are built, they just work. The tools that live in a Model-Based Design workflow are accelerants on the design process enabling rapid evolution to occur.

    One final point: Just like the products being designed with Model-Based Design will never be perfect and the engineers will be in pursuit relentlessly, Model-Based Design itself is never finished. Layers of abstraction will continue to be added to the design process to allow engineers to do engineering instead of syntax checking or tool interfacing.

  13. Seth replied on :

    @Zhi - Math has always been cool.

    @Walid F. - Thanks for the link! I like thy focus on abstraction from the implementation details (like targets!)

    @Paul - Your comment gets to the heart of what I think is important, process, and improvement on the process. Success in Model-Based Design means adapting the process to allow engineers to focus on the engineering!

  14. Marcos replied on :

    Hello Seth,
    I am working with the RF Blockset, and I would like to ask you something. I am tryin to model a 4-Port S-Parameter element, but I can only find blocks for 2-Ports. Do you know how is possible to model a system with 4 ports??

    Thanks, and regards.
    Marcos.

  15. Suha replied on :

    Hi,
    How can I create stand alone model?
    Thank you!

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


Seth Popinchalk is an Application Engineer for The MathWorks. He writes here about Simulink and other MathWorks tools used in Model-Based Design.
  • Mohamamd: Hi Suth, I try to simulate a load tap-changing transformer in simulink but its control part has to be...
  • Han Geerligs: Hello Guy, thanks for the clarificaton and link. However in the documentation I am missing the...
  • Guy: @Han, you probably already know, but I think it is good to share with everyone. To zoom in use the key...
  • Han Geerligs: Hi Seth, Once again I’d like to point out that my biggest accelerator is using mouse and keyboard...
  • XaL: Hi, thanks for the tips. As someone wrote in http://blogs.mathwor ks.com/seth/2009/03/ 13/new-%C2%A0rele...
  • Uba osy: Hi, in the introductory example for fuzzy logic toolbox it was noted that using non fuzzy means, you could...
  • Prashant: How can I have same example but instead AC(1 to 10V 50 or 60Hz) and DC(0.5 to 10 V) then adding AC+DC but...
  • adrian chavarro: Great tool, for educational and sicentific, simulation. I would like to know where can i place a...
  • Ashish Sadanandan: @wei, I was talking about the case where the compiler would perform the ‘model_Xdim...
  • wei: @Ashish, I agree with your observation on compiler optimization but fail to see why Han’s code would be...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.