Design Fuzzy Inference Systems Using the Fuzzy Logic Designer App - MATLAB
Video Player is loading.
Current Time 0:00
Duration 6:01
Loaded: 7.79%
Stream Type LIVE
Remaining Time 6:01
 
1x
  • Chapters
  • descriptions off, selected
  • captions off, selected
      Video length is 6:01

      Design Fuzzy Inference Systems Using the Fuzzy Logic Designer App

      From the series: Getting Started with Fuzzy Logic Toolbox

      Learn how to design fuzzy inference systems using the redesigned Fuzzy Logic Designer app. The app provides capabilities to design Mamdani and Sugeno type-1 and type-2 systems and features a workflow-based toolstrip that lets you design, simulate, compare, and export fuzzy inference systems.

      Published: 14 Sep 2022

      In this video, we'll showcase the redesigned Fuzzy Logic Designer app that lets you graphically design and simulate fuzzy inference systems. The app provides capabilities to design Mamdani and Sugeno Type-1 and Type-2 systems and features a workflow-based tool strip that lets you design, simulate, compare and export Fuzzy inference systems. Now let's use the example of a tipping problem to showcase capabilities of the app.

      Goal of this Fuzzy Inference System is to estimate the tip percentage for a waiter based on the quality of food and service. For context, the average tip percentage in the US is 15%. Let's open the Fuzzy Logic Designer app. The Start page provides standard template fuzzy inference systems to quickly get started with the design and additionally provides the capability to create custom fuzzy inference systems. You can also load previously created fuzzy inference systems either from file or your workspace.

      To solve the tipping problem, which takes in two inputs-- food and service-- and provides one output-- tip, we can either create a fuzzy inference system from scratch or leverage one of the provided templates. For this example, we'll use the Mamdani Type-1 template to get started.

      The template creates a standard fuzzy system, as seen in the fuzzy inference plot, and loads a default set of membership functions. Let's name the inputs and the output. Now that we have the structure decided, the next steps are to define the membership functions and the rules. To define or add membership functions to inputs and outputs, you can click on the corresponding entry in the system browser and make the required changes in the Property Editor. To add additional membership functions, you can click on Membership Function button under Add Component section in the Tools group.

      For this example, for the first input, which is service, we shall use three Gaussian membership functions to model poor, good and excellent service, and enter the corresponding values for the parameters. These parameters can also be modified graphically using the Membership Function plot.

      We will repeat similar steps for the other input, food, and the output, tip, and define the respective membership functions and parameters. To know more about how the parameters were selected, please refer to the fuzzy logic documentation.

      The next step is to map the inputs to output using rules. To do this we can either right-click on Rules in the system browser and click on Show Rule Editor, or click on Fuzzy System and open the Rule Editor. You can use the Rule Editor to add, copy or delete rules and manage all rules of your system, and then use the Property Editor tab associated with it to make changes to individual rules. The Rule Editor also provides the option to automatically populate all possible rules by including all combination of inputs and its membership functions.

      For this example, we would like to create three simple rules to design the logic. Let's implement the rules. The first rule is if service is poor, or food is rancid, then tip is cheap. Second, if service is good, the tip is average. In this case, the second input, food, has no implications here. So we can enter that as none. And the last rule-- if service is excellent, or food is delicious, tip is generous.

      We can now go ahead and simulate our system. To do so, you can use the Rule Inference and Control Surface to evaluate your design. Click on Rule Inference to open the Rule Viewer. Here you can make changes to your inputs by using a slider to model different scenarios and evaluate how your fuzzy system responds.

      Let's model a couple of scenarios-- first, with servers being bad, and food being rancid. We see that the tip amount is low. Now let's change the quality of food to high and quality of service to average. We see that the tip is generous. This shows that our fuzzy system is performing as expected.

      The Control Surface, on the other hand, shows the overall mapping between the inputs, food and service, to the output, tip. Using the Control Surface we can infer that the tip amount is generous when food and service are great. Tip is low when they are bad. And flat area in the middle shows average tip at about 15%. This shows that the mapping is accurate.

      You can further create multiple designs, either by creating a copy and tuning the existing design, or converting your system between Mamdani and Sugeno, or between Type-1 and Type-2, based on your application. You can then compare and evaluate different fuzzy systems to select the best one that meets your requirements. For the sake of simplicity for this example, we will use our current design.

      Moving on to the last part of this workflow, we can export our designed fuzzy inference system to Matlab workspace using the Export option. The Save Fuzzy Inference System object can then be used either in Simulink model for integration with system level model, or for direct deployment to an embedded system. This concludes our video.

      View more related videos