Professional Documents
Culture Documents
Engineering Analysis Manual
Engineering Analysis Manual
MATLAB code:
Walsh-Hadamard Transform (WHT) of 1D (one dimensional) signal
I. Using fundamental equation
x=[1;5;-3;2];
H=hadamard(4);
Y=(1/4)*H*x;
ix=H*Y;
ix=ifwht(Y,4,'hadamard');
Walsh-Hadamard Transform (WHT) of 2D (two dimensional) signal
I. Using fundamental equation
I=[50, 28, 10, 25; 40, 12, 23, 40; 45, 62, 15, 23; 28, 25, 33, 34];
H=hadamard(4);
Y=(1/16)*H*I*H;
iI=H*Y*H;
Experiment No: 03
Name of the experiment: Understanding the Fuzzy Logic Controller using MATLAB Simulik.
Theory:
MATLAB Simulation:
1. To open the fuzzy logic tool, Type ‘fuzzy’ on your command window.
2. Following window will appear
3. Select input1, go through as Edit >>> Add variable >>> input , then new input will be added as
follows
4. Click on input1, change Name input1 to Dirt, Repeat to rename input2 to Grease, output1 to wash
time
5. Double click on Dirt, select mf1 line, change Name mf1 to SD, set the Range [0 100], set Params
[0 0 50] , hit the Enter key
6. Repeat the previous step to set mf2 to MD, Range [0 100], set Params [0 50 100] and mf3 to LD,
Range [0 100], set Params [50 100 100]
7. Click on Grease, select mf1 line, change Name mf1 to
NG, set the Range [0 100], set Params [0 0 50] , hit
the Enter key
8. Repeat the previous step to set mf2 to MG, Range [0
100], set Params [0 50 100] and mf3 to LG, Range [0
100], set Params [50 100 100]
12. Double click on Untitled (mamdani), select two input SD, NG and corresponding output VS, click on
Add rule. Repeat it for corresponding rest of eight inputs output combination. Make sure and is
checked Click on close button.
13. Click on View>>> Rules. Set the Desired input values to [60 70].
15. Change the current folder directory from the left of your command window.
Exercise:
1. I=[50, X, 10, 25; 40, 12, 23, 40; 45, 62, 15, 23; X+1, 25, 33, 34]; where X is last two digit of your
ID. Apply Walsh-Hadamard Transform (WHT) of I by hand calculation and by MATLAB code.
3. Design a fuzzy controller for a steam turbine assuming the input of the controller as temperature and
pressure. The output will be the throttle setting of a steam turbine. Use three descriptors for input and
five descriptors for output variables. Derive the set of rules for controller action and get the de-fuzzified
values.
Hints: temperature={cool, nominal, warm}, pressure={low, ok, strong}, throttle setting of
turbine={large negative, small negative, Zero, small positive, large positive}
Range: temperature: 0 ≤ x ≤ 40, pressure: 0 ≤ y ≤ 100, output: -100 ≤ x ≤ 100
4. Design a controller to control the speed of a dc motor by changing the input voltage. Assume input is
speed of the motor in RPM and output is input voltage for the controller. Use three descriptors for
input and output variables. Derive the set of rules for controller action and get the de-fuzzified values.
Hints: As here only one input variable, no input combinations is required, just set the rule between
input and output.
Instruction: Generate a pdf file containing all hand calculation, MATLAB code and screen shot of the
output. For the question 3 and 4, send corresponding .fis file also.