Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Assignment 3: Optimization of a Rocket Nose Cap (20 Marks)
ENGG1001: Programming for Engineers
Introduction
The Artemis I mission is planned to launch in June 2022, not long after this assignment is due.
Artemis I will be an uncrewed mission and the first test of NASA’s SLS (Space Launch System).
The SLS is a super heavy-lift launch vehicle with a liquid rocket for the core stage and solid rocket
boosters. The SLS stack is shown in Figure 1. The solid rocket booster is shown in exploded
view and at the top is the nose assembly. In this assignment, you are asked to re-design the nose
assembly shape of the solid rocket booster to give it better aerodynamic performance.
Figure 1: Space Launch System with exploded view of solid rocket booster. Source: NASA
Design requirement
You are asked to find the nose shape with the minimum drag for a given length, L, and base radius,
Rb. You will do that by computing the coefficient of drag, CD, for a range of nose shapes and
determining which has the smallest value for CD. The nose shapes of interest are described by a
power law:
y(x) = Rb
( x
L
)d
(1)
where y is the height of the body above the axis, x is position along the axis, Rb is the base radius,
L is the length (measured along the axis), and d is the exponent in the power law.
The following assumptions are made in this design scenario.
1
• The nose cap is flying at zero angle-of-attack. This means the analysis can be restricted to
the x − y plane. (See Figure 2.)
• Only pressure drag is included in the analysis to find a minimum drag shape. The frictional air
drag can be ignored.
• The flight condition for our design target is when the rocket is flying in the supersonic/hypersonic
regime.1
• The length, L, of the solid rocket nose assembly is 4.88m and the base radius, Rb, is 1.83m.
L
Rb
(a) full nose cap aligned for flight along x-axis (b) nose cap profile in 2D used for analysis
Figure 2: Nose cap geometry used for analysis with length and base radius labelled.
Task 1 (2 marks)
Write a function nose_shape that accepts a position x and the parameters of a power-law body.
The function should compute and return the height y above the axis of a power-law body at a
position x .
1 def nose_shape(x: float, L: float, Rb: float, d: float) -> float:
2 """
3 Parameters:
4 x (float): x-position along body
5 L (float): length of power-law body
6 Rb (float): base radius of power-law body
7 d (float): exponent in power-law body
8 Returns:
9 (float): y-position on body corresponding to x
10 """
11 ...
Write a function plot_nose_shape that accepts the parameters of a power-law body and a number
of sample points. The sample points are used to create the plot and should be evenly distributed in
the x direction. The plotting function does not return anything, but should produce a plot of the
power-law body to the screen.
1In reality, there would be an optimal nose shape at every different flight speed. Fortunately, at supersonic and
hypersonic flight speeds, the optimal shape changes only slightly over a large range of speeds. So we target this speed
regime for our design.
2
1 def plot_nose_shape(L: float, Rb: float, d: float, number_samples: int) -> None:
2 """
3 Parameters:
4 L (float): length of power-law body
5 Rb (float): base radius of power-law body
6 d (float): exponent in power-law body
7 number_samples (int): number of sample points for constructing plot
8 Returns:
9 None
10 Side-effect:
11 Plots power-law body as x-y plot to screen
12 """
13 ...
Produce a plot of the power-law body using 20 sample points. An example with L = 4.88, Rb =
1.83, d = 0.7 is shown in Figure 3. This was produced by a console session shown below.
>>> L = 4.88; Rb = 1.83; d = 0.7; number_samples = 20
>>> plot_nose_shape(L, Rb, d, number_samples)
Figure 3: Example power-law body with L = 4.88, Rb = 1.83, d = 0.7 and 20 sample points used
for plotting.
3
Analysis method to compute drag coefficient
Assume that the rocket is flying along the x-axis. This simplifies the analysis of the coefficient of
drag. To estimate the drag coefficient, we will divide the nose shape profile into panels, as shown in
Figure 4. On each panel, we can compute a local drag coefficient. To get the total drag coefficient,
we will do an area-weighted sum of the contributions from individual panels.
-0.5
0
0.5
1
1.5
2
0 1 2 3 4 5
0
1
2
3
4cd,2
y
x
Figure 4: Example nose shape divided into five panels (0–4) for computing CD using an area-
weighted sum (see Eq. 3). Black dots: nose shape; Solid blue lines: panels to approximate nose
shape. The panels are spaced at equal increments in the x direction. cd,2 indicates the local drag
coefficient on panel 2.
Let’s talk about how to compute the local drag coefficient on a panel, such as the value cd,2 shown
in Figure 4. As the nose shape flies, each panel is at its own angle of θ with respect to the direction
it pushes through the air. A single panel with its geometry labelled is shown in Figure 5.
Figure 5: Geometry of a panel with side view and front view.
Using a simple flow theory thanks to Newton2, the local drag coefficient on the panel is
cd,p = 2 sin
3 θ. (2)
2Newton proposed this idea for working out the force of water on ship hulls. The idea is that the force on the
body is only due to the fluid’s normal component of momentum, and the tangential component has no effect. At low
speeds (like ships in water), this is not a good approximation. However, in the mid 20th century, when high-speed
flight was being worked on, Newton’s theory had its day! His approximation of how the momentum is transferred is a
very good one in the supersonic-hypersonic flight regime.
4
Task 2 (1 mark)
Write a function drag_coeff_panel that computes and returns cd,p on a panel with end points
(x0, y0) and (x1, y1).
1 def drag_coeff_panel(x0: float, y0: float, x1: float, y1: float) -> float:
2 """
3 Compute local c_d on a panel with end points (x0, y0) and (x1, y1)
4
5 Parameters:
6 x0 (float): x-position at left end of panel
7 y0 (float): y-position at left end of panel
8 x1 (float): x-position at right end of panel
9 y1 (float): y-position at right end of panel
10 Returns:
11 (float): local drag coefficient
12 """
13 ...
An example output from this function is shown here.
>>> x0 = 0.0; y0 = 0.0; x1 = math.sqrt(3)/2; y1 = 0.5
>>> c_d_panel = drag_coeff_panel(x0, y0, x1, y1)
>>> c_d_panel
0.25
Computing the total drag coefficient
We mentioned earlier the use of an area-weighted sum of the individual panels to estimate the total
drag coefficient, CD. Mathematically, this sum is
CD ≈ 1
A
n−1∑
p=0
cd,pdA (3)
where A is the total area of the nose shape, cd,p is the local drag coefficient and dA is the area of
a panel. In the analysis method, A can be computed as the sum of the individual panel areas, dA.
When computing the area of the panel, we need to recognise the fact that the 2D projection of
the panel is rotated about the x-axis. This is also shown in Figure 5. The area of a panel, dA, is
computed using the panel length and multiplying by the perimeter around the nose shape at that
point:
dA = dL× perimeter (4)
= dL× 2π × ym (5)
When dividing the shape into panels, use panels with an equal length in x . Appendix A shows the
results of panel calculations in tabular form for the 5-panel example in Figure 4. This might be
useful if you are attempting to build, test and debug your own implementation.
5
Task 3 (3 marks)
Write a function that computes and returns the total coefficient of drag, CD, on a power-law body.
The function should accept the parameters of a power-law body and the number of panels to use in
the summation. In this new function, you should call previous functions that you have built and
tested.
1 def drag_coeff(L: float, Rb: float, d: float, number_panels: int) -> float:
2 """
3 Compute drag coefficient for a power-law body.
4
5 Parameters:
6 L (float): length of power-law body
7 Rb (float): base radius of power-law body
8 d (float): exponent in power-law body
9 number_panels (int): number of panels for use in C_D calculation
10 Returns:
11 (float): drag coefficient
12 """
13 ...
If we use a cone (d = 1.0) as a test, we can choose parameters so that the total CD should be the
same as the single panel test in Task 2. An example output from this function using 50 panels is
shown here.
>>> L = math.sqrt(3)/2; Rb = 0.5; d = 1.0; number_panels = 50
>>> C_D = drag_coeff(L, Rb, d, number_panels)
>>> C_D
0.25000000000000006
Task 4 (1 mark)
Write a function to produce a table of CD values for various choices of the exponent d .
1 def print_table(L: float, Rb: float, number_panels: int, d_start: float,
number_entries: int, step: float) -> None:↪→
2 """
3 Print table of C_Ds for various choices of exponent d.
4
5 Parameters:
6 L (float): length of power-law body
7 Rb (float): base radius of power-law body
8 number_panels (int): number of panels in C_D calculation
9 d_start (float): first exponent
10 number_entries (int): number of entries displayed in table
11 step (float): difference between each exponent d
12 Returns:
13 None
14 Side-effect:
15 Table is printed to screen
16 """
6
Recall that our goal is to find a nose cap configuration with a minimum drag coefficient. The table
produced by this function will help us in our goal. The table can help us explore what the influence
of changing the exponent in the power-law has on drag coefficient. Use the length and base radius
constraints for the nose cap of the SLS solid rocket booster.
An example output from this function is below.
>>> L = 4.88; Rb = 1.83; number_panels = 50; d_start = 0.5; number_entries = 11;
step = 0.05↪→
>>> print_table(L, Rb, number_panels, d_start, number_entries, step)
*****************************
* d * C_D *
*****************************
* 0.50 * 0.0649 *
* 0.55 * 0.0622 *
* 0.60 * 0.0611 *
* 0.65 * 0.0612 *
* 0.70 * 0.0625 *
* 0.75 * 0.0648 *
* 0.80 * 0.0679 *
* 0.85 * 0.0717 *
* 0.90 * 0.0761 *
* 0.95 * 0.0811 *
* 1.00 * 0.0866 *
*****************************
Hint: You should create the above table by using f-string formatting. Check the Appendix B for
layout dimensions.
Discussion 1: Converting to object-oriented design
At this point, you could actually answer the design question of a minimum-drag nose shape. Your
table should show some values where the drag coefficient reaches a minimum. To improve your
estimate of the exponent value d , you could rebuild the table with smaller steps around the values
of minimum CD. However, we will proceed to find this minimum-drag nose shape in a more rigorous
manner using an optimization method.
In terms of code design, you might notice up to this point that there has been a lot of repetition of
the power-law body parameters as arguments to the functions. This is a hint to us that we could
capture those parameters as the state of some object. Then we would be able to pass a single
object to functions rather than a long list of parameters. An object-oriented design would help here.
In the next part of this assignment, you will rebuild part of the code in object-oriented form. You
can and should leave your existing functions in place.
Task 5 (3 marks)
Write a class called PowerLawBody to represent the power-law body. At a minimum, your class
should contain the following methods. You may write additional helper methods to aid your program
design.