Professional Documents
Culture Documents
Assignment 4
Jean Mouawad
Faculty of Engineering
University of Balamand
October 2018
_____________________________________________________________________________________
Copyright 2018
All Right Reserved, Jean Mouawad
Matlab Simulation
Figure 1: Input 1
A range is set between -2 and 2; with 3 membership functions ‘N’, ‘Z’ & ‘P’.
Figure 1: Input 2
2. As for the output ’U’, we set a range of -8 to 8 with 5 membership functions shown in figure
4.
4. We set the rules according to the table below, to relate the inputs to the outputs.
Table 1: Table rules
X X2 N Z P
1
N NB N Z
Z N Z P
P Z P PB
5. Simulink configuration (Method #1)
6. After we get save the fuzzy system then calling it back with a variable, we open Simulink with
Two discrete space models both with input ‘U’ from the fuzzy system.
7. Result:
We set and abs value in Fcn to stop the simulation and we can save our data in the workspace.
Stop time = 2s
Time Series Plot:
8
d a ta
2
-2
-4
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (seconds)
Figure 5: Output
Output:
1 -2.5257 -1 -1
2 0.0451 -0.0178 0.0335
3 -0.0150 0.0055 -0.0106
4 0.0141 -0.0051 0.0099
5 -0.0132 0.0048 -0.0093
6 0.0025 -9.000e-04 0.0017
7 -7.000e-04 2.000e-04 -5.000e-04
8 2.000e-04 -1.000e-04 2.000e-04
9 -2.000e-04 1.000e-04 -2.000e-04
10 1.000e-04 0 1.000e-04
I. Conclusion
The power of Matlab and Simulink becomes nowadays more evident to one as all these
The practical implementation of the controller familiarizes on with the use of analog computers