Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.

jl

Initial Weight Estimation (Exercise)


Author: Arjit SETH, Research Assistant, MAE, HKUST.

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 1/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl

Problem Specification
Reference: Raymer, Daniel P., Aircraft Design: A Conceptual Approach, Fourth Edition, Chapter 3.

Consider the design of an aircraft similar to a Lockheed S-3 Viking.

Anti-submarine warfare aircraft specifications:

Crew: passengers, kgs + kgs baggage each


Payload: Radar equipment, kgs
Cruise condition: at ft
Maximum lift-to-drag ratio:

Exercise
Assign the payload and crew weights, the Mach number, and the for this mission to
variables.

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 2/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl
16.0
⋅ begin
⋅ g=9.81

⋅ Wcrew=90*g
⋅ WPL=4500*g
⋅ Mach=0.6
⋅ LD_max=16.
end

Warning!
Make sure your units are consistent!

Maximum Takeoff Weight

The 'governing equation' of this problem is:

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 3/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl
maximum_takeoff_weight

maximum_takeoff_weight(payload_weight, crew_weight, fuel_weight_frac, empty_


weight_frac)

Compute the maximum takeoff weight given payload weight, crew weight, fuel-weight
fraction, and empty-weight fraction.

⋅ """
⋅ maximum_takeoff_weight(payload_weight, crew_weight, fuel_weight_frac,
empty_weight_frac)

⋅ Compute the maximum takeoff weight given payload weight, crew weight, fuel-weight
fraction, and empty-weight fraction.
⋅ """
⋅ maximum_takeoff_weight(WPL, Wcrew, WfWTO, WeWTO) = (WPL + Wcrew)/(1 - WfWTO - WeWTO)

Tip
Writing a sentence for documenting your function as shown above is good practice! A bonus is
that it looks good in a Pluto notebook!

Mission Fuel Fractions

Takeoff
⋅ takeoffWF = 0.97;

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 4/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl

Climb
Enter a variable name you would like to use for the climb weight fraction, and assign it an
associated value.

⋅ climbWF=0.985;

Cruise

Exercise
Define a function to evaluate the cruise weight fraction here.

cruise_weight_fraction (generic function with 1 method)


⋅ cruise_weight_fraction(R,SFC,Velo,LD_cruise)=e^(-(R*SFC)/(Velo*LD_cruise))

The SFC of this aircraft configuration at cruise is: 0.5 1/hr

Evaluate your cruise weight fraction by defining the relevant variables and using your defined
function below:

13.856
⋅ begin
⋅ e=2.7182818
⋅ cruise_SFC=0.5/3600
⋅ V=303.2*Mach
⋅ R1=1500*1852
⋅ LD_cruise=LD_max*0.866
⋅ end

cruise1WF = 0.8580722750228544
⋅ cruise1WF=cruise_weight_fraction(R1,cruise_SFC,V,LD_cruise)

Loiter

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 5/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl
Exercise
Define a function to compute the loiter weight fraction with your own variables as well.

The SFC of this aircraft configuration at loiter is: 1/hr

loiter_weight_fraction (generic function with 1 method)


⋅ loiter_weight_fraction(E,SFC_Loiter,LD_maxi)=e^(-(E*SFC_Loiter)/LD_maxi)

10800
⋅ begin
⋅ loiter_SFC=0.4/3600
⋅ E1=3*3600
⋅ end

loiter1WF = 0.9277434870570285
⋅ loiter1WF=loiter_weight_fraction(E1,loiter_SFC,LD_max) #10 hours endurnace

0.8580722750228544
⋅ begin
⋅ R2=1500*1852
⋅ cruise2WF=cruise_weight_fraction(R2,cruise_SFC,V,LD_cruise)
⋅ end

⋅ begin
⋅ E2=1/3*3600;
⋅ loiter2WF=loiter_weight_fraction(E2,loiter_SFC,LD_max)
⋅ end;

Landing

⋅ landingWF = 0.995;

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 6/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl

Fuel Weight Fractions

Ideally, we'd like our function to take an array of fuel fractions


and compute the expression above.

Exercise
Define a function to evaluate the fuel weight fraction here.

fuel_weight_fraction (generic function with 1 method)


⋅ begin
⋅ fuel_weight_fraction(fuel_fracs,a)=a*(1-prod(fuel_fracs))
⋅ end

Hint

Assign your computed weight fractions to an array.

[0.97, 0.985, 0.858072, 0.927743, 0.858072, 0.991701, 0.995]


⋅ begin
⋅ W_Frac=[takeoffWF,climbWF,cruise1WF,loiter1WF,cruise2WF,loiter2WF,landingWF]
⋅ end

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 7/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl
Call your function to compute the fuel fraction with a reserve fuel requirement of 5%, and assign it
to a variable:

0.37379733545462035
⋅ begin
⋅ a=1.05
⋅ WfWTO=fuel_weight_fraction(W_Frac,a)
⋅ end

Empty Weight Fraction

Exercise
Define a function for Raymer's regression formula:

empty_weight_raymer (generic function with 1 method)


⋅ empty_weight_raymer(W0,A,B)=A*W0^B

Regression coefficients:

⋅ begin
⋅ A = 0.88
⋅ B = -0.07
⋅ end;

WeW0 = 0.4143610787251882
⋅ WeW0=empty_weight_raymer(4800*g,A,B)

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 8/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl

Iterative Estimation

Fixed-Point Iteration
Given:

We need to solve the following equation for :

We can express as the equality of two expressions. Here, we will denote the iteration number of a
variable by an additional subscript :

Alert!
The empty weight fraction is explicitly a function of , hence it has a subscript. The fuel
weight fractions are not explicitly functions of .

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 9/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl

Let the following indicate the relative error for the th iteration:

We would like our analysis to converge below some tolerance , i.e. the error should be .

compute_maximum_takeoff_weight (generic function with 1 method)


⋅ function compute_maximum_takeoff_weight(W_0, W_PL, W_crew, WfWTO, A, B;
⋅ num_iters = 20, tol = 1e-12)
⋅ # Initial value (guess)
⋅ WTO = W_0

⋅ # Array of takeoff weight values
⋅ WTOs = [WTO]

⋅ # Array of errors over iterations of size num_iters, initially infinite
⋅ errors = [ Inf; zeros(num_iters) ]

⋅ # Iterative loop
⋅ for i in 2:num_iters

⋅ # Empty weight fraction
⋅ WeWTO = empty_weight_raymer(WTO,A,B)

⋅ # Maximum takeoff weight
⋅ new_WTO = maximum_takeoff_weight(W_PL, W_crew, WfWTO, WeWTO)

⋅ # Evaluate relative error
⋅ error = abs((new_WTO - WTO)/WTO)

⋅ # Append WTO to end of WTOs array
⋅ push!(WTOs, WTO)

⋅ # Assign error to errors array at current index
⋅ errors[i]=error

⋅ # Conditional
⋅ if tol>error
⋅ break; # Hint: You can exit a loop using 'break'
⋅ else
⋅ # Assign new takeoff weight to WTO
⋅ WTO=new_WTO
⋅ end
⋅ end

⋅ # Return arrays of takeoff weights and errors
⋅ WTOs, errors[1:length(WTOs)]
⋅ end

Exercise
Rewrite this function using a while loop instead of a for loop.

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 10/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl

compute_maximum_takeoff_weight_while (generic function with 1 method)


⋅ function compute_maximum_takeoff_weight_while(W_0, W_PL, W_crew, WfWTO, A, B;
⋅ num_iters = 20, tol = 1e-12)
⋅ # Initial value (guess)
⋅ WTO = W_0

⋅ # Array of takeoff weight values
⋅ WTOs = [WTO]

⋅ # Array of errors over iterations of size num_iters, initially infinite
⋅ errors = [ Inf; zeros(num_iters) ]

⋅ stop=false
⋅ i=1

⋅ # Iterative loop
⋅ while !stop

⋅ # Empty weight fraction
⋅ WeWTO = empty_weight_raymer(WTO,A,B)

⋅ # Maximum takeoff weight
⋅ new_WTO = maximum_takeoff_weight(W_PL, W_crew, WfWTO, WeWTO)

⋅ # Evaluate relative error
⋅ error = abs((new_WTO - WTO)/WTO)

⋅ # Append WTO to end of WTOs array
⋅ push!(WTOs, WTO)

⋅ # Assign error to errors array at current index


⋅ errors[i]=error

⋅ # Conditional
⋅ if tol>error
⋅ break; # Hint: You can exit a loop using 'break'
⋅ else
⋅ # Assign new takeoff weight to WTO
⋅ WTO=new_WTO
⋅ i+=1
⋅ end
⋅ end

⋅ # Return arrays of takeoff weights and errors
⋅ WTOs, errors[1:i]
⋅ end

Set an initial value for the takeoff weight estimation procedure:

⋅ Enter cell code...

Run your iterative maximum takeoff weight estimation function here with the relevant inputs:

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 11/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl
W0 = 45027.9
⋅ W0=WPL+Wcrew

num = 15
⋅ num=15

⋅ WTOs, errors = compute_maximum_takeoff_weight_while(W0, WPL, Wcrew, WfWTO, A, B;


num_iters = num, tol=1e-12);

[45027.9, 45027.9, 2.13867e5, 177631.0, 1.81114e5, 1.80741e5, 1.80781e5, 1.80776e5, 1.80

⋅ WTOs

Check the final value of the maximum takeoff weight.

MTOW_kg = 18427.81667789237
⋅ MTOW_kg=WTOs[end]/g

⋅ begin
⋅ plot1 = plot(WTOs,
⋅ label = :none, ylabel = "MTOW", xlabel = "Iterations")
⋅ plot2 = plot(errors,
⋅ label = :none, ylabel = "log₁₀ ε", yscale = :log10, xlabel =
"Iterations")

⋅ plot(plot1, plot2, layout = (2,1))
⋅ end

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 12/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl

Appendix – Investigation
The following exercise is not graded, and is for you to investigate the effects of the regression
formula used for the empty weight fraction.

Exercise
Write a function that computes the empty weight using Roskam's regression formula:

Warning!
The coefficients and are not the same as and as shown previously in Raymer's formula!

Hint

Reuse this function in your takeoff weight estimation function compute_mtow() by computing the
empty weight fraction and see if you get different results!

You can also try a different style of iteration using the following method.

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 13/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl
Gradient-Based Iteration
A more numerically stable approach is Newton iteration, which is a gradient-based method. We can
rewrite the takeoff weight iterative equation in residual form:

Substituting the expressions for the fuel-weight and empty-weight fractions:

The Newton iteration performs the following step:

where is the derivative of the residual form. The relative error is computed similarly as in
the fixed-point iteration.

⋅ using PlutoUI​

⋅ using Plots​

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 14/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl

localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 15/15

You might also like