changes the parameters of a fuzzy Inference system in run time
2 次查看(过去 30 天)
显示 更早的评论
Is this possible to change the parameters of a fuzzy Inference system in runtime? I tried to use some variables of workspace to change the value of membership functions but it give always an error.
2 个评论
Sam Chak
2024-10-1
Could you provide a description or an example of how you would like to change the parameters of the FIS? Are you working on something conceptually similar to the Variable Universe Fuzzy Controller? If you are using the Fuzzy Logic Toolbox, any changes made to the parameters or rules require you to update the FIS before you can apply the evalfis() command to the FIS.
回答(1 个)
Sam Chak
2024-10-2
If you enter fixed numeric values in the block parameters of the membership function blocks or in the fuzzy system object (.fis) within the fuzzy controller block, which is static, Simulink cannot access the specific model parameters you wish to change.
Generally, Simulink users can tune the block parameters during simulation by setting the desired parameters in the MATLAB workspace and then using the set_param() command to update the parameter values according to specific trigger conditions. This approach is very effective for low-level blocks (e.g., 'Constant', 'Gain', and various '<Type> MF' blocks) that have direct tunable parameters accepting numeric values.
However, the ".fis" file is a fuzzy system object that contains various information about the [System], [Input1], [Output1], and [Rules] properties. If you use the 'MATLAB Function' block to create the fuzzy controller, some functions from the Fuzzy Logic Toolbox are not supported for code generation unless you use coder.extrinsic() to declare those functions as extrinsic functions.
Conventionally, adaptive control systems are primarily simulated in MATLAB due to the flexibility of coding adaptive laws, dynamical systems, and if–else conditional statements. If you have coding aptitude and wish to work in Simulink, you can implement the adaptive control system algorithm split into multiple system functions (also known as S-functions) and use the 'S-Function' blocks to incorporate them into your Simulink model.
Suggested solution:
Alternatively, if your adaptive fuzzy controller is relatively simple, you can manually construct the fuzzy system in your Simulink model using fundamental blocks with tunable parameters (see the colored blocks below) and then apply the adaptive controller algorithm to adjust these parameters.
The following Simulink model is not an adaptive fuzzy control system; rather, it is my designed fuzzy controller for the nonlinear dynamics (Plant 1) excerpted from the paper "A Practical Approach for the Design of PD and PI-like Interval Type-2 Fuzzy Controllers" by Biglarbegian et al. (2009). This controller outperforms the proposed Type-1 and Interval Type-2 fuzzy controllers in the paper, as indicated by comparisons with Fig. 5 and Table IV.
Simulink model:
Result:
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fuzzy Logic in Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!