Environmental Engineering Reference
In-Depth Information
square-root: the objective is to minimize the term
e
understood as a function of the
parameter
l
:
X
cðt
fit
;
l
Þc
fit
2
eð
l
Þ¼
(10.7)
Note that
c
also is conceived as a function of the parameter l. A necessary
condition for the minimum value of
l
is that the derivative of
e
with respect to
l
becomes zero:
2
X
cðt
fit
;
l
Þc
fit
@c
@
l
ðt
fit
;
l
Þ¼
@e
@
l
¼
0
(10.8)
Obviously the leading two of condition (
10.8
) can be omitted. The last factor can
be obtained from (
10.2
),
@c
@
l
¼tc
0
exp
ð
l
tÞ¼t c
(10.9)
leading to the following formulation of the condition:
X
cðt
fit
;
l
Þc
fit
cðt
fit
;
l
Þt
fit
¼
0
(10.10)
Using the vector notation, the last formula can also be written as:
c
T
c
ð
t
fit
;
l
Þ
c
fit
ð
t
fit
;
l
Þ
t
fit
¼
0
(10.11)
One can define the right hand side as a function, and the conditions (
10.10
)or
(
10.11
) are fulfilled for the zero of that function. In order to find the zero of
a function, MATLAB
provides the
fzero
command.
fzero
starts a MATLAB
®
algorithm for the computation of the zeros of
a function
f
(
x
), i.e. to find a value
x
0
with
f
(
x
0
)
®
0. If
fzero
is called, at least
two parameters have to be given by the user. One concerns the function
f
, the other
is a starting value for
x
0
:
¼
fzero(@f,x0);
knows. For example, one
obtains the well-known zero of the cosine-function by the command:
The function
f
can be any function which MATLAB
®
fzero(@cos,0.11)
ans =
1.5708
p
/2. The input of another start value may yield another
zero of the cosinus-function, as demonstrated by the following command:
As expected, the zero is