07.02.2013 Views

Optimization and Computational Fluid Dynamics - Department of ...

Optimization and Computational Fluid Dynamics - Department of ...

Optimization and Computational Fluid Dynamics - Department of ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5 Efficient Deterministic Approaches for Aerodynamic Shape <strong>Optimization</strong> 123<br />

Table 5.2 Forward differentiated evaluation trace<br />

it is<br />

v−1 = x1<br />

=1.5<br />

˙v−1 =˙x1<br />

=1.0<br />

v0 = x2<br />

=0.5<br />

˙v0 =˙x2<br />

=0.0<br />

v1 = v−1/v0 =1.5/0.5 =3.0000<br />

˙v1 =˙v−1/v0 − v−1 ˙v0/v0/v0<br />

=(˙v−1 − v1 ˙v0)/v0 =(1.0−3.0 × 0.0)/0.5 =2.0000<br />

v2 =sin(v1) =sin(3.0) = 0.1411<br />

˙v2 =cos(v1)˙v1 =(−0.99) × 2.0 = −1.9800<br />

v3 = v1 + v2 =3.0+0.1411 = 3.1411<br />

˙v3 =˙v1 +˙v2 =2.0− 1.98 = 0.0200<br />

y = v3<br />

=3.1411<br />

˙y = v3 ˙<br />

=0.0200<br />

v1 = ∂y<br />

∂v1<br />

= ∂y ∂v3<br />

∂v3 ∂v1<br />

∂(v1 + v2)<br />

= v3<br />

∂v1<br />

∂v1<br />

= v3<br />

∂v1<br />

∂v2<br />

+ v3<br />

∂v1<br />

∂(sin v1)<br />

= v3(1 + )<br />

∂v1<br />

This can also be evaluated by the iterative equations<br />

v1 = v3<br />

v2 = v3<br />

(5.29)<br />

(5.30)<br />

= v3 + v3 cos(v1) . (5.31)<br />

v1 = v1 + v2 cos(v1) .<br />

Thus applying the chain rule to every line in the evaluation trace <strong>of</strong> Table<br />

5.1, we obtain the reverse differentiated code in Table 5.3. Note that the<br />

adjoint statements are lined up vertically underneath the original statements<br />

that spawned them.<br />

Note also that line 7 <strong>of</strong> Table 5.3 belongs to the expansion <strong>of</strong> Eq. (5.29),<br />

lines 8 <strong>and</strong> 9 to the expansion <strong>of</strong> Eq. (5.30) <strong>and</strong> line 10 to the expansion <strong>of</strong><br />

Eq. (5.31).<br />

As with the forward propagation method, the floating-point operation<br />

count <strong>of</strong> the added lines is a small multiple <strong>of</strong> that for the underlying code<br />

to evaluate y. But this time the complete gradient has been computed.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!