You are on page 1of 27

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/335870957

Exercises and Examples of Fuzzy Logic Controller Using Toolbox and M File of
MATLAB

Book · September 2019

CITATIONS READS

0 9,435

1 author:

Mohammad Ali
Universiti Tenaga Nasional (UNITEN)
86 PUBLICATIONS   26 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Modeling View project

Building model for heat transfer View project

All content following this page was uploaded by Mohammad Ali on 17 September 2019.

The user has requested enhancement of the downloaded file.


Exercises and Examples of Fuzzy Logic Controller Using Toolbox and M File of MATLAB

Dr. Mohammad Ali


Department of Electrical & Electronic EngineeringTel, University of
Nottingham Malaysia Campus Jalan Broga, 43500 Semenyih, Selangor Darul
Ehsan, Malaysia
+60-3-89212020
Email: ali.abbas@nottingham.edu.my

Matlab and Simulink are used in exercise in fuzzy logic Toolbox to control the temperature of an
oven. fuzzy logic Controller is a control system based on fuzzy logic which takes continuous
values for some logic
clear% Clear all variables in memory
% Initialize ship parameters
% (can test two conditions, ‘‘ballast" or ‘‘full"):
ell=350; % Length of the ship (in meters)
u=5; % Nominal speed (in meters/sec)
% u=3; % A lower speed where the ship is more difficult to control
abar=1; % Parameters for nonlinearity
bbar=1;
% The parameters for the tanker under ‘‘ballast" conditions
% (a heavy ship) are:
K_0=5.88;
tau_10=-16.91;
tau_20=0.45;
tau_30=1.43;
% The parameters for the tanker under ‘‘full" conditions (a ship
% that weighs less than one under ‘‘ballast" conditions) are:
% K_0=0.83;
% tau_10=-2.88;
% tau_20=0.38;
% tau_30=1.07;
% Some other parameters are:
K=K_0*(u/ell);
tau_1=tau_10*(ell/u);
tau_2=tau_20*(ell/u);
tau_3=tau_30*(ell/u);
% Initialize parameters for the fuzzy controller
nume=11; % Number of input membership functions for the e
% universe of discourse (can change this but must also
% change some variables below if you make such a change)
numc=11; % Number of input membership functions for the c
% universe of discourse (can change this but must also
% change some variables below if you make such a change)
% Next, we define the scaling gains for tuning membership functions for
% universes of discourse for e, change in e (what we call c) and
% delta. These are g1, g2, and g0, respectively
% These can be tuned to try to improve the performance.
% First guess:
g1=.05/pi;g2=300;g0=8*pi/18; % Chosen since:
% g1: The heading error is at most 180 deg (pi rad)
% g2: Just a guess - that ship heading will change at most
% by 0.01 rad/sec (0.57 deg/sec)
% g0: Since the rudder is constrained to move between +-80 deg
% Tuning:
%g1=1/pi;g2=200;g0=8*pi/18; % Try to reduce the overshoot
%g1=2/pi;g2=250;g0=8*pi/18; % Try to speed up the response
% g1=2/pi;,g2=0.000001;,g0=2000*pi/18; % Values tuned to get oscillation
% (limit cycle) for COG, ballast, and nominal speed with no sensor
% noise or rudder disturbance):
% g1: Leave as before
% g2: Essentially turn off the derivative gain
% since this help induce an oscillation
% g0: Make this big to force the limit cycle
% In this case simulate for 16,000 sec.
% g1=2/pi;,g2=250;,g0=-8*pi/18; % Values tuned to get an instability
% g0: Make this negative so that when there
% is an error the rudder will drive the
% heading in the direction to increase the error
% Next, define some parameters for the membership functions
we=0.2*(1/g1);
% we is half the width of the triangular input membership
% function bases (note that if you change g0, the base width
% will correspondingly change so that we always end
% up with uniformly distributed input membership functions)
% Note that if you change nume you will need to adjust the
% ‘‘0.2" factor if you want membership functions that
% overlap in the same way.
wc=0.2*(1/g2);
% Similar to we but for the c universe of discourse
base=0.4*g0;
% Base width of output membership fuctions of the fuzzy
% controller
% Place centers of membership functions of the fuzzy controller:
% Centers of input membership functions for the e universe of
% discourse of fuzzy controller (a vector of centers)
ce=[-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1]*(1/g1);
% Centers of input membership functions for the c universe of
% discourse of fuzzy controller (a vector of centers)
cc=[-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1]*(1/g2);
% This next matrix specifies the rules of the fuzzy controller.
% The entries are the centers of the output membership functions.
% This choice represents just one guess on how to synthesize
% the fuzzy controller. Notice the regularity
% of the pattern of rules. Notice that it is scaled by g0, the
% output scaling factor, since it is a normalized rule base.
% The rule base can be tuned to try to improve performance.
rules=[...
1 1 1 1 1 1 0.8 0.6 0.3 0.1 0;
1 1 1 1 1 0.8 0.6 0.3 0.1 0 -0.1;
1 1 1 1 0.8 0.6 0.3 0.1 0 -0.1 -0.3;
1 1 1 0.8 0.6 0.3 0.1 0 -0.1 -0.3 -0.6;
1 1 0.8 0.6 0.3 0.1 0 -0.1 -0.3 -0.6 -0.8;
1 0.8 0.6 0.3 0.1 0 0.1 -0.3 -0.6 -0.8 -1;
0.8 0.6 0.3 0.1 0 -0.1 -0.3 -0.6 -0.8 -1 -1;
0.6 0.3 0.1 0 -0.1 -0.3 -0.6 -0.8 -1 -1 -1;
0.3 0.1 0 -0.1 -0.3 -0.6 -0.8 -1 -1 -1 -1;
0.1 0 -0.1 -0.3 -0.6 -0.8 -1 -1 -1 -1 -1;
0 -0.1 -0.3 -0.6 -0.8 -1 -1 -1 -1 -1 -1]*g0;

% Now, you can proceed to do the simulation or simply view the nonlinear
% surface generated by the fuzzy controller.
flag1=input('\ n Do you want to simulate the \ n fuzzy control system \ n for
the tanker? \ n (type 1 for yes and 0 for no) ');
if flag1==1,
% Next, we initialize the simulation:
t=0; % Reset time to zero
index=1; % This is time's index (not time, its index).
tstop=4000; % Stopping time for the simulation (in
% seconds)
step=1; % Integration step size
T=10;% The controller is implemented in discrete
% time and
% this is the sampling time for the
% controller.
% Note that the integration step size
% and the sampling
% time are not the same. In this way
% we seek to simulate
% the continuous time system via the
% Runge-Kutta method and
% the discrete time fuzzy controller as
% if it were
% implemented by a digital computer.
% Hence, we sample
% the plant output every T seconds
% and at that time
% output a new value of the controller
% output.
counter=10; % This counter will be used to count the
% number of integration
% steps that have been taken in the current
% sampling interval.
% Set it to 10 to begin so that it will
% compute a fuzzy controller
% output at the first step.
% For our example, when 10 integration steps
% have been
% taken we will then we will sample the ship
% heading
% and the reference heading and compute a
% new output
% for the fuzzy controller.
eold=0; % Initialize the past value of the error (for
% use in computing the change of the error, c).
% Notice
% that this is somewhat of an arbitrary choice since
% there is no last time step. The same
% problem is encountered in implementation.
x=[0;0;0]; % First, set the state to be a vector
x(1)=0; % Set the initial heading to be zero
x(2)=0; % Set the initial heading rate to be zero.
% We would also like to set x(3) initially
% but this must be done after we have computed the
% output of the fuzzy controller. In this case,
% by choosing the reference trajectory to be
% zero at the beginning and the other
% initial conditions as they are, and the fuzzy controller as
% designed, we will know that the output of the
% fuzzy controller
% will start out at zero so we could have
% set
% x(3)=0 here. To keep things more general,
% however,
% we set the intial condition immediately
% after
% we compute the first controller output
% in the
% loop below.
psi_r_old=0; % Initialize the reference trajectory
% Next, we start the simulation of the system.
% This is the main loop for the simulation of fuzzy
% control system.
while t <= tstop
% First, we define the reference input psi_r (desired
% heading).
if t<100, psi_r(index)=0; end
% Request heading of 0 deg
if t>=100, psi_r(index)=45*(pi/180); end
% Request heading of 45 deg
if t>2000, psi_r(index)=0; end
% Then request heading of 0 deg
% if t>4000, psi r(index)=45*(pi/180); end
% Then request heading of 45 deg
% if t>6000, psi r(index)=0; end
% Then request heading of 0 deg
% if t>8000, psi r(index)=45*(pi/180); end
% Then request heading of 45 deg
% if t>10000, psi r(index)=0; end
% Then request heading of 0 deg
% if t>12000, psi r(index)=45*(pi/180); end
% Then request heading of 45 deg
% Next, suppose that there is sensor noise for the
% heading sensor with that is additive, with a uniform
% distribution on [- 0.01,+0.01] deg.
% s(index)=0.01*(pi/180)*(2*rand-1);
s(index)=0; % This allows us to remove the noise.
psi(index)=x(1)+s(index);
% Heading of the ship (possibly with sensor noise).
if counter == 10,
% When the counter reaches 10 then execute the
% fuzzy controller
counter=0; % First, reset the counter
% Fuzzy controller calculations:
% First, for the given fuzzy controller inputs we
% determine the extent at which the error membership
% functions of the fuzzy controller are on
% (this is the fuzzification part).
c_count=0;e_count=0;
% These are used to count the
% number of non-zero mf
% certainities of e and c
e(index)=psi_r(index)-psi(index);
% Calculates the error input for
% the fuzzy controller
c(index)=(e(index)-eold)/T; % Sets the value of c
eold=e(index); % Save the past value of e for
% use in the above computation the
% next time around the loop
% The following if-then structure fills the vector mfe
% with the certainty of each membership fucntion of e
% for the current input e. We use triangular
% membership functions.
if e(index)<=ce(1)
% Takes care of saturation of the left-most
% membership function
mfe=[1 0 0 0 0 0 0 0 0 0 0];
% i.e., the only one on is the
% left-most one
e_count=e_count+1;e_int=1;
% One mf on, it is the
% left-most one.
elseif e(index) >=ce(nume)
% Takes care of saturation
% of the right-most mf
mfe=[0 0 0 0 0 0 0 0 0 0 1];
e_count=e_count+1;e_int=nume;
% One mf on, it is the
% right-most one
else
% In this case the input is on the middle
% part of the universe of discourse for e
% Next, we are going to cycle through the mfs
% to find all that are on
for i=1:nume
if e(index)<=ce(i)
mfe(i)=max([0 1+(e(index)-ce(i))/we]);
% In this case the input is to the
% left of the center ce(i) and we compute
% the value of the mf centered at ce(i)
% for this input e
if mfe(i)~=0
% If the certainty is not equal to zero then say
% that have one mf on by incrementing our count
e_count=e_count+1;
e_int=i; % This term holds the index last entry
% with a non-zero term
end
else
mfe(i)=max([0,1+(ce(i)-e(index))/we]);
% In this case the input is to the
% right of the center ce (i)
if mfe(i)~=0
e_count=e_count+1;
e_int=i; % This term holds the index of the
% last entry with a non-zero ter
end
end
end
end
% The following if-then structure fills the vector mfc
% with the certainty of each membership fucntion of the c
% for its current value (to understand this part of the
% code see the above similar code for computing mfe).
% Clearly, it could be more efficient to make a subroutine
% that performs these computations for each of the fuzzy
% system inputs.
if c(index)<=cc(1)
% Takes care of saturation of left-most mf
mfc=[1 0 0 0 0 0 0 0 0 0 0];
c_count=c_count+1;
c_int=1;
elseif c(index)>=cc(numc)
% Takes care of saturation of the right-most mf
mfc=[0 0 0 0 0 0 0 0 0 0 1];
c_count=c_count+1;
c_int=numc;
else
for i=1:numc
if c(index)<=cc(i)
mfc(i)=max([0,1+(c(index)-cc(i))/wc]);
if mfc(i)~=0
c_count=c_count+1;
c_int=i;
% This term holds last entry
% with a non-zero term
end
end
end
end
% The next two loops calculate the crisp output using
% only the non- zero premise of error,e, and c. This
% cuts down computation time since we will only compute
% the contribution from the rules that are on (i.e., a
% maximum of four rules for our case). The minimum
% is center-of-gravity used for the premise
% (and implication for the defuzzification case).
num=0;
den=0;
for k=(e_int-e_count+1):e_int
% Scan over e indices of mfs that are on
for l=(c_int-c_count+1):c_int
% Scan over c indices of mfs that are on
prem=min([mfe(k) mfc(l)]);
% Value of premise membership function
% This next calculation of num adds up the numerator for
% the center of gravity defuzzification formula.
% rules(k,l) is the output center for the rule.
% base*(prem-(prem)^ 2/2) is the area of a symmetric
% triangle that peaks at one with base width ‘‘base"
% and that is chopped off at a height of prem (since
% we use minimum to represent the implication).
% Computation of den is similar but without rules(k,l).
num=num+rules(k,l)*base*(prem-(prem)^2/2);
den=den+base*(prem-(prem)^2/2);
% To do the same computations, but for center-average
% defuzzification, use the following lines of code rather
% than the two above (notice that in this case we did not
% use any information about the output membership function
% shapes, just their centers; also, note that the
% computations are slightly simpler for the center-average
% defuzzificaton):
% num=num+rules(k,l)*prem;
% den=den+prem;
end
end
delta(index)=num/den;
% Crisp output of fuzzy controller that is the input
% to the plant.
else
% This goes with the ‘‘if" statement to check if the
% counter=10 so the next lines up to the next ‘‘end"
% statement are executed whenever counter is not
% equal to 10
% Now, even though we do not compute the fuzzy
% controller at eachtime instant, we do want to
% save the data at its inputs and output at each time
% instant for the sake of plotting it. Hence, we need to
% compute these here (note that we simply hold the
% values constant):
e(index)=e(index-1);
c(index)=c(index-1);
delta(index)=delta(index-1);
end
% This is the end statement for the ‘‘if counter=10" statement
% Now, for the first step, we set the initial
% condition for the third state x(3).
if t==0, x(3)=-(K*tau_3/(tau_1*tau_2))*delta(index); end
% Next, the Runge-Kutta equations are used to find the
% next state. Clearly, it would be better to use a Matlab
% ‘‘function" for F (but here we do not, so we can have only
% one program).
time(index)=t;
% First, we define a wind disturbance against the body
% of the ship that has the effect of pressing water
% against the rudder
% w(index)=0.5*(pi/180)*sin(2*pi*0.001*t); % This is an
% additive sine disturbance to the rudder input. It
% is of amplitude of 0.5 deg. and its period is 1000sec.
% delta(index)=delta(index)+w(index);
% Next, implement the nonlinearity where the rudder angle
% is saturated at +-80 degrees
if delta(index) >= 80*(pi/180), delta(index)=80*(pi/180);
end
if delta(index) <= -80*(pi/180), delta(index)=-80*(pi/180);
end
% Next, we use the formulas to implement the Runge-Kutta
% method (note that here only an approximation to the
% method is implemented where we do not compute the
% function at multiple points in the integration step size).
xx1= x(2);
xx2=x(3)+(K*tau_3/(tau_1*tau_2))*delta(index);
xx3=-((1/tau_1)+(1/tau_2))*(x(3)+ (K*tau_3/(tau_1*tau_2))*delta(index))-...
(1/(tau_1*tau_2))*(abar*x(2)^3 + bbar*x(2)) +(K/(tau_1*tau_2))*delta(index);
F=[xx1;xx2;xx3 ];
k1=step*F;
xnew=x+k1/2;
xx1= x(2);
xx2=xnew(3)+ (K*tau_3/(tau_1*tau_2))*delta(index);
xx3=-((1/tau_1)+(1/tau_2))*(xnew(3))+ (K*tau_3/(tau_1*tau_2))*delta(index)-
...
(1/(tau_1*tau_2))*(abar*xnew(2)^ 3 + bbar*xnew(2))
+(K/(tau_1*tau_2))*delta(index);
F=[xx1;xx2;xx3 ];
k2=step*F;
xnew=x+k2/2;
F=[ xnew(2) ;
xnew(3)+ (K*tau_3/(tau_1*tau_2))*delta(index) ;
-((1/tau_1)+(1/tau_2))*(xnew(3)+(K*tau_3/(tau_1*tau_2))*delta(index))-...
(1/(tau_1*tau_2))*(abar*xnew(2)^ 3 + bbar*xnew(2))+
(K/(tau_1*tau_2))*delta(index) ];
k3=step*F;
xnew=x+k3;
F=[ xnew(2) ;
xnew(3)+ (K*tau_3/(tau_1*tau_2))*delta(index) ;
-((1/tau_1)+(1/tau_2))*(xnew(3)+(K*tau_3/(tau_1*tau_2))*delta(index))-...
(1/(tau_1*tau_2))*(abar*xnew(2)^ 3 + bbar*xnew(2))+
(K/(tau_1*tau_2))*delta(index) ];
k4=step*F;
x=x+(1/6)*(k1+2*k2+2*k3+k4); % Calculated next state
t=t+step; % Increments time
index=index+1; % Increments the indexing term so that
% index=1 corresponds to time t=0.
counter=counter+1; % Indicates that we computed one more
% integration step
end % This end statement goes with the first ‘‘while"
% statement in the program so when this is complete the simulation is done.
%
% Next, we provide plots of the input and output of the
% ship along with the reference heading that we want
%to track. Also, we plot the two inputs to the
% fuzzy controller.
%
% First, we convert from rad. to degrees
psi_r=psi_r*(180/pi);
psi=psi*(180/pi);
delta=delta*(180/pi);
e=e*(180/pi);
c=c*(180/pi);
% Next, we provide plots of data from the simulation
figure(1)
clf
subplot(211)
plot(time,psi,'k-',time,psi_r,'k--')
% grid on
xlabel('Time (sec)')
title('Ship heading (solid) and desired ship heading(dashed), deg.')
subplot(212)
plot(time,delta,'k-')
% grid on
xlabel('Time (sec)')
title('Rudder angle (?), deg.')
zoom
figure(2)
clf
subplot(211)
plot(time,e,'k-')
% grid on
xlabel('Time (sec)')
title('Ship heading error between ship heading and desired heading, deg.')
subplot(212)
plot(time,c,'k-')
% grid on
xlabel('Time (sec)')
title('Change in ship heading error, deg./sec')
zoom
end % This ends the if statement (on flag1) on whether
% you want to do a simulation or just
% see the control surface
% % % % % % % % % % % % % % % % %
% Next, provide a plot of the fuzzy controller surface:
% % % % % % % % % % % % % % % % %
% Request input from the user to see if they want to
% see the controller mapping:
flag2=input('\ n Do you want to see the nonlinear\ n mapping implemented by
the fuzzy \ n controller? \ n (type 1 for yes and 0 for no) ');
if flag2==1,
% First, compute vectors with points over the whole range
% of the fuzzy controller inputs plus 20% over the end of
% the range and put 100 points in each vector
e_input=(-(1/g1)-0.2*(1/g1)):(1/100)*(((1/g1)+ 0.2*(1/g1))-(-(1/g1)-...
0.2*(1/g1))):((1/g1)+0.2*(1/g1));
ce_input=(-(1/g2)-0.2*(1/g2)):(1/100)*(((1/g2)+ 0.2*(1/g2))-(-(1/g2)-...
0.2*(1/g2))):((1/g2)+0.2*(1/g2));
% Next, compute the fuzzy controller output for all
% these inputs
for jj=1:length(e_input)
for ii=1:length(ce_input)
c_count=0;e_count=0; % These are used to count the
% number of non-zero mf certainities of e and c
% The following if-then structure fills the vector mfe
% with the certainty of each membership fucntion of e
% for the current input e. We use triangular
% membership functions.
if e_input(jj)<=ce(1)
% Takes care of saturation of the left-most
% membership function
mfe=[1 0 0 0 0 0 0 0 0 0 0]; % i.e.,the only one on is the left-most one
e_count=e_count+1;e_int=1; % One mf on, it is the left-most one.
elseif e_input(jj)>=ce(nume)
% Takes care of saturation
% of the right-most mf
mfe=[0 0 0 0 0 0 0 0 0 0 1];
e_count=e_count+1;e_int=nume; % One mf on, it is the right-most one
else
% In this case the input is on the
% middle part of the universe of
% discourse for e Next, we are going to
% cycle through the mfs to find all
% that are on
for i=1:nume
if e_input(jj)<=ce(i)
mfe(i)=max([0 1+(e_input(jj)-ce(i))/we]);
% In this case the input is to the
% left of the center ce(i) and we compute
% the value of the mf centered at ce(i)
% for this input e
if mfe(i)~=0
% If the certainty is not equal to zero then say
% that have one mf on by incrementing our count
e_count=e_count+1;
e_int=i;
% This term holds the index last entry with a non-zero term
end
else
mfe(i)=max([0,1+(ce(i)-e_input(jj))/we]);
% In this case the input is to the right of the center ce(i)
if mfe(i)~=0
e_count=e_count+1;
e_int=i;
% This term holds the index of the last entry with a non-zero term
end
end
end
end
% The following if-then structure fills the vector mfc
% with the certainty of each membership fucntion of the c
% for its current value.
if ce_input(ii)<=cc(1)
% Takes care of saturation of left-most mf
mfc=[1 0 0 0 0 0 0 0 0 0 0];
c_count=c_count+1;
c_int=1;
elseif ce_input(ii)>=cc(numc)
% Takes care of saturation of the right-most mf
mfc=[0 0 0 0 0 0 0 0 0 0 1];
c_count=c_count+1;
c_int=numc;
else
for i=1:numc
if ce_input(ii)<=cc(i)
mfc(i)=max([0,1+(ce_input(ii)-cc(i))/wc]);
if mfc(i)~=0
c_count=c_count+1;
c_int=i; % This term holds last entry with a non-zero term
end
else
mfc(i)=max([0,1+(cc(i)-ce_input(ii))/wc]);
if mfc(i)~=0
c_count=c_count+1;
c_int=i;% This term holds last entry with a non-zero term
end
end
end
end
% The next loops calculate the crisp output using only
% the non-zero premise of error,e, and c.
num=0;
den=0;
for k=(e_int-e_count+1):e_int
% Scan over e indices of mfs that are on
for l=(c_int-c_count+1):c_int
% Scan over c indices of mfs that are on
prem=min([mfe(k) mfc(l)]);
% Value of premise membership function
% This next calculation of num adds up the numerator
% for the center of gravity defuzzification formula.
num=num+rules(k,l)*base*(prem-(prem)^2/2);
den=den+base*(prem-(prem)^2/2);
% To do the same computations, but for center-average
% defuzzification, use the following lines of code rather
% than the two above:
% num=num+rules(k,l)*prem;
% den=den+prem;
end
end
delta_output(ii,jj)=num/den;
% Crisp output of fuzzy controller that is the input
% to the plant.
end
end
% Convert from radians to degrees:
delta_output=delta_output*(180/pi);
e_input=e_input*(180/pi);
ce_input=ce_input*(180/pi);
% Plot the controller map
figure(3)
clf
surf(e_input,ce_input,delta_output);
view(145,30);
colormap(white);
xlabel('Heading error (e), deg.');
ylabel('Change in heading error (c), deg.');
zlabel('Fuzzy controller output (?), deg.');
title('Fuzzy controller mapping between inputs and output');
end
% % % % % % % % % % % % % % % % % % % % % % % % % %
%
% End of program %
% % % % % % % % % % % % % % % % % % % % % % % % % % %
Design of Fuzzy Logic Controller for Temperature Control of an Oven

clear% Clear all variables in memory


% Initialize ship parameters
% (can test two conditions, ‘‘ballast" or ‘‘full"):
ell=350; % Length of the ship (in meters)
u=5; % Nominal speed (in meters/sec)
% u=3; % A lower speed where the ship is more difficult to control
abar=1; % Parameters for nonlinearity
bbar=1;
% The parameters for the tanker under ‘‘ballast" conditions
% (a heavy ship) are:
K_0=5.88;
tau_10=-16.91;
tau_20=0.45;
tau_30=1.43;
% The parameters for the tanker under ‘‘full" conditions (a ship
% that weighs less than one under ‘‘ballast" conditions) are:
% K_0=0.83;
% tau_10=-2.88;
% tau_20=0.38;
% tau_30=1.07;
% Some other parameters are:
K=K_0*(u/ell);
tau_1=tau_10*(ell/u);
tau_2=tau_20*(ell/u);
tau_3=tau_30*(ell/u);
% Initialize parameters for the fuzzy controller
nume=11; % Number of input membership functions for the e
% universe of discourse (can change this but must also
% change some variables below if you make such a change)
numc=11; % Number of input membership functions for the c
% universe of discourse (can change this but must also
% change some variables below if you make such a change)
% Next, we define the scaling gains for tuning membership functions for
% universes of discourse for e, change in e (what we call c) and
% delta. These are g1, g2, and g0, respectively
% These can be tuned to try to improve the performance.
% First guess:
g1=.05/pi;g2=300;g0=8*pi/18; % Chosen since:
% g1: The heading error is at most 180 deg (pi rad)
% g2: Just a guess - that ship heading will change at most
% by 0.01 rad/sec (0.57 deg/sec)
% g0: Since the rudder is constrained to move between +-80 deg
% Tuning:
%g1=1/pi;g2=200;g0=8*pi/18; % Try to reduce the overshoot
%g1=2/pi;g2=250;g0=8*pi/18; % Try to speed up the response
% g1=2/pi;,g2=0.000001;,g0=2000*pi/18; % Values tuned to get oscillation
% (limit cycle) for COG, ballast, and nominal speed with no sensor
% noise or rudder disturbance):
% g1: Leave as before
% g2: Essentially turn off the derivative gain
% since this help induce an oscillation
% g0: Make this big to force the limit cycle
% In this case simulate for 16,000 sec.
% g1=2/pi;,g2=250;,g0=-8*pi/18; % Values tuned to get an instability
% g0: Make this negative so that when there
% is an error the rudder will drive the
% heading in the direction to increase the error

% Next, define some parameters for the membership functions


we=0.2*(1/g1);
% we is half the width of the triangular input membership
% function bases (note that if you change g0, the base width
% will correspondingly change so that we always end
% up with uniformly distributed input membership functions)
% Note that if you change nume you will need to adjust the
% ‘‘0.2" factor if you want membership functions that
% overlap in the same way.
wc=0.2*(1/g2);
% Similar to we but for the c universe of discourse
base=0.4*g0;
% Base width of output membership fuctions of the fuzzy
% controller
% Place centers of membership functions of the fuzzy controller:
% Centers of input membership functions for the e universe of
% discourse of fuzzy controller (a vector of centers)
ce=[-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1]*(1/g1);
% Centers of input membership functions for the c universe of
% discourse of fuzzy controller (a vector of centers)
cc=[-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1]*(1/g2);
% This next matrix specifies the rules of the fuzzy controller.
% The entries are the centers of the output membership functions.
% This choice represents just one guess on how to synthesize
% the fuzzy controller. Notice the regularity
% of the pattern of rules. Notice that it is scaled by g0, the
% output scaling factor, since it is a normalized rule base.
% The rule base can be tuned to try to improve performance.
rules=[...
1 1 1 1 1 1 0.8 0.6 0.3 0.1 0;
1 1 1 1 1 0.8 0.6 0.3 0.1 0 -0.1;
1 1 1 1 0.8 0.6 0.3 0.1 0 -0.1 -0.3;
1 1 1 0.8 0.6 0.3 0.1 0 -0.1 -0.3 -0.6;
1 1 0.8 0.6 0.3 0.1 0 -0.1 -0.3 -0.6 -0.8;
1 0.8 0.6 0.3 0.1 0 0.1 -0.3 -0.6 -0.8 -1;
0.8 0.6 0.3 0.1 0 -0.1 -0.3 -0.6 -0.8 -1 -1;
0.6 0.3 0.1 0 -0.1 -0.3 -0.6 -0.8 -1 -1 -1;
0.3 0.1 0 -0.1 -0.3 -0.6 -0.8 -1 -1 -1 -1;
0.1 0 -0.1 -0.3 -0.6 -0.8 -1 -1 -1 -1 -1;
0 -0.1 -0.3 -0.6 -0.8 -1 -1 -1 -1 -1 -1]*g0;

% Now, you can proceed to do the simulation or simply view the nonlinear
% surface generated by the fuzzy controller.
flag1=input('\ n Do you want to simulate the \ n fuzzy control system \ n for
the tanker? \ n (type 1 for yes and 0 for no) ');
if flag1==1,
% Next, we initialize the simulation:
t=0; % Reset time to zero
index=1; % This is time's index (not time, its index).
tstop=4000; % Stopping time for the simulation (in
% seconds)
step=1; % Integration step size
T=10;% The controller is implemented in discrete
% time and
% this is the sampling time for the
% controller.
% Note that the integration step size
% and the sampling
% time are not the same. In this way
% we seek to simulate
% the continuous time system via the
% Runge-Kutta method and
% the discrete time fuzzy controller as
% if it were
% implemented by a digital computer.
% Hence, we sample
% the plant output every T seconds
% and at that time
% output a new value of the controller
% output.
counter=10; % This counter will be used to count the
% number of integration
% steps that have been taken in the current
% sampling interval.
% Set it to 10 to begin so that it will
% compute a fuzzy controller
% output at the first step.
% For our example, when 10 integration steps
% have been
% taken we will then we will sample the ship
% heading
% and the reference heading and compute a
% new output
% for the fuzzy controller.
eold=0; % Initialize the past value of the error (for
% use in computing the change of the error, c).
% Notice
% that this is somewhat of an arbitrary choice since
% there is no last time step. The same
% problem is encountered in implementation.
x=[0;0;0]; % First, set the state to be a vector
x(1)=0; % Set the initial heading to be zero
x(2)=0; % Set the initial heading rate to be zero.
% We would also like to set x(3) initially
% but this must be done after we have computed the
% output of the fuzzy controller. In this case,
% by choosing the reference trajectory to be
% zero at the beginning and the other
% initial conditions as they are, and the fuzzy controller as
% designed, we will know that the output of the
% fuzzy controller
% will start out at zero so we could have
% set
% x(3)=0 here. To keep things more general,
% however,
% we set the intial condition immediately
% after
% we compute the first controller output
% in the
% loop below.
psi_r_old=0; % Initialize the reference trajectory
% Next, we start the simulation of the system.
% This is the main loop for the simulation of fuzzy
% control system.
*while t <= tstop
% First, we define the reference input psi_r (desired
% heading).
if t<100, psi_r(index)=0; end
% Request heading of 0 deg
if t>=100, psi_r(index)=45*(pi/180); end
% Request heading of 45 deg
if t>2000, psi_r(index)=0; end
% Then request heading of 0 deg
% if t>4000, psi r(index)=45*(pi/180); end
% Then request heading of 45 deg
% if t>6000, psi r(index)=0; end
% Then request heading of 0 deg
% if t>8000, psi r(index)=45*(pi/180); end
% Then request heading of 45 deg
% if t>10000, psi r(index)=0; end
% Then request heading of 0 deg
% if t>12000, psi r(index)=45*(pi/180); end
% Then request heading of 45 deg
% Next, suppose that there is sensor noise for the
% heading sensor with that is additive, with a uniform
% distribution on [- 0.01,+0.01] deg.
% s(index)=0.01*(pi/180)*(2*rand-1);
s(index)=0; % This allows us to remove the noise.
psi(index)=x(1)+s(index);
% Heading of the ship (possibly with sensor noise).
if counter == 10,
% When the counter reaches 10 then execute the
% fuzzy controller
counter=0; % First, reset the counter
% Fuzzy controller calculations:
% First, for the given fuzzy controller inputs we
% determine the extent at which the error membership
% functions of the fuzzy controller are on
% (this is the fuzzification part).
c_count=0;e_count=0;
% These are used to count the
% number of non-zero mf
% certainities of e and c
e(index)=psi_r(index)-psi(index);
% Calculates the error input for
% the fuzzy controller
c(index)=(e(index)-eold)/T; % Sets the value of c
eold=e(index); % Save the past value of e for
% use in the above computation the
% next time around the loop
% The following if-then structure fills the vector mfe
% with the certainty of each membership fucntion of e
% for the current input e. We use triangular
% membership functions.
if e(index)<=ce(1)
% Takes care of saturation of the left-most
% membership function
mfe=[1 0 0 0 0 0 0 0 0 0 0];
% i.e., the only one on is the
% left-most one
e_count=e_count+1;e_int=1;
% One mf on, it is the
% left-most one.
elseif e(index) >=ce(nume)
% Takes care of saturation
% of the right-most mf
mfe=[0 0 0 0 0 0 0 0 0 0 1];
e_count=e_count+1;e_int=nume;
% One mf on, it is the
% right-most one
else
% In this case the input is on the middle
% part of the universe of discourse for e
% Next, we are going to cycle through the mfs
% to find all that are on
for i=1:nume
if e(index)<=ce(i)
mfe(i)=max([0 1+(e(index)-ce(i))/we]);
% In this case the input is to the
% left of the center ce(i) and we compute
% the value of the mf centered at ce(i)
% for this input e
if mfe(i)~=0
% If the certainty is not equal to zero then say
% that have one mf on by incrementing our count
e_count=e_count+1;
e_int=i; % This term holds the index last entry
% with a non-zero term
end
else
mfe(i)=max([0,1+(ce(i)-e(index))/we]);
% In this case the input is to the
% right of the center ce (i)
if mfe(i)~=0
e_count=e_count+1;
e_int=i; % This term holds the index of the
% last entry with a non-zero ter
end
end
end
end
% The following if-then structure fills the vector mfc
% with the certainty of each membership fucntion of the c
% for its current value (to understand this part of the
% code see the above similar code for computing mfe).
% Clearly, it could be more efficient to make a subroutine
% that performs these computations for each of the fuzzy
% system inputs.
if c(index)<=cc(1)
% Takes care of saturation of left-most mf
mfc=[1 0 0 0 0 0 0 0 0 0 0];
c_count=c_count+1;
c_int=1;
elseif c(index)>=cc(numc)
% Takes care of saturation of the right-most mf
mfc=[0 0 0 0 0 0 0 0 0 0 1];
c_count=c_count+1;
c_int=numc;
else
for i=1:numc
if c(index)<=cc(i)
mfc(i)=max([0,1+(c(index)-cc(i))/wc]);
if mfc(i)~=0
c_count=c_count+1;
c_int=i;
% This term holds last entry
% with a non-zero term
end
end
end
end
% The next two loops calculate the crisp output using
% only the non- zero premise of error,e, and c. This
% cuts down computation time since we will only compute
% the contribution from the rules that are on (i.e., a
% maximum of four rules for our case). The minimum
% is center-of-gravity used for the premise
% (and implication for the defuzzification case).
num=0;
den=0;
for k=(e_int-e_count+1):e_int
% Scan over e indices of mfs that are on
for l=(c_int-c_count+1):c_int
% Scan over c indices of mfs that are on
prem=min([mfe(k) mfc(l)]);
% Value of premise membership function
% This next calculation of num adds up the numerator for
% the center of gravity defuzzification formula.
% rules(k,l) is the output center for the rule.
% base*(prem-(prem)^ 2/2) is the area of a symmetric
% triangle that peaks at one with base width ‘‘base"
% and that is chopped off at a height of prem (since
% we use minimum to represent the implication).
% Computation of den is similar but without rules(k,l).
num=num+rules(k,l)*base*(prem-(prem)^2/2);
den=den+base*(prem-(prem)^2/2);
% To do the same computations, but for center-average
% defuzzification, use the following lines of code rather
% than the two above (notice that in this case we did not
% use any information about the output membership function
% shapes, just their centers; also, note that the
% computations are slightly simpler for the center-average
% defuzzificaton):
% num=num+rules(k,l)*prem;
% den=den+prem;
end
end
delta(index)=num/den;
% Crisp output of fuzzy controller that is the input
% to the plant.
else
% This goes with the ‘‘if" statement to check if the
% counter=10 so the next lines up to the next ‘‘end"
% statement are executed whenever counter is not
% equal to 10
% Now, even though we do not compute the fuzzy
% controller at eachtime instant, we do want to
% save the data at its inputs and output at each time
% instant for the sake of plotting it. Hence, we need to
% compute these here (note that we simply hold the
% values constant):
e(index)=e(index-1);
c(index)=c(index-1);
delta(index)=delta(index-1);
end
% This is the end statement for the ‘‘if counter=10" statement
% Now, for the first step, we set the initial
% condition for the third state x(3).
if t==0, x(3)=-(K*tau_3/(tau_1*tau_2))*delta(index); end
% Next, the Runge-Kutta equations are used to find the
% next state. Clearly, it would be better to use a Matlab
% ‘‘function" for F (but here we do not, so we can have only
% one program).
time(index)=t;
% First, we define a wind disturbance against the body
% of the ship that has the effect of pressing water
% against the rudder
% w(index)=0.5*(pi/180)*sin(2*pi*0.001*t); % This is an
% additive sine disturbance to the rudder input. It
% is of amplitude of 0.5 deg. and its period is 1000sec.
% delta(index)=delta(index)+w(index);
% Next, implement the nonlinearity where the rudder angle
% is saturated at +-80 degrees
if delta(index) >= 80*(pi/180), delta(index)=80*(pi/180);
end
if delta(index) <= -80*(pi/180), delta(index)=-80*(pi/180);
end
% Next, we use the formulas to implement the Runge-Kutta
% method (note that here only an approximation to the
% method is implemented where we do not compute the
% function at multiple points in the integration step size).
xx1= x(2);
xx2=x(3)+(K*tau_3/(tau_1*tau_2))*delta(index);
xx3=-((1/tau_1)+(1/tau_2))*(x(3)+ (K*tau_3/(tau_1*tau_2))*delta(index))-...
(1/(tau_1*tau_2))*(abar*x(2)^3 + bbar*x(2)) +(K/(tau_1*tau_2))*delta(index);
F=[xx1;xx2;xx3 ];
k1=step*F;
xnew=x+k1/2;
xx1= x(2);
xx2=xnew(3)+ (K*tau_3/(tau_1*tau_2))*delta(index);
xx3=-((1/tau_1)+(1/tau_2))*(xnew(3))+ (K*tau_3/(tau_1*tau_2))*delta(index)-
...
(1/(tau_1*tau_2))*(abar*xnew(2)^ 3 + bbar*xnew(2))
+(K/(tau_1*tau_2))*delta(index);
F=[xx1;xx2;xx3 ];
k2=step*F;
xnew=x+k2/2;
F=[ xnew(2) ;
xnew(3)+ (K*tau_3/(tau_1*tau_2))*delta(index) ;
-((1/tau_1)+(1/tau_2))*(xnew(3)+(K*tau_3/(tau_1*tau_2))*delta(index))-...
(1/(tau_1*tau_2))*(abar*xnew(2)^ 3 + bbar*xnew(2))+
(K/(tau_1*tau_2))*delta(index) ];
k3=step*F;
xnew=x+k3;
F=[ xnew(2) ;
xnew(3)+ (K*tau_3/(tau_1*tau_2))*delta(index) ;
-((1/tau_1)+(1/tau_2))*(xnew(3)+(K*tau_3/(tau_1*tau_2))*delta(index))-...
(1/(tau_1*tau_2))*(abar*xnew(2)^ 3 + bbar*xnew(2))+
(K/(tau_1*tau_2))*delta(index) ];
k4=step*F;
x=x+(1/6)*(k1+2*k2+2*k3+k4); % Calculated next state
t=t+step; % Increments time
index=index+1; % Increments the indexing term so that
% index=1 corresponds to time t=0.
counter=counter+1; % Indicates that we computed one more
% integration step
*end % This end statement goes with the first ‘‘while"
% statement in the program so when this is complete the simulation is done.
%
% Next, we provide plots of the input and output of the
% ship along with the reference heading that we want
%to track. Also, we plot the two inputs to the
% fuzzy controller.
%
% First, we convert from rad. to degrees
psi_r=psi_r*(180/pi);
psi=psi*(180/pi);
delta=delta*(180/pi);
e=e*(180/pi);
c=c*(180/pi);
% Next, we provide plots of data from the simulation
figure(1)
clf
subplot(211)
plot(time,psi,'k-',time,psi_r,'k--')
% grid on
xlabel('Time (sec)')
title('Ship heading (solid) and desired ship heading(dashed), deg.')
subplot(212)
plot(time,delta,'k-')
% grid on
xlabel('Time (sec)')
title('Rudder angle (?), deg.')
zoom
figure(2)
clf
subplot(211)
plot(time,e,'k-')
% grid on
xlabel('Time (sec)')
title('Ship heading error between ship heading and desired heading, deg.')
subplot(212)
plot(time,c,'k-')
% grid on
xlabel('Time (sec)')
title('Change in ship heading error, deg./sec')
zoom
end % This ends the if statement (on flag1) on whether
% you want to do a simulation or just
% see the control surface
% % % % % % % % % % % % % % % % %
% Next, provide a plot of the fuzzy controller surface:
% % % % % % % % % % % % % % % % %
% Request input from the user to see if they want to
% see the controller mapping:
flag2=input('\ n Do you want to see the nonlinear\ n mapping implemented by
the fuzzy \ n controller? \ n (type 1 for yes and 0 for no) ');
if flag2==1,
% First, compute vectors with points over the whole range
% of the fuzzy controller inputs plus 20% over the end of
% the range and put 100 points in each vector
e_input=(-(1/g1)-0.2*(1/g1)):(1/100)*(((1/g1)+ 0.2*(1/g1))-(-(1/g1)-...
0.2*(1/g1))):((1/g1)+0.2*(1/g1));
ce_input=(-(1/g2)-0.2*(1/g2)):(1/100)*(((1/g2)+ 0.2*(1/g2))-(-(1/g2)-...
0.2*(1/g2))):((1/g2)+0.2*(1/g2));
% Next, compute the fuzzy controller output for all
% these inputs
for jj=1:length(e_input)
for ii=1:length(ce_input)
c_count=0;e_count=0; % These are used to count the
% number of non-zero mf certainities of e and c
% The following if-then structure fills the vector mfe
% with the certainty of each membership fucntion of e
% for the current input e. We use triangular
% membership functions.
if e_input(jj)<=ce(1)
% Takes care of saturation of the left-most
% membership function
mfe=[1 0 0 0 0 0 0 0 0 0 0]; % i.e.,the only one on is the left-most one
e_count=e_count+1;e_int=1; % One mf on, it is the left-most one.
elseif e_input(jj)>=ce(nume)
% Takes care of saturation
% of the right-most mf
mfe=[0 0 0 0 0 0 0 0 0 0 1];
e_count=e_count+1;e_int=nume; % One mf on, it is the right-most one
else
% In this case the input is on the
% middle part of the universe of
% discourse for e Next, we are going to
% cycle through the mfs to find all
% that are on
for i=1:nume
if e_input(jj)<=ce(i)
mfe(i)=max([0 1+(e_input(jj)-ce(i))/we]);
% In this case the input is to the
% left of the center ce(i) and we compute
% the value of the mf centered at ce(i)
% for this input e
if mfe(i)~=0
% If the certainty is not equal to zero then say
% that have one mf on by incrementing our count
e_count=e_count+1;
e_int=i;
% This term holds the index last entry with a non-zero term
end
else
mfe(i)=max([0,1+(ce(i)-e_input(jj))/we]);
% In this case the input is to the right of the center ce(i)
if mfe(i)~=0
e_count=e_count+1;
e_int=i;
% This term holds the index of the last entry with a non-zero term
end
end
end
end
% The following if-then structure fills the vector mfc
% with the certainty of each membership fucntion of the c
% for its current value.
if ce_input(ii)<=cc(1)
% Takes care of saturation of left-most mf
mfc=[1 0 0 0 0 0 0 0 0 0 0];
c_count=c_count+1;
c_int=1;
elseif ce_input(ii)>=cc(numc)
% Takes care of saturation of the right-most mf
mfc=[0 0 0 0 0 0 0 0 0 0 1];
c_count=c_count+1;
c_int=numc;
else
for i=1:numc
if ce_input(ii)<=cc(i)
mfc(i)=max([0,1+(ce_input(ii)-cc(i))/wc]);
if mfc(i)~=0
c_count=c_count+1;
c_int=i; % This term holds last entry with a non-zero term
end
else
mfc(i)=max([0,1+(cc(i)-ce_input(ii))/wc]);
if mfc(i)~=0
c_count=c_count+1;
c_int=i;% This term holds last entry with a non-zero term
end
end
end
end
% The next loops calculate the crisp output using only
% the non-zero premise of error,e, and c.
num=0;
den=0;
for k=(e_int-e_count+1):e_int
% Scan over e indices of mfs that are on
for l=(c_int-c_count+1):c_int
% Scan over c indices of mfs that are on
prem=min([mfe(k) mfc(l)]);
% Value of premise membership function
% This next calculation of num adds up the numerator
% for the center of gravity defuzzification formula.
num=num+rules(k,l)*base*(prem-(prem)^2/2);
den=den+base*(prem-(prem)^2/2);
% To do the same computations, but for center-average
% defuzzification, use the following lines of code rather
% than the two above:
% num=num+rules(k,l)*prem;
% den=den+prem;
end
end
delta_output(ii,jj)=num/den;
% Crisp output of fuzzy controller that is the input
% to the plant.
end
end
% Convert from radians to degrees:
delta_output=delta_output*(180/pi);
e_input=e_input*(180/pi);
ce_input=ce_input*(180/pi);
% Plot the controller map
figure(3)
clf
surf(e_input,ce_input,delta_output);
view(145,30);
colormap(white);
xlabel('Heading error (e), deg.');
ylabel('Change in heading error (c), deg.');
zlabel('Fuzzy controller output (?), deg.');
title('Fuzzy controller mapping between inputs and output');
end
% % % % % % % % % % % % % % % % % % % % % % % % % %
%
% End of program %
% % % % % % % % % % % % % % % % % % % % % % % % % % %

References

[1] R.Z. Homod, Falah A. Abood, Sana M. Shrama, Ahmed K. Alshara (2019), Empirical Correlations for Mixed Convection
Heat Transfer Through a Fin Array Based on Various Orientations, International Journal of Thermal Sciences, 137 (2019)
627-639.

[2] Raad Z. Homod, (2018), Measuring Device for Human Comfort Sensation and Influence of High Air Temperature,
Conference: Creativity creates peoples, DOI: 10.13140/RG.2.2.34338.89288.

[3] Raad Z. Homod, (2018), Analysis and Optimization of HVAC Control Systems Based on Energy and Performance
Considerations for Smart Buildings, Renewable Energy, 126 (2018) 49-64.

[4] Raad Z. Homod, (2018), Measuring Device for Human Comfort Sensation by Converting Fanger Formula Using
Applications of Artificial Intelligence, Patent, Iq, G01N23/20033 (2018) G05D23/19.

[5] M.S. Ahmed, A. Mohamed, T. Khatib, H. Shareef, Raad Z. Homod, J.A. Ali, (2017), Real Time Optimal Schedule
Controller for Home Energy Management System Using New Binary Backtracking Search Algorithm, Energy and
Buildings, 138 (2017) 215–227.

[6] MS. Ahmed, A. Mohamed, Raad Z. Homod, H. Shareef, (2017), A home energy management algorithm in demand response
events for household peak load reduction, PrzeglAd˛ Elektrotechniczny 93 (3), 2017, 197–200.

[7] MS. Ahmed, A. Mohamed, Raad Z. Homod, H. Shareef, (2017). Awareness on Energy Management in Residential
Buildings: A Case Study in Kajang and Putrajaya, Journal of Engineering Science and Technology, 12 (5) 1280 – 1294.

[8] MS. Ahmed, A. Mohamed, Raad Z. Homod, H. Shareef, (2016) Modeling of Electric Water Heater and Air Conditioner for
Residential Demand Response Strategy, International Journal of Applied Engineering Research, 11(16) 9037-9046.

[9] M.S. Ahmed; A. Mohamed; H. Shareef; Raad Z. Homod; J.A. Ali; K.B. Khalid, (2016), Artificial neural network based
controller for home energy management considering demand response events, conference on Advances of Electrical,
Electronic and Systems Engineering, ICAEESE, (2016) 32 - 36.

[10] MS. Ahmed, A. Mohamed, Raad Z. Homod, H. Shareef, (2016) Hybrid LSAANN Based Home Energy Management
Scheduling Controller for Residential Demand Response Strategy, Energies 2016(9)716.

[11] M.S. Ahmed; A. Mohamed; Raad Z. Homod; H. Shareef; A.H. Sabry; K.B. Khalid, (2015), Smart plug prototype for
monitoring electrical appliances in Home Energy Management System, conference on research and development, IEEE,
(2015) 32 - 36.

[12] Raad Z. Homod, (2014) “Assessment regarding energy saving and decoupling for different AHU (air handling unit) and
control strategies in the hot-humid climatic region of Iraq” Energy, 74 (2014) 762-774.

[13] Raad Z. Homod, K. S. M. Sahari, H. A.F. Almurib, F. H. Nagi, (2014) “Corrigendum to Gradient auto-tuned Takagi–
Sugeno Fuzzy Forward control of a HVAC system using predicted mean vote index” Energy and Buildings, 82 (2014) 812.

[14] Raad Z. Homod, K. S. M. Sahari, H. A.F. Almurib (2014) “Energy saving by integrated control of natural ventilation and
HVAC systems using model guide for comparison” Renewable Energy,71 ( 2014) 639–650.

[15] R. Z. Homod, (2014) “Modeling and Fault-Tolerant Control Developed for HVAC Systems” LAP LAMBERT Academic
Publishing, (2014), ISBN: 978-3-659-57392-7.

[16] R. Z. Homod, K. S. M. Sahari, (2014), Intelligent HVAC Control for High Energy Efficiency in Buildings, LAP LAMBERT
Academic Publishing, ISBN: 978-3-8473-0625-2.

[17] Maytham S. Ahmed and Raad. Z. Homod, (2014) “Energy Saving by Tackling Shaft Voltage in Turbine Generators” LAP
LAMBERT Academic Publishing, (2014), ISBN: 978-3-659-58452-7.

[18] R. Z. Homod, K. S. M. Sahari, (2013) “Energy Savings by Smart Utilization of Mechanical and Natural Ventilation for
Hybrid Residential Building Model in Passive Climate” Energy and Buildings, 60 (2013) 310–329.
[19] K S M Sahari, M F Abdul Jalal, R Z Homod and Y K Eng, (2013) “Dynamic indoor thermal comfort model identification
based on neural computing PMV index” conference series: earth and environmental science, IOP, 16 (2013) 012113.

[20] R. Z. Homod, (2013) “Review on the HVAC System Modeling Types and the Shortcomings of Their Application” Journal
of Energy, (Vol. 2013), ID 768632, 10 pages.

[21] R. Z. Homod, K. S. M. Sahari, H. A.F. Almurib, F. H. Nagi, (2012), Gradient auto-tuned Takagi-Sugeno fuzzy forward
control of a HVAC system using predicted mean vote index, Energy and Buildings, 49 (6) (2012) 254-267.

[22] R. Z. Homod, K. S. M. Sahari, H. A.F. Almurib, F. H. Nagi, (2012), RLF and TS fuzzy model identification of indoor
thermal comfort based on PMV/PPD, Building and Environment, 49 (2012)141-153.

[23] Raad. Z. Homod, K. S. M. Sahari, H. A.F. Almurib, F. H. Nagi, (2012) “Corrigendum to Double cooling coil model for non-
linear HVAC system using RLF method” Energy and Buildings, Volume 43 (2011) 3737.

[24] R.Z. Homod (2012), “Takagi-Sugeno Fuzzy Modelling and Adaptive Control of Indoor Thermal Comfort in HVAC Systems
Using Predicted Mean Vote Index”, PhD Thesis, University of Tenaga Nasional, Kajang, Malaysia.

[25] Raad. Z. Homod, K. S. M. Sahari, H. A.F. Almurib, F. H. Nagi, (2011), Double cooling coil model for non-linear HVAC
system using RLF method, Energy and Buildings, Volume 43 (2011) 2043–2054.

[26] R.Z. Homod, K.S.M. Sahari, H.A.F. Mohamed, F. Nagi, (2010), Modeling of heat and moisture transfer in building using
RLF method, conference on research and development, IEEE, (2010) 287 – 292.

[27] R. Z Homod., K. S. M. Sahari, H. A. F. Mohamed, F. Nagi, (2010), Hybrid PID-cascade control for HVAC system,
international journal of systems control, 1 (4) (2010) 170-175.

[28] R. Z. Homod, (2009) “Automatic Control for HVAC System” Book, Jabatan Kejuruteraan Mekanik, Fakulti Kejuruteraan,
Universiti Malaya, 2009, 208 pages.

[29] R. Z. Homod, T. M. I. Mahlia, Haider A. F. Mohamed (2009) “PID-Cascade for HVAC System Control” International
Conference on Control, Instrumentation and Mechatronic Engineering (CIM09), June 2-3, (2009) 598-603.

[30] R. Z. Homod, T. M. I. Mahlia, Haider A. F. Mohamed (2009) “Rejection of Sensor Deterioration, Noise, Disturbance and
Plant Parameters Variation in HVAC System” International Conference on Control, Instrumentation and Mechatronic
Engineering (CIM09), June 2-3, (2009) 604-609.

[31] R.Z. Homod (2009), “Automatic Control for Hvac System” M.Sc. Thesis, University of Malaya, Kuala Lumpur, Malaysia.

[32] Raad Z. Homod, (2018), Algorytm zarządzania konsumpcj a enegii w gospodarstwach domowych, Renewable Energy, 126
(2018) 49-64.

[33] Raad Z. Homod, (2018), FUZZY MODELLING AND ADAPTIVE CONTROL OF INDOOR THERMAL COMFORT IN
HVAC SYSTEMS USING PREDICTED MEAN VOTE INDEX, 126 (2018) 49-64.

[34] Raad Z. Homod, (2018), Review in the HVAC System modeling types and the shortcomings of its application, Renewable
Energy, 126 (2018) 49-64.
[35] Raad Z. Homod, (2018), Robust Control of Heat Exchangers for energy saving, Renewable Energy, 126 (2018) 49-64.

[36] Maytham S Ahmed, Azah Mohamed, Raad Z Homod, Hussain Shareef, Ahmad H Sabry, (2018), khairuddin bin khalid Smart Plug
Prototype for Monitoring Electrical Appliances in Home Energy Management System, 2015 IEEE Student Conference on Research and
Development (SCOReD) 49-64.

[37] R. Z. Homod, K. S. M. Sahari, (2014), Intelligent HVAC control for high energy efficiency in buildings: achieving energy
savings with developed nonlinear control strategies of central air-condition for intelligent buildings, LAP LAMBERT
Academic Publishing, ISBN: 978-3-8473-0625-2.

[38] Raad Z. Homod, (2019), Viva of my thesis: TS Fuzzy Modelling and Adaptive Control of Indoor Comfort in HVAC
Systems Using Predicted Mean Vote Index, 126 (2019) 49-64.
[39] Raad Z. Homod, (2019), Neural Control For HVAC System, 66 (2019) 19-68.

[40] Raad Z. Homod, (2018), Two-Phase Spray Cooling of the Electronics System, 687 (2018) 12-48.

, 687 (2018) 12-48.‫راحة قياس جهاز‬ ‫ االصطناعي الذكاء تطبيقات احد باستخدام فانكر معادلة بتحويل االنسان‬Raad Z. Homod, (2018), ]14[

View publication stats

You might also like