image thumbnail
from Wind Turbine System Identification by Sumit Tripathi
Use system Identification techniques to predict power generation from wind turbine.

Project_Example2_09.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Sean Semper                                         System Identification
% Project Code 2                                                    MAE 566
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Last Modified: 04/26/09
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc
clear
close all

load A_hat.mat 
load B_hat.mat
load C_hat.mat 
load in_out_ind.mat
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% avg_rpm	avg_powero	avg_powerr	avg_windspeed	nettwatthrs
%  load in_out_dat4.txt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% time%	nobs	avg_rpm 	avg_powero	avg_powerr	avg_windspeed
load min_avg_3109.txt
data = min_avg_3109;
u = data(:,in_out_ind(1));%+0.01*randn(length(data),1);
y = data(:,in_out_ind(2));
clear data
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% time%	nobs	(7)avg_rpm 	(8)avg_powero	(9)avg_powerr	(10)avg_windspeed      %
% load Turbinedata_sky.mat -ascii   
% u =Turbinedata_sky(1032:19260,in_out_ind(1));
% y = Turbinedata_sky(1032:19260,in_out_ind(2));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% break
% load Sheet1
% load Sheet2
% PreWindDAT = Sheet1;
% load in_out_data.mat
 
t = 1:1:length(u);

sysdt = ss(A_hat,B_hat,C_hat,[0],1)
sysc = d2c(sysdt)
figure(1)
impulse(sysc)

figure(2)
bode(sysc)

[yy,tt,xx]= lsim(sysdt,u,t);

figure(3)
plot(t,yy,'r.-',t,y,'--')
xlabel('RPM')
xlabel('time (min)')
title('Simulation of March 1, 2009')


Contact us at files@mathworks.com