Professional Documents
Culture Documents
? HW1finish - JL - Pluto - JL
? HW1finish - JL - Pluto - JL
jl
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.
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!
localhost:1234/edit?id=9221ead0-9710-11ec-3f9a-0928852f9f4f 3/15
2022/2/26 晚上10:58 🎈 HW1finish.jl — Pluto.jl
maximum_takeoff_weight
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!
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.
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.
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
Exercise
Define a function to evaluate the fuel weight fraction here.
Hint
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
Exercise
Define a function for Raymer's regression formula:
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 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 .
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
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
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:
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