Environmental Engineering Reference
In-Depth Information
The arrays t and lambda hold the time and tip speed ratio respectively as
calculated by the Matlab function:
½
t; lambda
¼ ode45ð@ t,lambda
ð
Þderivðt, lambda,c1,c2,chord; ...
twist; radÞ; 0tmax
½
; 0:0Þ;
Note the syntax for invoking ode45 and passing the extra (but necessary) infor-
mation to the function deriv to calculate the derivative. ode45 , along with all
Matlab ODE solvers, requires the dependent and independent variables to be
passed to the derivative function as arrays. In Matlab, operations that are to be
carried out term-by-term are preceded by a period (.), of which there are four in the
following line:
tmp ¼ sqrt 1 þ lamr2
ð
Þ: sind twist
ð
Þ: ðcosd twist
ð
Þ
lamr: sind twist
ð
ÞÞ: ... chord: rad;
Matlab functions, such as sqrt and sind always operate term-by-term. tmp is
then summed to find the total aerodynamic torque on each blade. The treatment of
tmp is an example of vectorisation, an alternative to operations that would nor-
mally be done in a loop in other languages. Looping however, is very time con-
suming in Matlab and is to be avoided if possible. Issues of computational time
become very important in Chap. 7 in discussing numerical optimisation that
requires many thousand evaluations of objective functions.
It is possible to make ode45 stop at k = lambda_start , but this is somewhat
cumbersome to program. It is easier to ensure that tmax , the upper limit on the
ODE solution, is larger than the time to start, then use the Matlab function find to
locate the first value of t for which k exceeds the final value for starting and then
interpolate linearly to find the time to start.
Below is a snippet of a Matlab session showing a run of the program for a three-
bladed turbine with R = 1.5 m with the same chord and twist distribution as used
by Anderson et al. [ 6 ], and made from a material with density 550 kg m -3 . The
time step, dt, for the Adams-Moulton method is 0.1 s. The starting wind speed is
5 m/s and starting is deemed to be completed when k = 1.
[[ start calc 3; 5; 550; 1; 0:ð Þ
Time to start from RK ¼ 4:022 seconds
Time to start from AM ¼ 4:010 seconds
[[
Figure 6.9 shows the calculated starts with the adaptive Runge-Kutta method
as the solid line and the Adams-Moulton solutions with varying delt have the
symbol indicated. The integration is not difficult and it is to be expected that
accurate results can be obtained, especially for comparative purposes, from rela-
tively large values of delt , even though start_calc.m does not provide accurate
starting values for the Adams-Moulton method for dt.
Search WWH ::




Custom Search