Join/Login

Business Software

Open Source Software

For Vendors

Blog

About

More

Articles

Create

SourceForge Podcast

Site Documentation

Subscribe to our Newsletter

Support Request

For Vendors Help Create Join Login

Business Software

Open Source Software

SourceForge Podcast

Resources

Articles

Case Studies

Blog

Menu

Help

Create

Join

Login

Home

Browse

Matlab wind turbine model

Code

Matlab wind turbine model Code

Generic Matlab model of a wind turbine drive train.

Status: Alpha
Brought to you by: crobarcro, mcmullenjoe

Summary

Reviews

Support

Code

Menu ▾ ▴

Browse Commits

Browse Files

[r32]: / wturbinemodel.m  Maximize  Restore  History

Download this file

83 lines (45 with data), 2.4 kB

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

% A script to call on the function wturbineode

% Ask user wheather this is a tidal or wind turbine

turbine = input('If this is a tidal turbine input "tidal", if it is a wind turbine input "wind": ','s');

% If statements using the strcmp command to determine if the turbine is a

% wind or tidal turbine and gives the correct value for density

if strcmp(turbine, 'tidal') == 1

density = 1025;

elseif strcmp(turbine, 'wind') == 1

density = 1.2041;

end

% Input the time period, rotor radius, wind speed as well as set options

% for the ode function

R = input('Input the rotor radius in metres: ');

time = input('Input the length of time to be considered in seconds: ');

options = odeset('InitialStep',1,'MaxStep',(time/100));

% If statements using the strcmp command to determine if the turbine is a

% wind or tidal turbine and gives the correct request for fluid speed

if strcmp(turbine, 'tidal') == 1

v = input('Input the tidal current speed as a vector in metres per second: ');

elseif strcmp(turbine, 'wind') == 1

v = input('Input the wind speed as a vector in metres per second: ');

end

% Input whether the turbine is fixed pitch or variable pitch

pitch = input('If the turbine is fixed pitch input "fixed", if it is variable pitch input "variable": ','s');

% If statements using the strcmp command to determine if the turbine is a

% fixed pitch or variable pitch turbine. If the turbine is fixed a request

% is made for a pitch angle, no action is taken for variable speed turbine.

% The corrct number or arguments are then passed tot he wturbineode function

if strcmp(pitch, 'fixed') == 1

pitch_angle = input('Input the pitch angle of the blade in degrees: ');

elseif strcmp(pitch, 'variable') == 1

pitch_angle = [];

end

% Define time_u the timestep of the fluid speed input

time_interp = (direct_pe_fwt_w07(:,1)).';

% Call on the ode45 solver witht he requisit inputs

[t,y] = ode45(@wturbineode,[0 time],[0, 0], options, v, time_interp, R, density, pitch_angle);

% Plot angular speed and rotor position against time on two seperate

% axis using the plotyy function

plotyy(t, y(:,1), t, y(:,2));

% % Some statements used for troubleshoting

% for i = 1:numel(t)

% [dy, gen_torque(i)] = wturbineode(t(i), y(i,:), v, time_u, R, density, pitch_angle);

% end

% plot(t, gen_torque)

SourceForge

Create a Project

Open Source Software

Business Software

Top Downloaded Projects

Company

About

Team

SourceForge Headquarters
225 Broadway Suite 1600
San Diego, CA 92101
+1 (858) 422-6466

Resources

Support

Site Documentation

Site Status

SourceForge Reviews

© 2025 Slashdot Media. All Rights Reserved.

Terms Privacy Opt Out Advertise

×
Want the latest updates on software, tech news, and AI?

Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.

Submit