Your SlideShare is downloading. ×
6
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

6

167
views

Published on

DESIGN AND SIMULATE REAL TIME PROBLEM

DESIGN AND SIMULATE REAL TIME PROBLEM

Published in: Education

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
167
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. EX.NO:6 DESIGN AND SIMULATE REAL TIME PROBLEM USINGDATE: FUZZY BASED SYSTEMAIM: To design and simulate real time problem using fuzzy based system.PROBLEM DESCRIPTION: Gas Mileage Prediction illustrates the prediction of fuel consumption forautomobiles, using data from previously recorded observations.Automobile MPG (milesper gallon) prediction is a typical nonlinear regression problem, in which severalattributes of an automobiles profile information are used to predict another continuousattribute.PROCEDURE: 1. The six input attributes are no. of cylinders, displacement,horsepower, weight, acceleration, and model year. 2. The output variable to be predicted is the fuel consumption in MPG. 3. The data set is obtained from the original data file auto-gas.dat. 4. The function |exhsrch| performs an exhaustive search within the available inputs to select the set of inputs that most influence the fuel consumption. 5. ANFIS returns the error with respect to training data and checking data 6. The input-output surface shown above is a nonlinear and monotonic surface and illustrates how the ANFIS model will respond to varying values ofweight and year.PROGRAM: [data, input_name] = loadgas; trn_data = data(1:2:end, :); chk_data = data(2:2:end, :); exhsrch(1, trn_data, chk_data, input_name); input_index = exhsrch(2, trn_data, chk_data, input_name); exhsrch(3, trn_data, chk_data, input_name); close all; new_trn_data = trn_data(:, [input_index, size(trn_data,2)]); new_chk_data = chk_data(:, [input_index, size(chk_data,2)]); in_fismat = genfis1(new_trn_data, 2, gbellmf); [trn_out_fismat trn_error step_size chk_out_fismat chk_error] = ... anfis(new_trn_data, in_fismat, [100 nan 0.01 0.5 1.5], [0,0,0,0], new_chk_data, 1); [a, b] = min(chk_error);
  • 2. plot(1:100, trn_error, g-, 1:100, chk_error, r-, b, a, ko);title(Training (green) and checking (red) error curve);xlabel(Epoch numbers);ylabel(RMS errors);N = size(trn_data,1);A = [trn_data(:,1:6) ones(N,1)];B = trn_data(:,7);coef = AB;Nc = size(chk_data,1);A_ck = [chk_data(:,1:6) ones(Nc,1)];B_ck = chk_data(:,7);lr_rmse = norm(A_ck*coef-B_ck)/sqrt(Nc);% Printing resultsfprintf(nRMSE against checking datanANFIS : %1.3ftLinear Regression :%1.3fn, a, lr_rmse);chk_out_fismat = setfis(chk_out_fismat, input, 1, name, Weight);chk_out_fismat = setfis(chk_out_fismat, input, 2, name, Year);chk_out_fismat = setfis(chk_out_fismat, output, 1, name, MPG);gensurf(chk_out_fismat);plot(new_trn_data(:,1), new_trn_data(:, 2), bo, ... new_chk_data(:,1), new_chk_data(:, 2), rx);xlabel(Weight);ylabel(Year);title(Training (o) and checking (x) data);displayEndOfDemoMessage(mfilename)
  • 3. OUTPUT:
  • 4. PREPARATION 30 PERFORMANCE 30 RECORD 40 TOTAL 100RESULT: Thus the program is implemented and output is verified successfully.